src/hbcore/gui/hbview.cpp
changeset 2 06ff229162e9
parent 1 f7ac710697a9
child 3 11d3954df52a
equal deleted inserted replaced
1:f7ac710697a9 2:06ff229162e9
    33 #include "hbdockwidget.h"
    33 #include "hbdockwidget.h"
    34 #include "hbwidget_p.h"
    34 #include "hbwidget_p.h"
    35 #include "hbmainwindow_p.h"
    35 #include "hbmainwindow_p.h"
    36 #include "hbtitlebar_p.h"
    36 #include "hbtitlebar_p.h"
    37 #include "hbstatusbar_p.h"
    37 #include "hbstatusbar_p.h"
    38 #include "hbsoftkeygroup_p.h"
       
    39 #include "hbscreen_p.h"
    38 #include "hbscreen_p.h"
    40 #include "hbviewactionmanager_p.h"
    39 #include "hbviewactionmanager_p.h"
    41 #include "hbglobal_p.h"
    40 #include "hbglobal_p.h"
    42 #include <QPointer>
    41 #include <QPointer>
    43 
    42 
    44 /*!
    43 /*!
    45     @beta
    44     @stable
    46     @hbcore
    45     @hbcore
    47 	\class HbView
    46 	\class HbView
    48 	\brief HbView is a base class for all the views that can be set to HbMainWindow.
    47 	\brief The HbView class defines one screen of user interface content.
    49 	
    48     
    50 	HbView is a QGraphicsWidget, which contains a title, an icon, a menu and
    49     The screen area of a mobile device is small, so an application's user interface is often composed of a set of separate screens of content or "views". Each view can contain a number of widgets. A view can also contain a title, an icon (not used at present), a menu and a toolbar. These additional components are called decorators and together they make up the "chrome" of the interface.
    51 	a tool bar for one view in HbMainWindow.
    50     
    52 	
    51     An application will have a number of views to present different kinds of information to the user. You can add multiple views to the \link HbMainWindow main window \endlink of your application and then manage them through the main window object. When a view is activated, the main window handles the updating of the view contents, i.e. the title, icon, menu and toolbar. The view object itself handles the visibility of the toolbar, but the main window will repaint it whenever the view is activated.
    53 	HbMainWindow will handle updating title, icon, menu and tool bar, when
    52 
    54 	the view is activated. Title is used in application's title pane area.
    53     \image html hbview_wireframes.png "Wireframes of two different views in a messaging application"
    55 	
    54 
    56 	HbView handles the visibility of tool bar, though HbMainWindow will
    55    
    57 	reparent it when ever view comes active.
    56     \section _usecases_hbview Using the HbView class
    58 	
    57     In general, the actual widgets, menu and toolbar that make up the content of a view will be designed with a UI layout tool. This means you do not need to use code to place each widget into the layout but instead load the layout from a file with HbDocumentLoader. Once the view is populated with widgets, you can manipulate them and connect their signals to methods in your application.
    59 	Example 1 for creating a simple view
    58 
    60 	
    59     See the HbMainWindow class for information about switching between different views.
    61 	\include view1/main.cpp
    60 
    62 	
    61     \subsection _uc_001_hbview Hiding and showing the chrome 
    63 	Example 2 for creating view with title, icon, menu, toolbar and a widget.
    62     The chrome, (i.e. title, menu and toolbar of the view) can be hidden to allow your application to fill the whole screen. Also, individual components of the chrome can be hidden if desired.
    64 	
    63 
    65 	\include view2/main.cpp
    64     \code 
    66 
    65     // Hide all the chrome items
    67     \sa HbMenu
    66     myView.setContentFullScreen(true)
    68  */
    67 
    69 /*!
    68     // Show all the chrome items
    70     \deprecated HbView::HbTitleBarFlag
    69     myView.setContentFullScreen(false)
    71         is deprecated. Use HbView::::HbViewFlag instead.
    70 
    72     \enum HbView::HbTitleBarFlag
    71     // Hide the toolbar
    73     Defines policy for showing the HbTitleBar in the current HbView.
    72     myView.hideItems(Hb::SceneItem::ToolBarItem)
    74 */
    73 
    75 /*!
    74     // Show the toolbar
    76     \var HbView::TitleBarFlagNone 
    75     myView.showItems(Hb::SceneItem::ToolBarItem)
    77     Titlebar is shown with the default attributes.
    76     \endcode
    78 */
    77 
    79 /*!
    78     \subsection _uc_002_hbview Creating a simple view
    80     \var HbView::TitleBarMinimizable When this flag is set, there will be an
    79     This code snippet shows the most basic way to create an application with a single view.
    81     indication in titlebar showing the possibility to minimize (swipe out of the
    80 
    82     screen) titlebar.  */
    81     \code
    83 /*!
    82     #include <hbapplication.h>
    84     \var HbView::TitleBarMinimized
    83     #include <hbmainwindow.h>
    85     When this flag is set, the titlebar is shown in minimized state.
    84     #include <hbview.h>
    86 */
    85 
    87 /*!
    86     int main(int argc, char *argv[])
    88     \var HbView::TitleBarHidden When this flag is set, the titlebar is not shown
    87     {
    89     at all, so that even the titlebar handle is not shown and it is not possible
    88         HbApplication app(argc, argv);
    90     to maximize the titlebar.  */
    89         HbMainWindow window;
    91 /*!
    90 
    92     \var HbView::TitleBarTransparent When this flag is set, the titlebar is
    91         HbView *view = new HbView();
    93     shown normally, but as transparent. This flag is normally used in
    92         view->setTitle("My View");
    94     combination with TitleBarFloating flag.  */
    93 
    95 /*!
    94         window.addView(view);
    96     \var HbView::TitleBarFloating When this flag is set, the titlebar is shown
    95 
    97     on top of underlying content. Setting this flag also changes application
    96         window.show();
    98     area to start from the top of the screen. This flag is normally used in
    97         return app.exec();
    99     combination with TitleBarTransparent flag.  */
    98     }
   100 
    99     \endcode
       
   100 
       
   101     \section _methodgroups_hbview Methods and properties grouped
       
   102     \li \b Chrome: setViewFlags(), showItems(), hideItems(), visibleItems(), isItemVisible(), setItemVisible(), unsetVisibleItems(),visibleItemsChanged() [signal], setContentFullScreen(), contentFullScreenChanged() [signal], isContentFullScreen(), contentFullScreen [property]
       
   103     \li \b Title: title(), setTitle(), titleChanged() [signal], title [property]
       
   104     \li \b Icon: icon(), setIcon(), iconChanged() [signal], icon [property]
       
   105     \li \b Menu: menu(), setMenu(), takeMenu()
       
   106     \li \b Toolbar: toolBar(), setToolBar(), toolBarChanged() [signal], takeToolBar()
       
   107     \li \b Actions: addAction(), setNavigationAction()
       
   108     \li \b Event: event()
       
   109     \li \b TitleBar: setTitleBarVisible()
       
   110     \li \b StatusBar: setStatusBarVisible()
       
   111     \li \b DockWidget: dockWidget(), setDockWidget(), dockWidgetChanged() [signal]
       
   112     \li \b Widget: widget(), setWidget(), takeWidget()
       
   113 
       
   114     \sa HbApplication, HbMainWindow, HbDocumentLoader, HbMenu, HbToolBar, HbDockWidget
       
   115  */
   101 /*!
   116 /*!
   102     \enum HbView::HbViewFlag
   117     \enum HbView::HbViewFlag
   103     Defines policy for showing the HbTitleBar in the current HbView.
   118     Defines policy for showing the HbTitleBar in the current HbView.
   104 */
   119 */
   105 /*!
   120 /*!
   106     \var HbView::ViewFlagNone 
   121     \var HbView::ViewFlagNone 
   107     Titlebar and statusbar is shown with the default attributes.
   122     Titlebar and statusbar is shown with the default attributes.
   108 */
   123 */
   109 /*!
   124 /*!
   110     \var HbView::ViewTitleBarMinimizable
   125     \var HbView::ViewTitleBarMinimizable
   111     When this flag is set, there will be an indication in titlebar showing the possibility to minimize (swipe out of the screen) titlebar.
   126     When this flag is set, there will be an indication in the titlebar showing the possibility to minimize the titlebar, e.g. swipe it off the screen.
   112 */
   127 */
   113 /*!
   128 /*!
   114     \var HbView::ViewTitleBarMinimized
   129     \var HbView::ViewTitleBarMinimized
   115     When this flag is set, the titlebar is shown in minimized state.
   130     Show the title bar in minimized state.
   116 */
   131 */
   117 /*!
   132 /*!
   118     \var HbView::ViewTitleBarHidden
   133     \var HbView::ViewTitleBarHidden
   119     When this flag is set, the titlebar is not shown at all, so that even the titlebar handle is not shown and it is not possible to maximize the titlebar.
   134     Do not show the title bar at all. The title bar handle is not shown and it is not possible to maximize the title bar.
   120 */
   135 */
   121 /*!
   136 /*!
   122     \var HbView::ViewTitleBarTransparent
   137     \var HbView::ViewTitleBarTransparent
   123     When this flag is set, the titlebar is shown normally, but as transparent. This flag is normally used in combination with ViewTitleBarFloating flag.
   138     Show normal style title bar but make it transparent. This flag is normally used in combination with TitleBarFloating flag.
   124 */
   139 */
   125 /*!
   140 /*!
   126     \var HbView::ViewTitleBarFloating
   141     \var HbView::ViewTitleBarFloating
   127     When this flag is set, the titlebar is shown on top of underlying content. Setting this flag also changes application area to start from the top of the screen. This flag is normally used in combination with TitleBarTransparent flag.
   142     Show the title bar floating on top of the underlying content. Setting this flag also make the application area start from the top of the screen. This flag is normally used in combination with TitleBarTransparent flag.
   128 */
   143 */
   129 /*!
   144 /*!
   130     \var HbView::ViewStatusBarHidden
   145     \var HbView::ViewStatusBarHidden
   131     When this flag is set, the statusbar is not shown at all. This flag is normally used in combination with ViewTitleBarHidden flag.
   146     Do not show the statusbar at all. This flag is normally used in combination with the ViewTitleBarHidden flag.
   132 */
   147 */
   133 /*!
   148 /*!
   134     \var HbView::ViewStatusBarTransparent
   149     \var HbView::ViewStatusBarTransparent
   135     When this flag is set, the statusbar is shown normally, but as transparent. This flag is normally used in combination with ViewStatusBarFloating flag.
   150     Show the statusbar with normal content but transparent. This flag is normally used in combination with ViewStatusBarFloating flag.
   136 */
   151 */
   137 /*!
   152 /*!
   138     \var HbView::ViewStatusBarFloating
   153     \var HbView::ViewStatusBarFloating
   139     When this flag is set, the statusbar is shown on top of underlying content. Setting this flag also changes application area to start from the top of the screen. This flag is normally used in combination with ViewStatusBarTransparent flag.
   154     Show the statusbar on top of the underlying content. Setting this flag also changes the application area to start from the top of the screen. This flag is normally used in combination with the ViewStatusBarTransparent flag.
       
   155 */
       
   156 
       
   157 /*!
       
   158     \enum HbView::ActionContainer
       
   159     Defines the default container when you add actions to a view.
       
   160     
       
   161     \sa navigationAction()
       
   162 */
       
   163 /*!
       
   164     \var HbView::NotSpecified
       
   165     Indicate that no particular action container is preferred.
       
   166 */
       
   167 /*!
       
   168     \var HbView::OptionsMenu
       
   169     Indicate that the options menu is the preferred location for an action.
       
   170 */
       
   171 /*!
       
   172     \var HbView::ToolBar
       
   173     Indicate that the tool bar is the preferred location for an action.
   140 */
   174 */
   141 
   175 
   142 /*!
   176 /*!
   143     \fn void HbView::titleChanged(const QString &title)
   177     \fn void HbView::titleChanged(const QString &title)
   144 
   178 
   145     This signal is emitted when the title changes.
   179     This signal is emitted when the title is replaced by a different title.
       
   180     
       
   181     \sa setTitle()
   146  */
   182  */
   147 
   183 
   148 /*!
   184 /*!
   149     \fn void HbView::iconChanged(const HbIcon &icon)
   185     \fn void HbView::iconChanged(const HbIcon &icon)
   150 
   186 
   151     This signal is emitted when the icon changes.
   187     This signal is emitted when the icon is replaced by a different icon.
       
   188     
       
   189     \sa setIcon()
   152  */
   190  */
   153 
   191 
   154 /*!
   192 /*!
   155     \fn void HbView::toolBarChanged()
   193     \fn void HbView::toolBarChanged()
   156 
   194 
   157     This signal is emitted when tool bar changes.
   195     This signal is emitted when toolbar is replaced by a different toolbar.
   158  */
   196     
   159 
   197     \sa setToolBar()
   160 /*!
   198  */
   161     \reimp
   199 
       
   200 /*!
       
   201    \fn void HbView::visibleItemsChanged()
       
   202  
       
   203    This signal is emitted when items in the chrome (e.g. toolbar, menu) are made visible or hidden.
       
   204    
       
   205    \sa visibleItems()
       
   206 */
       
   207 
       
   208 /*!
       
   209    \fn void HbView::contentFullScreenChanged()
       
   210  
       
   211    This signal is emitted when the view is set to occupy the whole screen.
       
   212    
       
   213    \sa setContentFullScreen()
       
   214 */
       
   215 
       
   216 /*!
       
   217    \fn void HbView::dockWidgetChanged()
       
   218  
       
   219    This signal is emitted when the dock widget is replaced by a different dock widget.
       
   220    
       
   221    \sa setDockWidget()
       
   222 */
       
   223 
       
   224 /*!
   162     \fn int HbView::type() const
   225     \fn int HbView::type() const
   163  */
   226  */
   164 
   227 
       
   228 /*!
       
   229     \internal
       
   230  */
   165 HbViewPrivate::HbViewPrivate()
   231 HbViewPrivate::HbViewPrivate()
   166     : mLayout(0), 
   232     : mLayout(0), 
   167       menu(0), 
   233       menu(0), 
   168       toolBar(0), 
   234       toolBar(0), 
   169       dockWidget(0),
   235       dockWidget(0),
   170       widget(0),
   236       widget(0),
   171       mVisibleItems(Hb::AllItems),
   237       mVisibleItems(Hb::AllItems),
   172       mVisibleItemsSet(false),
   238       mVisibleItemsSet(false),
   173       mFullscreen(false),
   239       mFullscreen(false),
   174       mVisited(false),
   240       mVisited(false),
   175       mTitleBarFlags(HbView::TitleBarFlagNone),
       
   176       mViewFlags(HbView::ViewFlagNone),
   241       mViewFlags(HbView::ViewFlagNone),
   177       actionManager(0),
   242       actionManager(0),
   178       preferredActionContainer(HbView::NotSpecified),
   243       preferredActionContainer(HbView::NotSpecified),
   179       mNavigationAction(0),
   244       mNavigationAction(0),
   180       mNavigationActionSet(false)
   245       mNavigationActionSet(false)
   181 {
   246 {
   182 }
   247 }
   183 
   248 
       
   249 /*!
       
   250     \internal
       
   251  */
   184 HbViewPrivate::~HbViewPrivate()
   252 HbViewPrivate::~HbViewPrivate()
   185 {
   253 {
   186 }
   254 }
   187 
   255 
   188 /*!
   256 /*!
   189     Constructs a view with given \a parent.
   257     Constructs a view with the given \a parent.
   190 */
   258 */
   191 HbView::HbView(QGraphicsItem *parent) :
   259 HbView::HbView(QGraphicsItem *parent) :
   192     HbWidget(*new HbViewPrivate, parent)
   260     HbWidget(*new HbViewPrivate, parent)
   193 {
   261 {
   194     Q_D(HbView);
   262     Q_D(HbView);
   204     Q_D(HbView);
   272     Q_D(HbView);
   205     d->q_ptr = this; 
   273     d->q_ptr = this; 
   206 }
   274 }
   207 
   275 
   208 /*!
   276 /*!
   209     Destructs the view.
   277     Destructor.
   210 */
   278 */
   211 HbView::~HbView()
   279 HbView::~HbView()
   212 {
   280 {
   213     Q_D(HbView);
   281     Q_D(HbView);
   214     if (d->menu) {
   282     if (d->menu) {
   221         d->dockWidget->deleteLater();
   289         d->dockWidget->deleteLater();
   222     }
   290     }
   223 }
   291 }
   224 
   292 
   225 /*!
   293 /*!
   226     Returns the title of the view.
   294   Returns the title of the view. If no title has been defined, the return value is a null string.
   227 
       
   228     The default value is a null string.
       
   229 
   295 
   230     \sa setTitle()
   296     \sa setTitle()
   231  */
   297  */
   232 QString HbView::title() const
   298 QString HbView::title() const
   233 {
   299 {
   248         emit titleChanged(title);
   314         emit titleChanged(title);
   249     }
   315     }
   250 }
   316 }
   251 
   317 
   252 /*!
   318 /*!
   253     Returns the icon of the view.
   319     Returns the icon associated with the view.
   254 
       
   255     The default value is a null icon.
   320     The default value is a null icon.
   256 
   321 
   257     \sa setIcon(), HbIcon::isNull()
   322     \sa setIcon(), HbIcon::isNull()
   258  */
   323  */
   259 HbIcon HbView::icon() const
   324 HbIcon HbView::icon() const
   261     Q_D(const HbView);
   326     Q_D(const HbView);
   262     return d->icon;
   327     return d->icon;
   263 }
   328 }
   264 
   329 
   265 /*!
   330 /*!
   266     Sets the icon of the view. The icon is associated with view.
   331     Sets the icon associated with the view.
   267 
   332 
   268     \sa icon()
   333     \sa icon()
   269  */
   334  */
   270 void HbView::setIcon(const HbIcon &icon)
   335 void HbView::setIcon(const HbIcon &icon)
   271 {
   336 {
   275         emit iconChanged(icon);
   340         emit iconChanged(icon);
   276     }
   341     }
   277 }
   342 }
   278 
   343 
   279 /*!
   344 /*!
   280     Returns the menu for the view. This function creates and returns an empty menu if it does not exist.
   345     Returns the menu for the view. This function creates and returns an empty menu if one does not already exist.
   281 
   346 
   282     Ownership is not transferred.
   347     Ownership is not transferred.
   283 
   348 
   284     \sa HbMenu setMenu()
   349     \sa HbMenu setMenu()
   285 */
   350 */
   294     }
   359     }
   295     return d->menu;
   360     return d->menu;
   296 }
   361 }
   297 
   362 
   298 /*!
   363 /*!
   299     Sets the menu for the view. Setting the menu to 0 will remove it from the view.
   364     Sets the menu for the view. Setting the menu to 0 will remove any existing menu from the view.
   300 
   365 
   301     Takes the ownership of the \a menu.
   366     The view takes ownership of the \a menu.
   302 
   367 
   303     \sa HbMenu menu()
   368     \sa HbMenu menu()
   304 */
   369 */
   305 void HbView::setMenu(HbMenu *menu)
   370 void HbView::setMenu(HbMenu *menu)
   306 {
   371 {
   314             HbMenuPrivate::d_ptr(d->menu)->changeToOptionsMenu();
   379             HbMenuPrivate::d_ptr(d->menu)->changeToOptionsMenu();
   315             if (mainWindow()) {
   380             if (mainWindow()) {
   316                 d->menu->setLayoutDirection(mainWindow()->layoutDirection());
   381                 d->menu->setLayoutDirection(mainWindow()->layoutDirection());
   317             }
   382             }
   318         }
   383         }
   319     }
   384         // Titlebar must be informed
   320 }
   385         if (mainWindow()) {
   321 
   386             HbMainWindowPrivate::d_ptr(mainWindow())->mTitleBar->propertiesChanged();
   322 /*!
   387         }
   323     Returns the tool bar for the view. This function creates and returns an empty tool bar if it does not exist.
   388     }
   324     The toolBarChanged() signal is not emitted if a new tool bar is created.
   389 }
       
   390 
       
   391 /*!
       
   392     Returns the toolbar for the view. If the view does not already have a toolbar, an 
       
   393 	empty toolbar is created and returned to the caller but the toolBarChanged() 
       
   394 	signal is not emitted.
   325 
   395 
   326     Ownership is not transferred.
   396     Ownership is not transferred.
   327 
   397 
   328     \sa HbToolBar setToolBar()
   398     \sa HbToolBar setToolBar()
   329 */
   399 */
   336     }
   406     }
   337     return d->toolBar;
   407     return d->toolBar;
   338 }
   408 }
   339 
   409 
   340 /*!
   410 /*!
   341     Sets the toolbar for the view. Setting the tool bar to 0 will remove it from the view.
   411     Sets the toolbar for the view. Setting the toolbar to 0 will remove it from the view.
   342 
   412 
   343     Takes the ownership of the \a toolBar, though it is not a parent.
   413     The view takes ownership of the toolbar, but the view is not set as the parent.
   344 
   414 
   345     \sa HbToolBar toolBar()
   415     \sa HbToolBar toolBar()
   346 */
   416 */
   347 void HbView::setToolBar(HbToolBar *toolBar)
   417 void HbView::setToolBar(HbToolBar *toolBar)
   348 {
   418 {
   355         emit toolBarChanged();
   425         emit toolBarChanged();
   356     }
   426     }
   357 }
   427 }
   358 
   428 
   359 /*!
   429 /*!
   360 Removes the HbToolBar, which is set to view and returns it.
   430 Removes the toolbar from the view and returns it to the caller.
   361 The ownership of the \a HbToolBar is transferred to the caller.
   431 Ownership of the toolbar is transferred to the caller.
   362 
   432 
   363 \note This function is particularly useful if one wants to switch between
   433 \note This function is particularly useful if you want to switch to a 
   364 different views without deleting previous toolbar.
   434 different view and keep the same toolbar.
   365 
   435 
   366     \sa setToolBar()
   436     \sa setToolBar()
   367 */
   437 */
   368 HbToolBar* HbView::takeToolBar()
   438 HbToolBar* HbView::takeToolBar()
   369 {
   439 {
   379     return toolBar;
   449     return toolBar;
   380 }
   450 }
   381 
   451 
   382 
   452 
   383 /*!
   453 /*!
   384     Returns the dock widget for the view. This function creates and returns an empty dock widget if it does not exist.
   454     Returns the dock widget belonging to the view. If the view does not have a dock widget, an empty dock widget is created and returned.
   385     The dockWidgetChanged() signal is not emitted if a new dock widget is created.
   455     The dockWidgetChanged() signal is not emitted when a new dock widget is created by this method.
   386 
   456 
   387     Ownership is not transferred.
   457     Ownership is not transferred.
   388 
   458 
   389     \sa HbDockWidget setDockWidget()
   459     \sa HbDockWidget setDockWidget()
   390 */
   460 */
   397     }
   467     }
   398     return d->dockWidget;
   468     return d->dockWidget;
   399 }
   469 }
   400 
   470 
   401 /*!
   471 /*!
   402     Sets the dock widget for the view. Setting the dock widget to 0 will remove it from the view.
   472     Sets the dock widget for the view. Setting the dock widget to \c 0 will remove it from the view.
   403 
   473 
   404     Takes the ownership of the \a dockWidget, though it is not a parent.
   474     This does take ownership of the \a dockWidget, but does not become the parent.
   405 
   475 
   406     \sa HbDockWidget dockWidget()
   476     \sa HbDockWidget dockWidget()
   407 */
   477 */
   408 void HbView::setDockWidget(HbDockWidget *dockWidget)
   478 void HbView::setDockWidget(HbDockWidget *dockWidget)
   409 {
   479 {
   416         emit dockWidgetChanged();
   486         emit dockWidgetChanged();
   417     }
   487     }
   418 }
   488 }
   419 
   489 
   420 /*!
   490 /*!
   421     Returns the widget if set, otherwise \c 0.
   491     Returns the widget that makes up the view. If the widget has not been set, this method will return 0.
   422 
   492 
   423     \sa setWidget widget takeWidget
   493     \sa setWidget takeWidget
   424 */
   494 */
   425 QGraphicsWidget *HbView::widget() const
   495 QGraphicsWidget *HbView::widget() const
   426 {
   496 {
   427     Q_D(const HbView);
   497     Q_D(const HbView);
   428     return d->widget;
   498     return d->widget;
   429 }
   499 }
   430 
   500 
   431 /*!
   501 /*!
   432     Sets the widget to be \a widget. Setting the widget to 0 will remove it from the view. Already set
   502     Sets the widget that makes up the view. Setting the \a widget value to 0 will delete the current widget.
   433     widget is deleted.
   503 
   434 
   504     The view takes the ownership of the \a widget.
   435     Takes the ownership of the \a widget.
       
   436 
   505 
   437     \sa widget takeWidget
   506     \sa widget takeWidget
   438 */
   507 */
   439 void HbView::setWidget(QGraphicsWidget *widget)
   508 void HbView::setWidget(QGraphicsWidget *widget)
   440 {
   509 {
   462         d->widget = widget;            
   531         d->widget = widget;            
   463     }
   532     }
   464 }
   533 }
   465 
   534 
   466 /*!
   535 /*!
   467 Removes the QGraphicsWidget, which is set to view and returns it. 
   536 Removes the widget that makes up the view and returns the widget to the caller.
   468 The ownership of the \a widget is transferred to the caller.
   537 Ownership of the widget is transferred to the caller.
   469 
   538 
   470 \note This function is particularly useful if one wants to switch between
   539 \note This function is particularly useful if you want to use 
   471 different widgets inside a view without deleting them.
   540 different widgets in a view without deleting them.
   472 
   541 
   473 \sa widget() setWidget()
   542 \sa widget() setWidget()
   474 */
   543 */
   475 
       
   476 QGraphicsWidget *HbView::takeWidget()
   544 QGraphicsWidget *HbView::takeWidget()
   477 {
   545 {
   478     Q_D(HbView);
   546     Q_D(HbView);
   479     QGraphicsWidget *widget = d->widget;
   547     QGraphicsWidget *widget = d->widget;
   480     if ( d->mLayout ) {
   548     if ( d->mLayout ) {
   490     }
   558     }
   491     return widget;
   559     return widget;
   492 }
   560 }
   493 
   561 
   494 /*!
   562 /*!
   495     Sets \a items to be visible in this view. Changes will be visible
   563     Makes the given scene items visible in this view. Changes are visible
   496     instantly if the view is currently active, otherwise next time when
   564     instantly if the view is active, otherwise they will be shown the next time the
   497     view is activated. View's visibility flag overrides the similar
   565     view is activated.
   498     setting in HbMainWindow.
   566     
       
   567     The flag values in \a items override the corresponding settings in HbMainWindow.
   499     
   568     
   500     \sa hideItems() setItemVisible() isItemVisible() unsetVisibleItems() visibleItems() isContentFullScreen() setContentFullScreen()
   569     \sa hideItems() setItemVisible() isItemVisible() unsetVisibleItems() visibleItems() isContentFullScreen() setContentFullScreen()
   501 */
   570 */
   502 void HbView::showItems(Hb::SceneItems items)
   571 void HbView::showItems(Hb::SceneItems items)
   503 {
   572 {
   505     d->mVisibleItems |= items;
   574     d->mVisibleItems |= items;
   506     d->mVisibleItemsSet = true;
   575     d->mVisibleItemsSet = true;
   507 
   576 
   508     if (items & Hb::TitleBarItem) {
   577     if (items & Hb::TitleBarItem) {
   509         d->mViewFlags &= ~HbView::ViewTitleBarHidden;
   578         d->mViewFlags &= ~HbView::ViewTitleBarHidden;
   510         d->mTitleBarFlags &= ~HbView::TitleBarHidden;
       
   511     }
   579     }
   512     if (items & Hb::StatusBarItem) {
   580     if (items & Hb::StatusBarItem) {
   513         d->mViewFlags &= ~HbView::ViewStatusBarHidden;
   581         d->mViewFlags &= ~HbView::ViewStatusBarHidden;
   514     }
   582     }
   515 
   583 
   516     emit visibleItemsChanged();
   584     emit visibleItemsChanged();
   517 }
   585 }
   518 
   586 
   519 /*!
   587 /*!
   520     Sets \a items to be invisible in this view. Changes will be visible
   588     Hides the given scene items in this view. Changes are visible
   521     instantly if the view is currently active, otherwise next time when
   589     instantly if the view is active, otherwise they will be shown the next time the
   522     view is activated. View's visibility flag overrides the similar
   590     view is activated.
   523     setting in HbMainWindow.
   591 
   524     
   592     The flag values in \a items override the corresponding settings in HbMainWindow.
       
   593     
       
   594         
   525     \sa showItems() setItemVisible() isItemVisible() unsetVisibleItems() visibleItems() isContentFullScreen() setContentFullScreen()
   595     \sa showItems() setItemVisible() isItemVisible() unsetVisibleItems() visibleItems() isContentFullScreen() setContentFullScreen()
   526 */
   596 */
   527 void HbView::hideItems(Hb::SceneItems items)
   597 void HbView::hideItems(Hb::SceneItems items)
   528 {
   598 {
   529     Q_D(HbView);
   599     Q_D(HbView);
   530     d->mVisibleItems &= ~items;
   600     d->mVisibleItems &= ~items;
   531     d->mVisibleItemsSet = true;
   601     d->mVisibleItemsSet = true;
   532 
   602 
   533     if (items & Hb::TitleBarItem) {
   603     if (items & Hb::TitleBarItem) {
   534         d->mViewFlags |= HbView::ViewTitleBarHidden;
   604         d->mViewFlags |= HbView::ViewTitleBarHidden;
   535         d->mTitleBarFlags |= HbView::TitleBarHidden;
       
   536     }
   605     }
   537     if (items & Hb::StatusBarItem) {
   606     if (items & Hb::StatusBarItem) {
   538         d->mViewFlags |= HbView::ViewStatusBarHidden;
   607         d->mViewFlags |= HbView::ViewStatusBarHidden;
   539     }
   608     }
   540 
   609 
   541     emit visibleItemsChanged();
   610     emit visibleItemsChanged();
   542 }
   611 }
   543 
   612 
   544 /*!
   613 /*!
   545     Returns visible items of this view.
   614     Returns the scene items that are visible in this view.
   546 
   615 
   547     \sa isItemVisible() setItemVisible() hideItems() showItems() unsetVisibleItems() isContentFullScreen() setContentFullScreen()
   616     \sa isItemVisible() setItemVisible() hideItems() showItems() unsetVisibleItems() isContentFullScreen() setContentFullScreen()
   548     
   617     
   549 */
   618 */
   550 Hb::SceneItems HbView::visibleItems() const
   619 Hb::SceneItems HbView::visibleItems() const
   556         return HbMainWindowPrivate::d_ptr(mainWindow())->mVisibleItems;
   625         return HbMainWindowPrivate::d_ptr(mainWindow())->mVisibleItems;
   557     }
   626     }
   558 }
   627 }
   559 
   628 
   560 /*!
   629 /*!
   561     Returns \c true if \a item is set to be visible.
   630     Returns \c true if \a item is set to be visible, otherwise returns \c false.
   562 
   631 
   563     \sa setItemVisible() hideItems() showItems() unsetVisibleItems() visibleItems() isContentFullScreen() setContentFullScreen()
   632     \sa setItemVisible() hideItems() showItems() unsetVisibleItems() visibleItems() isContentFullScreen() setContentFullScreen()
   564     
   633     
   565 */
   634 */
   566 bool HbView::isItemVisible(Hb::SceneItem item) const
   635 bool HbView::isItemVisible(Hb::SceneItem item) const
   568     Q_D(const HbView);
   637     Q_D(const HbView);
   569     return d->mVisibleItems & item;
   638     return d->mVisibleItems & item;
   570 }
   639 }
   571 
   640 
   572 /*!
   641 /*!
   573     Sets \a item to be \a visible in this view. Changes will be visible
   642     Shows or hides the given scene item for the view. If \a visible is \c true,
   574     instantly if the view is currently active, otherwise next time when
   643     then the given \a item is shown. If \a visible is \c false, then
   575     view is activated. View's visibility flag overrides the similar
   644     the given \a item is hidden.
   576     setting in HbMainWindow.
   645 	Changes are visible instantly if the view is active, otherwise they will be shown the next time the
   577     
   646     view is activated.    
       
   647 
       
   648     This overrides the corresponding scene item settings in HbMainWindow.
       
   649            
   578     \sa isItemVisible() hideItems() showItems() unsetVisibleItems() visibleItems() isContentFullScreen() setContentFullScreen()
   650     \sa isItemVisible() hideItems() showItems() unsetVisibleItems() visibleItems() isContentFullScreen() setContentFullScreen()
   579 */
   651 */
   580 void HbView::setItemVisible(Hb::SceneItem item, bool visible)
   652 void HbView::setItemVisible(Hb::SceneItem item, bool visible)
   581 {
   653 {
   582     Q_D(HbView);
   654     Q_D(HbView);
   585 
   657 
   586     emit visibleItemsChanged();
   658     emit visibleItemsChanged();
   587 }
   659 }
   588 
   660 
   589 /*!
   661 /*!
   590     \deprecated HbView::unsetVisibleItems()
       
   591         is deprecated.
       
   592 
       
   593     Resets the view specific definition of visible items and
       
   594     uses the HbMainWindow's default visible items. Changes will be visible
       
   595     instantly if the view is currently active, otherwise next time when
       
   596     view is activated.
       
   597     
       
   598     \sa setItemVisible() isItemVisible() hideItems() showItems() visibleItems() isContentFullScreen() setContentFullScreen()
       
   599 */
       
   600 void HbView::unsetVisibleItems()
       
   601 {
       
   602     HB_DEPRECATED("HbMainWindow::unsetVisibleItems is deprecated!");
       
   603     Q_D(HbView);
       
   604     d->mVisibleItemsSet = false;
       
   605 
       
   606     emit visibleItemsChanged();
       
   607 }
       
   608 
       
   609 /*!
       
   610     Returns \c true if view is set to use fullscreen.
   662     Returns \c true if view is set to use fullscreen.
   611 
   663 
   612     \sa setContentFullScreen() setItemVisible() isItemVisible() hideItems() showItems() visibleItems()
   664     \sa setContentFullScreen() setItemVisible() isItemVisible() hideItems() showItems() visibleItems()
   613 */
   665 */
   614 bool HbView::isContentFullScreen() const
   666 bool HbView::isContentFullScreen() const
   616     Q_D(const HbView);
   668     Q_D(const HbView);
   617     return d->mFullscreen;
   669     return d->mFullscreen;
   618 }
   670 }
   619 
   671 
   620 /*!
   672 /*!
   621     Sets the view to use full content area for drawing. Decorators like
   673     Makes the view content fill the whole screen area. The decorators that make up the chrome (such as 
   622     signal bar, title pane etc can be shown on top of view content area.
   674     signal bar, title pane etc.) can still be shown on top of view content.
   623     Changes will be visible instantly if the view is currently active, 
   675 	Changes are visible instantly if the view is active, otherwise they will
   624     otherwise next time when view is activated.
   676 	be shown the next time the view is activated.    
   625 
   677 
   626     \sa isContentFullScreen() setItemVisible() isItemVisible() hideItems() showItems() visibleItems()
   678     \sa isContentFullScreen() setItemVisible() isItemVisible() hideItems() showItems() visibleItems()
   627 */
   679 */
   628 void HbView::setContentFullScreen(bool enable)
   680 void HbView::setContentFullScreen(bool enable)
   629 {
   681 {
   633         emit contentFullScreenChanged();
   685         emit contentFullScreenChanged();
   634     }
   686     }
   635 }
   687 }
   636 
   688 
   637 /*!
   689 /*!
   638     \deprecated HbView::titleBarFlags() const
   690     Returns the view flags bit vector.
   639         is deprecated. Use HbView::viewFlags() instead.
   691     This consists of values specified in HbViewFlag.
   640 
   692 
   641     Returns titlebar flags bit vector.
   693     \sa setViewFlags()
   642     It consists of bits specified in HbTitleBarFlag.
       
   643 
       
   644     \sa setTitleBarFlags()
       
   645 */
       
   646 HbView::HbTitleBarFlags HbView::titleBarFlags() const
       
   647 {
       
   648     Q_D(const HbView);
       
   649     int statusBarFlagMask = ViewStatusBarHidden | ViewStatusBarTransparent | ViewStatusBarFloating;
       
   650     int flags(d->mViewFlags & ~statusBarFlagMask);
       
   651     return HbView::HbTitleBarFlags(flags);
       
   652 }
       
   653 
       
   654 /*!
       
   655     Returns view flags bit vector.
       
   656     It consists of bits specified in HbViewFlag.
       
   657 
       
   658     \sa setTitleBarFlags()
       
   659 */
   694 */
   660 HbView::HbViewFlags HbView::viewFlags() const
   695 HbView::HbViewFlags HbView::viewFlags() const
   661 {
   696 {
   662     Q_D(const HbView);
   697     Q_D(const HbView);
   663     return d->mViewFlags;
   698     return d->mViewFlags;
   664 }
       
   665 
       
   666 /*!
       
   667     \deprecated HbView::setTitleBarFlags(HbView::HbTitleBarFlags flags)
       
   668         is deprecated. Use HbView::setViewFlags(HbView::HbViewFlags flags) instead.
       
   669 
       
   670     Sets the titlebar flags bit vector. It consists of bits specified
       
   671     in HbTitleBarFlag. These flags can be set before the view is
       
   672     added to the main window or while the view is active.
       
   673 
       
   674     \sa titleBarFlags()
       
   675 */
       
   676 void HbView::setTitleBarFlags(HbView::HbTitleBarFlags flags)
       
   677 {
       
   678     const int statusBarFlagMask = ViewStatusBarHidden | ViewStatusBarTransparent | ViewStatusBarFloating;
       
   679 
       
   680     Q_D(HbView);
       
   681     setViewFlags(HbView::HbViewFlags((d->mViewFlags & statusBarFlagMask) | flags));
       
   682 }
   699 }
   683 
   700 
   684 /*!
   701 /*!
   685     Sets the view flags bit vector. It consists of bits specified
   702     Sets the view flags bit vector. It consists of bits specified
   686     in HbViewFlag. These flags can be set before the view is
   703     in HbViewFlag. These flags can be set before the view is
   698     d->mViewFlags = flags;
   715     d->mViewFlags = flags;
   699     if (mainWindow()) {
   716     if (mainWindow()) {
   700 
   717 
   701         // Statusbar-animation
   718         // Statusbar-animation
   702         bool statusBarAnimating = false;
   719         bool statusBarAnimating = false;
   703         HbStatusBar *statusBar = HbMainWindowPrivate::d_ptr(mainWindow())->mStatusBar;        
   720         HbStatusBar *statusBar = HbMainWindowPrivate::d_ptr(mainWindow())->mStatusBar;
   704         if ((d->mViewFlags & HbView::ViewStatusBarHidden) && statusBar->isVisible()) {
   721         if ((d->mViewFlags & HbView::ViewStatusBarHidden) && !(originalFlags & HbView::ViewStatusBarHidden)) {
   705 #ifdef HB_EFFECTS
   722 #ifdef HB_EFFECTS
   706             HbEffect::start(statusBar, "statusbar", "disappear", this, "statusBarEffectFinished");
   723             HbEffect::start(statusBar, "statusbar", "disappear", this, "statusBarEffectFinished");
   707 #endif // HB_EFFECTS
   724 #endif // HB_EFFECTS
   708             statusBarAnimating = true;
   725             statusBarAnimating = true;
   709         } else if (!(d->mViewFlags & HbView::ViewStatusBarHidden) && !statusBar->isVisible()) {
   726         } else if (!(d->mViewFlags & HbView::ViewStatusBarHidden) && (originalFlags & HbView::ViewStatusBarHidden)) {
   710 #ifdef HB_EFFECTS
   727 #ifdef HB_EFFECTS
   711             HbEffect::start(statusBar, "statusbar", "appear", this, "statusBarEffectFinished");
   728             HbEffect::start(statusBar, "statusbar", "appear", this, "statusBarEffectFinished");
   712 #endif // HB_EFFECTS
   729 #endif // HB_EFFECTS
   713             statusBarAnimating = true;
   730             statusBarAnimating = true;
   714         }
   731         }
   715 
   732 
   716         // Titlebar-animation
   733         // Titlebar-animation
   717         bool titleBarAnimating = false;
   734         bool titleBarAnimating = false;
   718         HbTitleBar *titleBar = HbMainWindowPrivate::d_ptr(mainWindow())->mTitleBar;
   735         HbTitleBar *titleBar = HbMainWindowPrivate::d_ptr(mainWindow())->mTitleBar;
   719         if ((d->mViewFlags & HbView::ViewTitleBarHidden) && titleBar->isVisible()) {
   736         if ((d->mViewFlags & HbView::ViewTitleBarHidden) && !(originalFlags & HbView::ViewTitleBarHidden)) {
   720 #ifdef HB_EFFECTS
   737 #ifdef HB_EFFECTS
   721             HbEffect::start(titleBar, "titleBar", "disappear", this, "titleBarEffectFinished");
   738             HbEffect::start(titleBar, "titlebar", "disappear", this, "titleBarEffectFinished");
   722 #endif // HB_EFFECTS
   739 #endif // HB_EFFECTS
   723             titleBarAnimating = true;
   740             titleBarAnimating = true;
   724         } else if (!(d->mViewFlags & HbView::ViewTitleBarHidden) && !titleBar->isVisible()) {
   741         } else if (!(d->mViewFlags & HbView::ViewTitleBarHidden) && (originalFlags & HbView::ViewTitleBarHidden)) {
   725 #ifdef HB_EFFECTS
   742 #ifdef HB_EFFECTS
   726             HbEffect::start(titleBar, "titleBar", "appear", this, "titleBarEffectFinished");
   743             HbEffect::start(titleBar, "titlebar", "appear", this, "titleBarEffectFinished");
   727 #endif // HB_EFFECTS
   744 #endif // HB_EFFECTS
   728             titleBarAnimating = true;
   745             titleBarAnimating = true;
   729         }
   746         }
   730 
   747 
   731         if (!statusBarAnimating) {
   748         if (!statusBarAnimating) {
   771         }
   788         }
   772     }
   789     }
   773 }
   790 }
   774 
   791 
   775 /*!
   792 /*!
   776     Changes titlebar's visibility with pre-defined effect.
   793     Changes the titlebar's visibility and uses the pre-defined effect.
       
   794 
       
   795 \note This is a convenience function which uses setViewFlags() to (un)set
       
   796 the HbView::ViewTitleBarHidden flag.
       
   797 
       
   798 \sa setViewFlags()
   777 */
   799 */
   778 void HbView::setTitleBarVisible(bool visible)
   800 void HbView::setTitleBarVisible(bool visible)
   779 {
   801 {
   780     Q_D(HbView);
   802     Q_D(HbView);
   781     if (visible) {
   803     if (visible) {
   784         setViewFlags(d->mViewFlags | HbView::ViewTitleBarHidden);
   806         setViewFlags(d->mViewFlags | HbView::ViewTitleBarHidden);
   785     }  
   807     }  
   786 }
   808 }
   787 
   809 
   788 /*!
   810 /*!
   789     Changes statusbar's visibility with pre-defined effect.
   811     Changes the statusbar's visibility and uses the pre-defined effect.
       
   812 
       
   813 \note This is a convenience function which uses setViewFlags() to (un)set
       
   814 the HbView::ViewStatusBarHidden flag.
       
   815 
       
   816 \sa setViewFlags()
   790 */
   817 */
   791 void HbView::setStatusBarVisible(bool visible)
   818 void HbView::setStatusBarVisible(bool visible)
   792 {
   819 {
   793     Q_D(HbView);
   820     Q_D(HbView);
   794     if (visible) {
   821     if (visible) {
   799 }
   826 }
   800 
   827 
   801 /*!
   828 /*!
   802     \overload
   829     \overload
   803 
   830 
   804     The function adds \a action to preferred container's list of actions.  The
   831 
   805     ownership of \a action is not transferred.  The preferred container
   832     This adds the \a action to the list of actions in the view. You specify a preferred container 
   806     specifies the action container (options menu, toolbar) where the action is
   833     in the UI where you would like the action to be added, e.g. the options menu or the toolbar. 
   807     placed. If the container is the toolbar and the maximum toolbar button count
   834     However, if you choose the toolbar as the preferred container but no more buttons can fit in the 
   808     is exceeded then the action may be moved to the options menu (if there are
   835     the toolbar, then the action might be moved to the options menu or it might displace another item in the toolbar. 
   809     enough more prioritized actions).
   836     The result depends on the prioties of the actions already in the toolbar compared with the priority of 
       
   837     the action you are adding.
       
   838     
       
   839     Ownership of the \a action is not transferred.
   810 */
   840 */
   811 void HbView::addAction(HbAction *action, ActionContainer preferredActionContainer)
   841 void HbView::addAction(HbAction *action, ActionContainer preferredActionContainer)
   812 {
   842 {
   813     Q_D(HbView);
   843     Q_D(HbView);
   814     d->preferredActionContainer = preferredActionContainer;
   844     d->preferredActionContainer = preferredActionContainer;
   815     addAction(action);
   845     addAction(action);
   816 }
   846 }
   817 
   847 
   818 /*!
   848 /*!
   819     \reimp
       
   820  */
   849  */
   821 bool HbView::event(QEvent *event)
   850 bool HbView::event(QEvent *event)
   822 {
   851 {
   823     Q_D(HbView);
   852     Q_D(HbView);
   824     if (event->type() == QEvent::ActionRemoved) {
   853     if (event->type() == QEvent::ActionRemoved) {
   847     }
   876     }
   848     return HbWidget::event(event);
   877     return HbWidget::event(event);
   849 }
   878 }
   850 
   879 
   851 /*!
   880 /*!
   852 Removes the HbMenu, which is set to view and returns it. 
   881 Removes the menu from the view and returns it to the caller.
   853 The ownership of the \a HbMenu is transferred to the caller.
   882 Ownership of the menu is transferred to the caller.
   854 
   883 
   855 \note This function is particularly useful if one wants to switch between
   884 \note This function is particularly useful if you want to switch between
   856 different views without deleting previous menu.
   885 different views without deleting the menu.
   857 
   886 
   858     \sa setMenu()
   887     \sa setMenu()
   859 */
   888 */
   860 HbMenu* HbView::takeMenu()
   889 HbMenu* HbView::takeMenu()
   861 {
   890 {
   866     // Reset the ownership
   895     // Reset the ownership
   867     if (menu) {
   896     if (menu) {
   868         menu->setParentItem(0);
   897         menu->setParentItem(0);
   869     }
   898     }
   870 
   899 
       
   900     // Titlebar must be informed
       
   901     if (mainWindow()) {
       
   902         HbMainWindowPrivate::d_ptr(mainWindow())->mTitleBar->propertiesChanged();
       
   903     }
       
   904 
   871     return menu;
   905     return menu;
   872 }
   906 }
   873 
   907 
   874 #ifdef HB_EFFECTS
   908 #ifdef HB_EFFECTS
   875 /*
   909 /*
   876     Handles effect finished event for title bar animation    
   910     Handles effect finished event for title bar animation    
   877  */
   911  */
   878 void HbView::titleBarEffectFinished(const HbEffect::EffectStatus &status)
   912 void HbView::titleBarEffectFinished(const HbEffect::EffectStatus &status)
   879 {   
   913 {   
   880     if (status.reason == Hb::EffectFinished || status.reason == Hb::EffectCancelled
   914     Q_D(HbView);
   881         || status.reason == Hb::EffectNotStarted) {
   915 
   882         HbMainWindowPrivate::d_ptr(mainWindow())->mTitleBar->propertiesChanged();
   916     HbMainWindow *mw = mainWindow();
   883         HbMainWindowPrivate::d_ptr(mainWindow())->mClippingItem->decoratorVisibilityChanged();
   917 
   884     }
   918     if (d->mNavigationActionSet) {
   885     if (mainWindow()) {
   919         HbMainWindowPrivate::d_ptr(mw)->mTitleBar->setNavigationAction(d->mNavigationAction);
   886         HbTitleBar *titleBar = HbMainWindowPrivate::d_ptr(mainWindow())->mTitleBar;
   920     } else {
       
   921         HbMainWindowPrivate::d_ptr(mw)->mTitleBar->setDefaultNavigationAction();
       
   922     }
       
   923     HbMainWindowPrivate::d_ptr(mw)->mTitleBar->propertiesChanged();
       
   924     HbMainWindowPrivate::d_ptr(mw)->mClippingItem->decoratorVisibilityChanged();
       
   925 
       
   926     if (mw) {
       
   927         HbTitleBar *titleBar = HbMainWindowPrivate::d_ptr(mw)->mTitleBar;
   887         if (titleBar) {
   928         if (titleBar) {
   888             if (status.effectEvent == "disappear") {
   929             if (status.effectEvent == "disappear") {
   889                 titleBar->setVisible(false);
   930                 titleBar->setVisible(false);
   890             } else {
   931             } else {
   891                 titleBar->setVisible(true);
   932                 titleBar->setVisible(true);
   893         }
   934         }
   894     }
   935     }
   895 }
   936 }
   896 
   937 
   897 /*
   938 /*
   898     Handles effect finished event for title bar animation    
   939     Handles the effect finished event for title bar animation    
   899  */
   940  */
   900 void HbView::statusBarEffectFinished(const HbEffect::EffectStatus &status)
   941 void HbView::statusBarEffectFinished(const HbEffect::EffectStatus &status)
   901 {   
   942 {   
   902     HbStatusBar *statusBar = HbMainWindowPrivate::d_ptr(mainWindow())->mStatusBar;
   943     HbMainWindow *mw = mainWindow();
       
   944 
       
   945     HbStatusBar *statusBar = HbMainWindowPrivate::d_ptr(mw)->mStatusBar;
   903     if (!statusBar) {
   946     if (!statusBar) {
   904         return;
   947         return;
   905     }
   948     }
   906 
   949 
   907     if (status.reason == Hb::EffectFinished || status.reason == Hb::EffectCancelled
   950     statusBar->propertiesChanged();
   908         || status.reason == Hb::EffectNotStarted) {
   951     HbMainWindowPrivate::d_ptr(mw)->mClippingItem->decoratorVisibilityChanged();
   909         statusBar->propertiesChanged();
   952 
   910         HbMainWindowPrivate::d_ptr(mainWindow())->mClippingItem->decoratorVisibilityChanged();
   953     if (mw) {    
   911     }
       
   912     if (mainWindow()) {    
       
   913         if (status.effectEvent == "disappear") {
   954         if (status.effectEvent == "disappear") {
   914             statusBar->setVisible(false);
   955             statusBar->setVisible(false);
   915         } else {
   956         } else {
   916             statusBar->setVisible(true);
   957             statusBar->setVisible(true);
   917         }
   958         }
   918     }
   959     }
   919 }
   960 }
   920 #endif // HB_EFFECTS
   961 #endif // HB_EFFECTS
   921 
   962 
   922 /*!
   963 /*!
   923   Returns the currently set navigation action or 0 if there is none.
   964   Returns the current navigation action. If no navigation action has been set, then
   924 
   965   0 is returned.
   925   If setNavigationAction() was not called before for this view at all then the
   966 
       
   967   If setNavigationAction() has not been called for this view, then the
   926   default action will be returned.
   968   default action will be returned.
   927   
   969   
   928   \sa setNavigationAction()
   970   \sa setNavigationAction()
   929  */
   971  */
   930 HbAction *HbView::navigationAction() const
   972 HbAction *HbView::navigationAction() const
   943         return mw ? HbMainWindowPrivate::d_ptr(mw)->mTitleBar->navigationAction() : 0;
   985         return mw ? HbMainWindowPrivate::d_ptr(mw)->mTitleBar->navigationAction() : 0;
   944     }
   986     }
   945 }
   987 }
   946 
   988 
   947 /*!
   989 /*!
   948   Sets the navigation action, that is, the action that is associated with the
   990   Sets the navigation action, i.e., the action associated with the
   949   button that is typically located in the top-right corner. By default the
   991   button that is typically located in the top-right corner. By default the
   950   action is the "quit" action.
   992   action is the "quit" action.
   951 
   993 
   952   \a action can also be 0 in which case the previous navigation action is
   994   If you set the \a action to 0, the previous navigation action is
   953   unset and no new one will be set.
   995   unset and no new one will be set.
   954 
   996 
   955   Ownership of \a action is not taken.
   997   Ownership of \a action is not taken.
   956 
   998 
   957   \sa navigationAction()
   999   \sa navigationAction()