57 #include "hbevent.h" |
57 #include "hbevent.h" |
58 #include "hbsplashscreen.h" |
58 #include "hbsplashscreen.h" |
59 #include "hbcontentwidget_p.h" |
59 #include "hbcontentwidget_p.h" |
60 #include "hbscreen_p.h" |
60 #include "hbscreen_p.h" |
61 #include "hbmainwindoworientation_p.h" |
61 #include "hbmainwindoworientation_p.h" |
62 #include "hbfeaturemanager_p.h" |
62 #include "hbfeaturemanager_r.h" |
63 #include "hboogmwatcher_p.h" |
63 #include "hboogmwatcher_p.h" |
64 |
64 |
65 #ifdef Q_OS_SYMBIAN |
65 #ifdef Q_OS_SYMBIAN |
66 #include <coecntrl.h> |
66 #include <coecntrl.h> |
67 #include <w32std.h> |
67 #include <w32std.h> |
307 connect(d->mViewStackWidget, SIGNAL(currentChanged(int)), |
307 connect(d->mViewStackWidget, SIGNAL(currentChanged(int)), |
308 this, SLOT(_q_viewChanged())); |
308 this, SLOT(_q_viewChanged())); |
309 connect(d->mViewStackWidget, SIGNAL(widgetRemoved(QGraphicsWidget *)), |
309 connect(d->mViewStackWidget, SIGNAL(widgetRemoved(QGraphicsWidget *)), |
310 this, SLOT(_q_viewRemoved(QGraphicsWidget *))); |
310 this, SLOT(_q_viewRemoved(QGraphicsWidget *))); |
311 |
311 |
312 // create Titlebar (container for indicators, titlepane and secondary softkey |
312 // create Titlebar (container for indicator button, titlepane and navigation button |
313 d->mTitleBar = new HbTitleBar(this, d->mClippingItem); |
313 d->mTitleBar = new HbTitleBar(this, d->mClippingItem); |
314 d->mTitleBar->setZValue(HbPrivate::TitleBarZValue); |
314 d->mTitleBar->setZValue(HbPrivate::TitleBarZValue); |
315 |
315 |
316 // create StatusBar (container for clock, indicators, and battery and signal icons) |
316 // create StatusBar (container for clock, indicators, and battery and signal icons) |
317 d->mStatusBar = new HbStatusBar(this, d->mClippingItem); |
317 d->mStatusBar = new HbStatusBar(this, d->mClippingItem); |
388 a QGraphicsWidget (or any subclass that is not HbView) then |
388 a QGraphicsWidget (or any subclass that is not HbView) then |
389 HbMainWindow will create a HbView and set \a widget as the new |
389 HbMainWindow will create a HbView and set \a widget as the new |
390 HbView's content widget. |
390 HbView's content widget. |
391 |
391 |
392 When \a widget is a HbView, use HbView::setWidget() to set the content |
392 When \a widget is a HbView, use HbView::setWidget() to set the content |
393 widget for the view. Note that you should never attach child items directly |
393 widget for the view. Note that you should never attach child items or set a layout |
394 to the HbView instance, even though HbView is also a HbWidget. Instead, create |
394 directly to the HbView instance, even though HbView is also a HbWidget. |
395 a content widget, set it to the view via HbView::setWidget(), and attach children |
395 Instead, create a content widget, set it to the view via HbView::setWidget(), |
396 to that. |
396 and attach children or set a layout to that. |
397 |
397 |
398 Use setCurrentView() to switch between the added views. (only one of them is visible at a time) |
398 Use setCurrentView() to switch between the added views. (only one of them is visible at a time) |
399 The view-specific decorators (toolbar, Options menu, title in the titlebar) and of course |
399 The view-specific decorators (toolbar, Options menu, title in the titlebar) and of course |
400 the visibility of the view's content widgets will be updated and managed automatically by the framework |
400 the visibility of the view's content widgets will be updated and managed automatically by the framework |
401 when switching views. |
401 when switching views. |
402 |
402 |
403 For a detailed description of views see the HbView class. |
403 For a detailed description of views see the HbView class. |
404 |
404 |
405 Note that using view switching (i.e. several HbView instances, setCurrentView(), etc.) in |
405 Note that using view switching (i.e. several HbView instances, setCurrentView(), etc.) in |
406 Hb applications is not mandatory, it is purely optional. For applications that are not really |
406 Hb applications is not mandatory, it is purely optional. For applications that are not really |
407 view based (e.g. because they only have one screen of content or because they have more "fluid" UI where |
407 view based (e.g. because they only have one screen of content or because they have more "fluid" UI where |
408 the traditional view separation does not make that much sense) it may sometimes be better (and may provide more freedom) |
408 the traditional view separation does not make that much sense) it may sometimes be better (and may provide more freedom) |
409 to have just one view and manage the content entirely via the content widget of that one view. |
409 to have just one view and manage the content entirely via the content widget of that one view. |
949 } |
949 } |
950 // Notify that mainwindow is (most probably) ready. |
950 // Notify that mainwindow is (most probably) ready. |
951 // The signal must be emitted always, even when there was no need to do anything. |
951 // The signal must be emitted always, even when there was no need to do anything. |
952 emit d->idleEventDispatched(); |
952 emit d->idleEventDispatched(); |
953 } else if (event->type() == HbMainWindowPrivate::IdleOrientationEvent) { // complete the orientation change effect chain |
953 } else if (event->type() == HbMainWindowPrivate::IdleOrientationEvent) { // complete the orientation change effect chain |
954 if (d->mEffectItem && d->mOrientationChangeOngoing) { |
954 if (d->mEffectItem && d->mOrientationChangeOngoing && d->mOrientationEffectFinished) { |
955 HbEffect::start(d->mEffectItem, "rootItemFinalPhase", this, "rootItemFinalPhaseDone"); |
955 HbEffect::start(d->mEffectItem, "rootItemFinalPhase", this, "rootItemFinalPhaseDone"); |
956 } |
956 } |
957 } else if (event->type() == HbMainWindowPrivate::IdleOrientationFinalEvent) { |
957 } else if (event->type() == HbMainWindowPrivate::IdleOrientationFinalEvent) { |
958 if (d->mAnimateOrientationSwitch) { |
958 if (d->mAnimateOrientationSwitch) { |
959 HbEffect::start(d->mTitleBar, "titlebar", "appear_orient"); |
959 HbEffect::start(d->mTitleBar, "titlebar", "appear_orient"); |