clock/clockui/clockviewmanager/src/clockviewmanager.cpp
changeset 57 bb2d3e476f29
parent 55 2c54b51f39c4
child 63 a3cb48f6c889
equal deleted inserted replaced
55:2c54b51f39c4 57:bb2d3e476f29
    28 #include "clockdocloader.h"
    28 #include "clockdocloader.h"
    29 #include "clockmainview.h"
    29 #include "clockmainview.h"
    30 #include "clockcommon.h"
    30 #include "clockcommon.h"
    31 #include "clockdatatypes.h"
    31 #include "clockdatatypes.h"
    32 #include "clockworldview.h"
    32 #include "clockworldview.h"
       
    33 #include "OstTraceDefinitions.h"
       
    34 #ifdef OST_TRACE_COMPILER_IN_USE
       
    35 #include "clockviewmanagerTraces.h"
       
    36 #endif
       
    37 
    33 
    38 
    34 /*!
    39 /*!
    35 	\class ClockViewManager
    40 	\class ClockViewManager
    36 
    41 
    37 	This is the heart of the clock application. This is responsible for
    42 	This is the heart of the clock application. This is responsible for
    47 		ClockAppControllerIf &controllerIf, QObject *parent)
    52 		ClockAppControllerIf &controllerIf, QObject *parent)
    48 :QObject(parent),
    53 :QObject(parent),
    49  mAppControllerIf(controllerIf),
    54  mAppControllerIf(controllerIf),
    50  mWorldClockView(0)
    55  mWorldClockView(0)
    51 {
    56 {
       
    57     OstTraceFunctionEntry0( CLOCKVIEWMANAGER_CLOCKVIEWMANAGER_ENTRY );
    52     // Activity Reason from Activity Manager
    58     // Activity Reason from Activity Manager
    53     int activityReason = qobject_cast<HbApplication*>(qApp)->activateReason();
    59     int activityReason = qobject_cast<HbApplication*>(qApp)->activateReason();
    54     
    60     
    55     if (Hb::ActivationReasonActivity == activityReason) {
    61     if (Hb::ActivationReasonActivity == activityReason) {
    56         // Application is started from an activity
    62         // Application is started from an activity
    85         connect(
    91         connect(
    86                 window, SIGNAL(viewReady()),
    92                 window, SIGNAL(viewReady()),
    87                 this, SLOT(loadOtherViews()));
    93                 this, SLOT(loadOtherViews()));
    88     }
    94     }
    89 
    95 
       
    96 OstTraceFunctionExit0( CLOCKVIEWMANAGER_CLOCKVIEWMANAGER_EXIT );
    90 }
    97 }
    91 
    98 
    92 /*!
    99 /*!
    93 	Destructor.
   100 	Destructor.
    94  */
   101  */
    95 ClockViewManager::~ClockViewManager()
   102 ClockViewManager::~ClockViewManager()
    96 {
   103 {
       
   104 	OstTraceFunctionEntry0( DUP1_CLOCKVIEWMANAGER_CLOCKVIEWMANAGER_ENTRY );
    97 	// No implementation yet.
   105 	// No implementation yet.
       
   106 OstTraceFunctionExit0( DUP1_CLOCKVIEWMANAGER_CLOCKVIEWMANAGER_EXIT );
    98 }
   107 }
    99 
   108 
   100 /*!
   109 /*!
   101 	Switches to view specified by view.
   110 	Switches to view specified by view.
   102 
   111 
   103 	\param view View Id.
   112 	\param view View Id.
   104  */
   113  */
   105 void ClockViewManager::showView(ClockViews view)
   114 void ClockViewManager::showView(ClockViews view)
   106 {
   115 {
       
   116 	OstTraceFunctionEntry0( CLOCKVIEWMANAGER_SHOWVIEW_ENTRY );
   107 	HbMainWindow *window = hbInstance->allMainWindows().first();
   117 	HbMainWindow *window = hbInstance->allMainWindows().first();
   108 
   118 
   109 	switch (view) {
   119 	switch (view) {
   110 		case MainView:
   120 		case MainView:
   111 		    // set captured screenshot as invalid as main view 
   121 		    // set captured screenshot as invalid as main view 
   129 			break;
   139 			break;
   130 
   140 
   131 		default:
   141 		default:
   132 			break;
   142 			break;
   133 	}
   143 	}
       
   144 OstTraceFunctionExit0( CLOCKVIEWMANAGER_SHOWVIEW_EXIT );
   134 }
   145 }
   135 
   146 
   136 /*!
   147 /*!
   137 	Loads the clock main view.
   148 	Loads the clock main view.
   138  */
   149  */
   139 void ClockViewManager::loadMainView()
   150 void ClockViewManager::loadMainView()
   140 {
   151 {
       
   152 	OstTraceFunctionEntry0( CLOCKVIEWMANAGER_LOADMAINVIEW_ENTRY );
   141 	bool loadSuccess;
   153 	bool loadSuccess;
   142 
   154 
   143 	// Construct the document loader instance
   155 	// Construct the document loader instance
   144 	ClockDocLoader *docLoader = new ClockDocLoader();
   156 	ClockDocLoader *docLoader = new ClockDocLoader();
   145 
   157 
   156 	// Setup the view.
   168 	// Setup the view.
   157 	mMainView->setupView(mAppControllerIf, docLoader);
   169 	mMainView->setupView(mAppControllerIf, docLoader);
   158 
   170 
   159 	// Set the main view to the window
   171 	// Set the main view to the window
   160 	hbInstance->allMainWindows().first()->addView(mMainView);
   172 	hbInstance->allMainWindows().first()->addView(mMainView);
       
   173 OstTraceFunctionExit0( CLOCKVIEWMANAGER_LOADMAINVIEW_EXIT );
   161 }
   174 }
   162 
   175 
   163 /*!
   176 /*!
   164 	Loads the world clock view.
   177 	Loads the world clock view.
   165  */
   178  */
   166 void ClockViewManager::loadWorldClockView()
   179 void ClockViewManager::loadWorldClockView()
   167 {
   180 {
       
   181 	OstTraceFunctionEntry0( CLOCKVIEWMANAGER_LOADWORLDCLOCKVIEW_ENTRY );
   168 	// Construct the document loader instance
   182 	// Construct the document loader instance
   169 	ClockDocLoader *docLoader = new ClockDocLoader();
   183 	ClockDocLoader *docLoader = new ClockDocLoader();
   170 
   184 
   171 	bool loadSuccess;
   185 	bool loadSuccess;
   172 
   186 
   179 	
   193 	
   180 	// Disable animation effect on toolbar.
   194 	// Disable animation effect on toolbar.
   181 	HbEffect::disable(mWorldClockView->toolBar()->graphicsItem());
   195 	HbEffect::disable(mWorldClockView->toolBar()->graphicsItem());
   182 
   196 
   183 	mWorldClockView->setupView(mAppControllerIf, docLoader);
   197 	mWorldClockView->setupView(mAppControllerIf, docLoader);
       
   198 OstTraceFunctionExit0( CLOCKVIEWMANAGER_LOADWORLDCLOCKVIEW_EXIT );
   184 }
   199 }
   185 
   200 
   186 /*!
   201 /*!
   187 	Load other views
   202 	Load other views
   188  */
   203  */
   189 void ClockViewManager::loadOtherViews()
   204 void ClockViewManager::loadOtherViews()
   190 {
   205 {
       
   206 	OstTraceFunctionEntry0( CLOCKVIEWMANAGER_LOADOTHERVIEWS_ENTRY );
   191 	mMainView->setupAfterViewReady();
   207 	mMainView->setupAfterViewReady();
   192 	
   208 	
   193 	// Load world clock view
   209 	// Load world clock view
   194 	loadWorldClockView();
   210 	loadWorldClockView();
   195 
   211 
   202 	// Need to emit this signal after the view is fully constructed & populated
   218 	// Need to emit this signal after the view is fully constructed & populated
   203 	// with actual data and ready to be used. So entry view & instance view
   219 	// with actual data and ready to be used. So entry view & instance view
   204 	// needs to be created so that a new entry can also be created. Finally
   220 	// needs to be created so that a new entry can also be created. Finally
   205 	// NotesApplication object needs to emit applicationReady Signal.
   221 	// NotesApplication object needs to emit applicationReady Signal.
   206 	emit appReady();
   222 	emit appReady();
       
   223 OstTraceFunctionExit0( CLOCKVIEWMANAGER_LOADOTHERVIEWS_EXIT );
   207 }
   224 }
   208 
   225 
   209 // End of file	--Don't remove this.
   226 // End of file	--Don't remove this.