calendarui/controller/src/calencontroller.cpp
changeset 51 0b38fc5b94c6
parent 46 ecd7b9840282
child 55 2c54b51f39c4
equal deleted inserted replaced
46:ecd7b9840282 51:0b38fc5b94c6
    35 #include "calendarui_debug.h"           // Debug macros
    35 #include "calendarui_debug.h"           // Debug macros
    36 #include "calenstatemachine.h"
    36 #include "calenstatemachine.h"
    37 #include "calenservicesimpl.h"          // Calendar service implementation
    37 #include "calenservicesimpl.h"          // Calendar service implementation
    38 #include "CalenUid.h"
    38 #include "CalenUid.h"
    39 #include "calencontextimpl.h"
    39 #include "calencontextimpl.h"
       
    40 #include "OstTraceDefinitions.h"
       
    41 #ifdef OST_TRACE_COMPILER_IN_USE
       
    42 #include "calencontrollerTraces.h"
       
    43 #endif
       
    44 
    40 
    45 
    41 // Constants
    46 // Constants
    42 const TInt KCustomCommandRangeStart     = ECalenLastCommand; 
    47 const TInt KCustomCommandRangeStart     = ECalenLastCommand; 
    43 const TInt KNumberOfCommandsPerServices = 100;
    48 const TInt KNumberOfCommandsPerServices = 100;
    44 
    49 
    48 // (other items were commented in a header).
    53 // (other items were commented in a header).
    49 // ----------------------------------------------------------------------------
    54 // ----------------------------------------------------------------------------
    50 //
    55 //
    51 CCalenController::CCalenController()
    56 CCalenController::CCalenController()
    52 {
    57 {
    53     TRACE_ENTRY_POINT;
    58     OstTraceFunctionEntry0( CCALENCONTROLLER_CCALENCONTROLLER_ENTRY );
       
    59     
    54 	// Check the Application Startup reason, set iIsFromServiceFrmWrk if application
    60 	// Check the Application Startup reason, set iIsFromServiceFrmWrk if application
    55 	// is started by service framework, false otherwise
    61 	// is started by service framework, false otherwise
    56     /*Hb::ActivationReasonService == qobject_cast<HbApplication*>(qApp)->activateReason() ? 
    62     /*Hb::ActivationReasonService == qobject_cast<HbApplication*>(qApp)->activateReason() ? 
    57         iIsFromServiceFrmWrk = true:
    63         iIsFromServiceFrmWrk = true:
    58         iIsFromServiceFrmWrk = false; */
    64         iIsFromServiceFrmWrk = false; */
    65     
    71     
    66     iNextServicesCommandBase = KCustomCommandRangeStart;
    72     iNextServicesCommandBase = KCustomCommandRangeStart;
    67     iRefCount = 0;
    73     iRefCount = 0;
    68     mAgendaUtil = 0;
    74     mAgendaUtil = 0;
    69     
    75     
    70     TRACE_EXIT_POINT;
    76     OstTraceFunctionExit0( CCALENCONTROLLER_CCALENCONTROLLER_EXIT );
    71 }
    77 }
    72 
    78 
    73 // ----------------------------------------------------------------------------
    79 // ----------------------------------------------------------------------------
    74 // CCalenController::constuctController
    80 // CCalenController::constuctController
    75 // Construct the controller completely
    81 // Construct the controller completely
    76 // (other items were commented in a header).
    82 // (other items were commented in a header).
    77 // ----------------------------------------------------------------------------
    83 // ----------------------------------------------------------------------------
    78 //
    84 //
    79 void CCalenController::constructController()
    85 void CCalenController::constructController()
    80 {
    86 {
       
    87 	OstTraceFunctionEntry0( CCALENCONTROLLER_CONSTRUCTCONTROLLER_ENTRY );
    81 	// Store the pointer in tls, also avoid multiple creations
    88 	// Store the pointer in tls, also avoid multiple creations
    82 	checkMultipleCreation();
    89 	checkMultipleCreation();
    83 
    90 
    84 	// Get an instance of AgendaUtil interface class
    91 	// Get an instance of AgendaUtil interface class
    85 	// This will take care of 
    92 	// This will take care of 
   140 	notificationArray.Append(ECalenNotifySettingsClosed);
   147 	notificationArray.Append(ECalenNotifySettingsClosed);
   141 
   148 
   142 	RegisterForNotificationsL( iViewManager, notificationArray );
   149 	RegisterForNotificationsL( iViewManager, notificationArray );
   143 	notificationArray.Reset();  
   150 	notificationArray.Reset();  
   144 	notificationArray.Close();
   151 	notificationArray.Close();
       
   152 	
       
   153 	OstTraceFunctionExit0( CCALENCONTROLLER_CONSTRUCTCONTROLLER_EXIT );
   145 }
   154 }
   146 
   155 
   147 void CCalenController::checkMultipleCreation()
   156 void CCalenController::checkMultipleCreation()
   148 {
   157 {
       
   158 	OstTraceFunctionEntry0( CCALENCONTROLLER_CHECKMULTIPLECREATION_ENTRY );
   149 	TAny* tlsPtr = Dll::Tls();
   159 	TAny* tlsPtr = Dll::Tls();
   150 
   160 
   151 	// Check Thread local storage
   161 	// Check Thread local storage
   152 	if( !tlsPtr )
   162 	if( !tlsPtr )
   153 		{
   163 		{
   162 		{
   172 		{
   163 		// An instance of the controller exists already.
   173 		// An instance of the controller exists already.
   164 		// This function should only have been called once, by CCalenAppUi
   174 		// This function should only have been called once, by CCalenAppUi
   165 		User::Leave( KErrAlreadyExists );
   175 		User::Leave( KErrAlreadyExists );
   166 		}	
   176 		}	
       
   177 	OstTraceFunctionExit0( CCALENCONTROLLER_CHECKMULTIPLECREATION_EXIT );
   167 }
   178 }
   168 
   179 
   169 // ----------------------------------------------------------------------------
   180 // ----------------------------------------------------------------------------
   170 // CCalenController::InstanceL
   181 // CCalenController::InstanceL
   171 // Returns a pointer to the single instance of the Calendar Controller.
   182 // Returns a pointer to the single instance of the Calendar Controller.
   175 // (other items were commented in a header).
   186 // (other items were commented in a header).
   176 // ----------------------------------------------------------------------------
   187 // ----------------------------------------------------------------------------
   177 //
   188 //
   178 CCalenController* CCalenController::InstanceL()
   189 CCalenController* CCalenController::InstanceL()
   179     {
   190     {
   180     TRACE_ENTRY_POINT;
   191     OstTraceFunctionEntry0( CCALENCONTROLLER_INSTANCEL_ENTRY );
   181 
   192     
   182     CCalenController* self = NULL;
   193     CCalenController* self = NULL;
   183     TAny* tlsPtr = Dll::Tls();
   194     TAny* tlsPtr = Dll::Tls();
   184 
   195 
   185     // Check Thread local storage
   196     // Check Thread local storage
   186     if( !tlsPtr )
   197     if( !tlsPtr )
   195         self = static_cast<CCalenController*>( tlsPtr );
   206         self = static_cast<CCalenController*>( tlsPtr );
   196         }
   207         }
   197 
   208 
   198     ++self->iRefCount;
   209     ++self->iRefCount;
   199 
   210 
   200     TRACE_EXIT_POINT;
   211     
       
   212     OstTraceFunctionExit0( CCALENCONTROLLER_INSTANCEL_EXIT );
   201     return self;    
   213     return self;    
   202     }
   214     }
   203 
   215 
   204 // ----------------------------------------------------------------------------
   216 // ----------------------------------------------------------------------------
   205 // CCalenController::ReleaseCustomisations
   217 // CCalenController::ReleaseCustomisations
   208 // (other items were commented in a header).
   220 // (other items were commented in a header).
   209 // ----------------------------------------------------------------------------
   221 // ----------------------------------------------------------------------------
   210 //
   222 //
   211 void CCalenController::ReleaseCustomisations()
   223 void CCalenController::ReleaseCustomisations()
   212     {
   224     {
   213     TRACE_ENTRY_POINT;
   225     OstTraceFunctionEntry0( CCALENCONTROLLER_RELEASECUSTOMISATIONS_ENTRY );
   214     
   226     
   215     delete iCustomisationManager;
   227     delete iCustomisationManager;
   216     iCustomisationManager = NULL;
   228     iCustomisationManager = NULL;
   217     
   229     
   218     TRACE_EXIT_POINT;
   230     OstTraceFunctionExit0( CCALENCONTROLLER_RELEASECUSTOMISATIONS_EXIT );
   219     }
   231     }
   220 
   232 
   221 // ----------------------------------------------------------------------------
   233 // ----------------------------------------------------------------------------
   222 // CCalenController::Release
   234 // CCalenController::Release
   223 // Decrement the reference count of this singleton.
   235 // Decrement the reference count of this singleton.
   226 // (other items were commented in a header).
   238 // (other items were commented in a header).
   227 // ----------------------------------------------------------------------------
   239 // ----------------------------------------------------------------------------
   228 //
   240 //
   229 void CCalenController::Release()
   241 void CCalenController::Release()
   230     {
   242     {
   231     TRACE_ENTRY_POINT;
   243     OstTraceFunctionEntry0( CCALENCONTROLLER_RELEASE_ENTRY );
       
   244     
   232     --iRefCount;
   245     --iRefCount;
   233     
   246     
   234     // The controller owns its own instance of the services, therefore the
   247     // The controller owns its own instance of the services, therefore the
   235     // reference count will be one, immediatley before deletion.
   248     // reference count will be one, immediatley before deletion.
   236     if (iRefCount == 1)
   249     if (iRefCount == 1)
   237         {
   250         {
   238         delete this;
   251         delete this;
   239         }
   252         }
   240     TRACE_EXIT_POINT;
   253     
       
   254     OstTraceFunctionExit0( CCALENCONTROLLER_RELEASE_EXIT );
   241     }
   255     }
   242 
   256 
   243 // ----------------------------------------------------------------------------
   257 // ----------------------------------------------------------------------------
   244 // CCalenController::~CCalenController
   258 // CCalenController::~CCalenController
   245 // Private destructor, called from Release() when reference count is 0.
   259 // Private destructor, called from Release() when reference count is 0.
   247 // (other items were commented in a header).
   261 // (other items were commented in a header).
   248 // ----------------------------------------------------------------------------
   262 // ----------------------------------------------------------------------------
   249 //
   263 //
   250 CCalenController::~CCalenController()
   264 CCalenController::~CCalenController()
   251     {
   265     {
   252     TRACE_ENTRY_POINT;
   266     OstTraceFunctionEntry0( DUP1_CCALENCONTROLLER_CCALENCONTROLLER_ENTRY );
   253 
   267 
   254     if(iStateMachine) {
   268     if(iStateMachine) {
   255     	delete iStateMachine;
   269     	delete iStateMachine;
   256     	iStateMachine = NULL;
   270     	iStateMachine = NULL;
   257     }
   271     }
   297         mAgendaUtil = 0;
   311         mAgendaUtil = 0;
   298     }
   312     }
   299     
   313     
   300     Dll::SetTls( NULL );
   314     Dll::SetTls( NULL );
   301     
   315     
   302     TRACE_EXIT_POINT;
   316     OstTraceFunctionExit0( DUP1_CCALENCONTROLLER_CCALENCONTROLLER_EXIT );
   303     }
   317     }
   304 
   318 
   305 
   319 
   306 // ----------------------------------------------------------------------------
   320 // ----------------------------------------------------------------------------
   307 // CCalenController::IssueCommmandL
   321 // CCalenController::IssueCommmandL
   311 // (other items were commented in a header).
   325 // (other items were commented in a header).
   312 // ----------------------------------------------------------------------------
   326 // ----------------------------------------------------------------------------
   313 //
   327 //
   314 TBool CCalenController::IssueCommandL( TInt aCommand )
   328 TBool CCalenController::IssueCommandL( TInt aCommand )
   315     {
   329     {
   316     TRACE_ENTRY_POINT;
   330     OstTraceFunctionEntry0( CCALENCONTROLLER_ISSUECOMMANDL_ENTRY );
       
   331     
   317     TCalenCommand cmd;
   332     TCalenCommand cmd;
   318     cmd.SetCommandAndContextL( aCommand ,context());
   333     cmd.SetCommandAndContextL( aCommand ,context());
   319 
   334 
   320     TBool ret = iStateMachine->HandleCommandL( cmd );
   335     TBool ret = iStateMachine->HandleCommandL( cmd );
   321     TRACE_EXIT_POINT;
   336     
       
   337     OstTraceFunctionExit0( CCALENCONTROLLER_ISSUECOMMANDL_EXIT );
   322     return ret;
   338     return ret;
   323     }
   339     }
   324 
   340 
   325 // ----------------------------------------------------------------------------
   341 // ----------------------------------------------------------------------------
   326 // CCalenController::Services
   342 // CCalenController::Services
   328 // (other items were commented in a header).
   344 // (other items were commented in a header).
   329 // ----------------------------------------------------------------------------
   345 // ----------------------------------------------------------------------------
   330 //
   346 //
   331 MCalenServices& CCalenController::Services()
   347 MCalenServices& CCalenController::Services()
   332     {
   348     {
   333     TRACE_ENTRY_POINT;
   349     OstTraceFunctionEntry0( CCALENCONTROLLER_SERVICES_ENTRY );
   334     TRACE_EXIT_POINT;
   350     
       
   351     OstTraceFunctionExit0( CCALENCONTROLLER_SERVICES_EXIT );
   335     return *iServices;
   352     return *iServices;
   336     }
   353     }
   337 
   354 
   338 // ----------------------------------------------------------------------------
   355 // ----------------------------------------------------------------------------
   339 // CCalenController::ViewManager
   356 // CCalenController::ViewManager
   340 // Returns a reference to the view manager
   357 // Returns a reference to the view manager
   341 // (other items were commented in a header).
   358 // (other items were commented in a header).
   342 // ----------------------------------------------------------------------------
   359 // ----------------------------------------------------------------------------
   343 CalenViewManager& CCalenController::ViewManager()
   360 CalenViewManager& CCalenController::ViewManager()
   344     {
   361     {
   345     TRACE_ENTRY_POINT;
   362     OstTraceFunctionEntry0( CCALENCONTROLLER_VIEWMANAGER_ENTRY );
   346     TRACE_EXIT_POINT;
   363     
       
   364 	OstTraceFunctionExit0( CCALENCONTROLLER_VIEWMANAGER_EXIT );
   347 	return *iViewManager;
   365 	return *iViewManager;
   348     }
   366     }
   349     
   367     
   350 // ----------------------------------------------------------------------------
   368 // ----------------------------------------------------------------------------
   351 // CCalenController::MainWindow
   369 // CCalenController::MainWindow
   352 // Returns a reference to the MainWindow
   370 // Returns a reference to the MainWindow
   353 // (other items were commented in a header).
   371 // (other items were commented in a header).
   354 // ----------------------------------------------------------------------------
   372 // ----------------------------------------------------------------------------
   355 HbMainWindow& CCalenController::MainWindow()
   373 HbMainWindow& CCalenController::MainWindow()
   356     {
   374     {
   357     TRACE_ENTRY_POINT;
   375     
       
   376     OstTraceFunctionEntry0( DUP1_CCALENCONTROLLER_MAINWINDOW_ENTRY );
       
   377 
       
   378     OstTraceFunctionExit0( DUP1_CCALENCONTROLLER_MAINWINDOW_EXIT );
   358     
   379     
   359     return *(hbInstance->allMainWindows().first());
   380     return *(hbInstance->allMainWindows().first());
   360 	
   381 	
   361 	TRACE_EXIT_POINT;
   382 	
   362     }    
   383     }    
   363 
   384 
   364 // ----------------------------------------------------------------------------
   385 // ----------------------------------------------------------------------------
   365 // CCCalenController::BroadcastNotification
   386 // CCCalenController::BroadcastNotification
   366 // Passes the notification to the Calendar Notifier.  The notification will
   387 // Passes the notification to the Calendar Notifier.  The notification will
   368 // (other items were commented in a header).
   389 // (other items were commented in a header).
   369 // ----------------------------------------------------------------------------
   390 // ----------------------------------------------------------------------------
   370 //
   391 //
   371 void CCalenController::BroadcastNotification( TCalenNotification aNotification )
   392 void CCalenController::BroadcastNotification( TCalenNotification aNotification )
   372     {
   393     {
   373     TRACE_ENTRY_POINT;
   394     OstTraceFunctionEntry0( CCALENCONTROLLER_BROADCASTNOTIFICATION_ENTRY );
   374 
   395 
   375     iNotifier->BroadcastNotification( aNotification );
   396     iNotifier->BroadcastNotification( aNotification );
   376 
   397 
   377     TRACE_EXIT_POINT;
   398     OstTraceFunctionExit0( CCALENCONTROLLER_BROADCASTNOTIFICATION_EXIT );
   378     }
   399     }
   379 
   400 
   380 // ----------------------------------------------------------------------------
   401 // ----------------------------------------------------------------------------
   381 // CCCalenController::RegisterForNotificationsL
   402 // CCCalenController::RegisterForNotificationsL
   382 // Registers the passed notification handler with the Calendar Notifier
   403 // Registers the passed notification handler with the Calendar Notifier
   384 // ----------------------------------------------------------------------------
   405 // ----------------------------------------------------------------------------
   385 //
   406 //
   386 void CCalenController::RegisterForNotificationsL( MCalenNotificationHandler* aHandler,
   407 void CCalenController::RegisterForNotificationsL( MCalenNotificationHandler* aHandler,
   387                                                             TCalenNotification aNotification )
   408                                                             TCalenNotification aNotification )
   388     {
   409     {
   389     TRACE_ENTRY_POINT;
   410     OstTraceFunctionEntry0( CCALENCONTROLLER_REGISTERFORNOTIFICATIONSL_ENTRY );
   390 
   411 
   391     iNotifier->RegisterForNotificationsL( aHandler, aNotification );
   412     iNotifier->RegisterForNotificationsL( aHandler, aNotification );
   392 
   413 
   393     TRACE_EXIT_POINT;
   414     OstTraceFunctionExit0( CCALENCONTROLLER_REGISTERFORNOTIFICATIONSL_EXIT );
   394     }
   415     }
   395 
   416 
   396 // ----------------------------------------------------------------------------
   417 // ----------------------------------------------------------------------------
   397 // CCCalenController::RegisterForNotificationsL
   418 // CCCalenController::RegisterForNotificationsL
   398 // Registers the passed notification handler with the Calendar Notifier
   419 // Registers the passed notification handler with the Calendar Notifier
   400 // ----------------------------------------------------------------------------
   421 // ----------------------------------------------------------------------------
   401 //
   422 //
   402 void CCalenController::RegisterForNotificationsL( MCalenNotificationHandler* aHandler,
   423 void CCalenController::RegisterForNotificationsL( MCalenNotificationHandler* aHandler,
   403                                                             RArray<TCalenNotification>& aNotifications )
   424                                                             RArray<TCalenNotification>& aNotifications )
   404     {
   425     {
   405     TRACE_ENTRY_POINT;
   426     OstTraceFunctionEntry0( DUP1_CCALENCONTROLLER_REGISTERFORNOTIFICATIONSL_ENTRY );
   406 
   427 
   407     iNotifier->RegisterForNotificationsL( aHandler, aNotifications );
   428     iNotifier->RegisterForNotificationsL( aHandler, aNotifications );
   408 
   429     
   409     TRACE_EXIT_POINT;
   430     OstTraceFunctionExit0( DUP1_CCALENCONTROLLER_REGISTERFORNOTIFICATIONSL_EXIT );
   410     }
   431     }
   411 
   432 
   412 // ----------------------------------------------------------------------------
   433 // ----------------------------------------------------------------------------
   413 // CCCalenController::CancelNotifications
   434 // CCCalenController::CancelNotifications
   414 // Removes the passed handler from the notifier.
   435 // Removes the passed handler from the notifier.
   415 // (other items were commented in a header).
   436 // (other items were commented in a header).
   416 // ----------------------------------------------------------------------------
   437 // ----------------------------------------------------------------------------
   417 //
   438 //
   418 void CCalenController::CancelNotifications( MCalenNotificationHandler* aHandler )
   439 void CCalenController::CancelNotifications( MCalenNotificationHandler* aHandler )
   419     {
   440     {
   420     TRACE_ENTRY_POINT;
   441     OstTraceFunctionEntry0( CCALENCONTROLLER_CANCELNOTIFICATIONS_ENTRY );
   421 
   442 
   422     iNotifier->CancelNotifications( aHandler );
   443     iNotifier->CancelNotifications( aHandler );
   423 
   444     
   424     TRACE_EXIT_POINT;
   445     OstTraceFunctionExit0( CCALENCONTROLLER_CANCELNOTIFICATIONS_EXIT );
   425     }
   446     }
   426 
   447 
   427 // ----------------------------------------------------------------------------
   448 // ----------------------------------------------------------------------------
   428 // CCCalenController::GetCommandHandlerL
   449 // CCCalenController::GetCommandHandlerL
   429 // Searches for a command handler for a particular command.  Customisations
   450 // Searches for a command handler for a particular command.  Customisations
   430 // are searched first.  If no customisation wants to handle the command it is
   451 // are searched first.  If no customisation wants to handle the command it is
   431 // handled by the view manager or the action uis
   452 // handled by the view manager or the action uis
   432 // ----------------------------------------------------------------------------
   453 // ----------------------------------------------------------------------------
   433 MCalenCommandHandler* CCalenController::GetCommandHandlerL( TInt aCommand )
   454 MCalenCommandHandler* CCalenController::GetCommandHandlerL( TInt aCommand )
   434     {
   455     {
   435     TRACE_ENTRY_POINT;
   456     OstTraceFunctionEntry0( CCALENCONTROLLER_GETCOMMANDHANDLERL_ENTRY );
   436     
   457     
   437     MCalenCommandHandler* handler( NULL );
   458     MCalenCommandHandler* handler( NULL );
   438 
   459 
   439     // Stop non-published commands from being customised
   460     // Stop non-published commands from being customised
   440     if ( aCommand != ECalenShowSettings
   461     if ( aCommand != ECalenShowSettings
   463             }
   484             }
   464         }
   485         }
   465 
   486 
   466     // No command handler is an error  
   487     // No command handler is an error  
   467     
   488     
       
   489     OstTraceFunctionExit0( CCALENCONTROLLER_GETCOMMANDHANDLERL_EXIT );
       
   490     
   468     // return the handler
   491     // return the handler
   469     TRACE_EXIT_POINT;
       
   470     return handler;
   492     return handler;
   471     }
   493     }
   472 
   494 
   473 // ----------------------------------------------------------------------------
   495 // ----------------------------------------------------------------------------
   474 // CCCalenController::NewServicesL
   496 // CCCalenController::NewServicesL
   476 // (other items were commented in a header).
   498 // (other items were commented in a header).
   477 // ----------------------------------------------------------------------------
   499 // ----------------------------------------------------------------------------
   478 //
   500 //
   479 MCalenServices* CCalenController::NewServicesL()
   501 MCalenServices* CCalenController::NewServicesL()
   480     {
   502     {
   481     TRACE_ENTRY_POINT;
   503     OstTraceFunctionEntry0( CCALENCONTROLLER_NEWSERVICESL_ENTRY );
   482     
   504     
   483     TInt commandRangeStart = iNextServicesCommandBase;
   505     TInt commandRangeStart = iNextServicesCommandBase;
   484     TInt commandRangeEnd = commandRangeStart + KNumberOfCommandsPerServices;
   506     TInt commandRangeEnd = commandRangeStart + KNumberOfCommandsPerServices;
   485     iNextServicesCommandBase = commandRangeEnd + 1;
   507     iNextServicesCommandBase = commandRangeEnd + 1;
   486 
   508 
   487     CalenServicesImpl* svc = CalenServicesImpl::NewL( commandRangeStart,commandRangeEnd );
   509     CalenServicesImpl* svc = CalenServicesImpl::NewL( commandRangeStart,commandRangeEnd );
   488     TRACE_EXIT_POINT;
   510     
       
   511     OstTraceFunctionExit0( CCALENCONTROLLER_NEWSERVICESL_EXIT );
   489     return svc;
   512     return svc;
   490     }
   513     }
   491 
   514 
   492 // ----------------------------------------------------------------------------
   515 // ----------------------------------------------------------------------------
   493 // CCalenController::Notifier
   516 // CCalenController::Notifier
   495 // (other items were commented in a header).
   518 // (other items were commented in a header).
   496 // ----------------------------------------------------------------------------
   519 // ----------------------------------------------------------------------------
   497 //
   520 //
   498 CalenNotifier& CCalenController::Notifier()
   521 CalenNotifier& CCalenController::Notifier()
   499     {
   522     {
   500     TRACE_ENTRY_POINT;
   523     OstTraceFunctionEntry0( CCALENCONTROLLER_NOTIFIER_ENTRY );
   501     TRACE_EXIT_POINT;
   524     
       
   525     OstTraceFunctionExit0( CCALENCONTROLLER_NOTIFIER_EXIT );
   502     return *iNotifier;
   526     return *iNotifier;
   503     }
   527     }
   504     
   528     
   505 // ----------------------------------------------------------------------------
   529 // ----------------------------------------------------------------------------
   506 // CCalenController::Infobar
   530 // CCalenController::Infobar
   509 // (other items were commented in a header).
   533 // (other items were commented in a header).
   510 // ----------------------------------------------------------------------------
   534 // ----------------------------------------------------------------------------
   511 //
   535 //
   512 HbWidget* CCalenController::Infobar()
   536 HbWidget* CCalenController::Infobar()
   513     {
   537     {
   514     TRACE_ENTRY_POINT;
   538     OstTraceFunctionEntry0( DUP1_CCALENCONTROLLER_INFOBAR_ENTRY );
   515     TRACE_EXIT_POINT;
   539     
       
   540     OstTraceFunctionExit0( DUP1_CCALENCONTROLLER_INFOBAR_EXIT );
   516     return iCustomisationManager->Infobar();
   541     return iCustomisationManager->Infobar();
   517     }
   542     }
   518 // ----------------------------------------------------------------------------
   543 // ----------------------------------------------------------------------------
   519 // CCalenController::InfobarTextL
   544 // CCalenController::InfobarTextL
   520 // @returns info bar text
   545 // @returns info bar text
   521 // (other items were commented in a header).
   546 // (other items were commented in a header).
   522 // ----------------------------------------------------------------------------
   547 // ----------------------------------------------------------------------------
   523 //
   548 //
   524 QString* CCalenController::InfobarTextL()
   549 QString* CCalenController::InfobarTextL()
   525     {
   550     {
   526     TRACE_ENTRY_POINT;
   551     OstTraceFunctionEntry0( CCALENCONTROLLER_INFOBARTEXTL_ENTRY );
   527     TRACE_EXIT_POINT;
   552     
       
   553     OstTraceFunctionExit0( CCALENCONTROLLER_INFOBARTEXTL_EXIT );
   528     return iCustomisationManager->InfobarTextL();
   554     return iCustomisationManager->InfobarTextL();
   529     }
   555     }
   530 // ----------------------------------------------------------------------------
   556 // ----------------------------------------------------------------------------
   531 // CCalenController::CustomisationManager
   557 // CCalenController::CustomisationManager
   532 // Returns a reference to the customisation manager
   558 // Returns a reference to the customisation manager
   533 // (other items were commented in a header).
   559 // (other items were commented in a header).
   534 // ----------------------------------------------------------------------------
   560 // ----------------------------------------------------------------------------
   535 //
   561 //
   536 CCalenCustomisationManager& CCalenController::CustomisationManager()
   562 CCalenCustomisationManager& CCalenController::CustomisationManager()
   537     {
   563     {
   538     TRACE_ENTRY_POINT;
   564     OstTraceFunctionEntry0( CCALENCONTROLLER_CUSTOMISATIONMANAGER_ENTRY );
   539     TRACE_EXIT_POINT;
   565     
       
   566     OstTraceFunctionExit0( CCALENCONTROLLER_CUSTOMISATIONMANAGER_EXIT );
   540     return *iCustomisationManager;
   567     return *iCustomisationManager;
   541     }
   568     }
   542 
   569 
   543 // ----------------------------------------------------------------------------
   570 // ----------------------------------------------------------------------------
   544 // CCalenController::SetDefaultContext
   571 // CCalenController::SetDefaultContext
   546 // (other items were commented in a header).
   573 // (other items were commented in a header).
   547 // ----------------------------------------------------------------------------
   574 // ----------------------------------------------------------------------------
   548 //       
   575 //       
   549 void CCalenController::SetDefaultContext()
   576 void CCalenController::SetDefaultContext()
   550     {
   577     {
   551     TRACE_ENTRY_POINT;  
   578     OstTraceFunctionEntry0( CCALENCONTROLLER_SETDEFAULTCONTEXT_ENTRY );
       
   579       
   552     QDateTime focusTime = mContext->defaultCalTimeForViewsL();
   580     QDateTime focusTime = mContext->defaultCalTimeForViewsL();
   553     mContext->setFocusDateAndTime(focusTime);
   581     mContext->setFocusDateAndTime(focusTime);
   554     TRACE_EXIT_POINT;
   582     
       
   583     OstTraceFunctionExit0( CCALENCONTROLLER_SETDEFAULTCONTEXT_EXIT );
   555     }
   584     }
   556 
   585 
   557 // ----------------------------------------------------------------------------
   586 // ----------------------------------------------------------------------------
   558 // CCalenController::OfferMenu
   587 // CCalenController::OfferMenu
   559 // Offers the menu to plugins for customisation.
   588 // Offers the menu to plugins for customisation.
   561 // (other items were commented in a header).
   590 // (other items were commented in a header).
   562 // ----------------------------------------------------------------------------
   591 // ----------------------------------------------------------------------------
   563 
   592 
   564 void CCalenController::OfferMenu(HbMenu* aHbMenu)
   593 void CCalenController::OfferMenu(HbMenu* aHbMenu)
   565     {
   594     {
   566     TRACE_ENTRY_POINT;
   595     OstTraceFunctionEntry0( CCALENCONTROLLER_OFFERMENU_ENTRY );
       
   596     
   567     iCustomisationManager->OfferMenu(aHbMenu);
   597     iCustomisationManager->OfferMenu(aHbMenu);
   568     TRACE_EXIT_POINT;
   598     
       
   599     OstTraceFunctionExit0( CCALENCONTROLLER_OFFERMENU_EXIT );
   569     }
   600     }
   570 
   601 
   571 // ----------------------------------------------------------------------------
   602 // ----------------------------------------------------------------------------
   572 // CCalenController::agendaInterface
   603 // CCalenController::agendaInterface
   573 // returns the interface to the agenda database
   604 // returns the interface to the agenda database
   574 // (other items were commented in a header).
   605 // (other items were commented in a header).
   575 // ---------------------------------------------------------------------------
   606 // ---------------------------------------------------------------------------
   576 //
   607 //
   577 AgendaUtil* CCalenController::agendaInterface()
   608 AgendaUtil* CCalenController::agendaInterface()
   578     {
   609     {
   579     TRACE_ENTRY_POINT;
   610     OstTraceFunctionEntry0( CCALENCONTROLLER_AGENDAINTERFACE_ENTRY );
   580     TRACE_EXIT_POINT;
   611     
       
   612     
       
   613     OstTraceFunctionExit0( CCALENCONTROLLER_AGENDAINTERFACE_EXIT );
   581     return mAgendaUtil;
   614     return mAgendaUtil;
   582     }
   615     }
   583 
   616 
   584 // ----------------------------------------------------------------------------
   617 // ----------------------------------------------------------------------------
   585 // CCalenController::context
   618 // CCalenController::context
   587 // (other items were commented in a header).
   620 // (other items were commented in a header).
   588 // ---------------------------------------------------------------------------
   621 // ---------------------------------------------------------------------------
   589 //
   622 //
   590 MCalenContext& CCalenController::context()
   623 MCalenContext& CCalenController::context()
   591     {
   624     {
   592 	TRACE_ENTRY_POINT;
   625 	OstTraceFunctionEntry0( CCALENCONTROLLER_CONTEXT_ENTRY );
   593 	TRACE_EXIT_POINT;
   626 	
       
   627     OstTraceFunctionExit0( CCALENCONTROLLER_CONTEXT_EXIT );
   594     return *mContext;
   628     return *mContext;
   595     }
   629     }
   596 
   630 
   597 // ----------------------------------------------------------------------------
   631 // ----------------------------------------------------------------------------
   598 // CCalenController::handleServiceManagerSlot
   632 // CCalenController::handleServiceManagerSlot
   600 // (other items were commented in a header).
   634 // (other items were commented in a header).
   601 // ---------------------------------------------------------------------------
   635 // ---------------------------------------------------------------------------
   602 //
   636 //
   603 void CCalenController::handleServiceManagerSlot(int view, const QDateTime& dateTime)
   637 void CCalenController::handleServiceManagerSlot(int view, const QDateTime& dateTime)
   604 {
   638 {
       
   639 	OstTraceFunctionEntry0( CCALENCONTROLLER_HANDLESERVICEMANAGERSLOT_ENTRY );
   605 	
   640 	
   606 	if (iIsFromServiceFrmWrk) {
   641 	if (iIsFromServiceFrmWrk) {
   607 		// Set the context properly
   642 		// Set the context properly
   608 		mContext->setFocusDateAndTime(dateTime);
   643 		mContext->setFocusDateAndTime(dateTime);
   609 		// launch the appropriate view
   644 		// launch the appropriate view
   623 			// Set the context properly
   658 			// Set the context properly
   624 			mContext->setFocusDateAndTime(dateTime);
   659 			mContext->setFocusDateAndTime(dateTime);
   625 			IssueCommandL(view);
   660 			IssueCommandL(view);
   626 		}
   661 		}
   627 	}
   662 	}
       
   663 	OstTraceFunctionExit0( CCALENCONTROLLER_HANDLESERVICEMANAGERSLOT_EXIT );
   628 }
   664 }
   629 
   665 
   630 // ----------------------------------------------------------------------------
   666 // ----------------------------------------------------------------------------
   631 // CCalenController::getFirstView
   667 // CCalenController::getFirstView
   632 // returns the first view with which calendar has been launched
   668 // returns the first view with which calendar has been launched
   633 // (other items were commented in a header).
   669 // (other items were commented in a header).
   634 // ---------------------------------------------------------------------------
   670 // ---------------------------------------------------------------------------
   635 //
   671 //
   636 int CCalenController::getFirstView()
   672 int CCalenController::getFirstView()
   637 {
   673 {
   638 	TRACE_ENTRY_POINT;
   674 	OstTraceFunctionEntry0( CCALENCONTROLLER_GETFIRSTVIEW_ENTRY );
   639 	TRACE_EXIT_POINT;
   675 	
       
   676 	OstTraceFunctionExit0( CCALENCONTROLLER_GETFIRSTVIEW_EXIT );
   640 	
   677 	
   641 	return iViewManager->getFirstView();
   678 	return iViewManager->getFirstView();
   642 	
   679 	
   643 }
   680 }
   644 
   681 
   648 // (other items were commented in a header).
   685 // (other items were commented in a header).
   649 // ---------------------------------------------------------------------------
   686 // ---------------------------------------------------------------------------
   650 //
   687 //
   651 bool CCalenController::eventFilter(QObject *object, QEvent *event)
   688 bool CCalenController::eventFilter(QObject *object, QEvent *event)
   652 {
   689 {
       
   690     OstTraceFunctionEntry0( CCALENCONTROLLER_EVENTFILTER_ENTRY );
       
   691     
   653     switch (event->type())
   692     switch (event->type())
   654         {
   693         {
   655         case QEvent::LanguageChange:
   694         case QEvent::LanguageChange:
   656         	//TODO: Unload the translator and install the locale specific translator
   695         	//TODO: Unload the translator and install the locale specific translator
   657         	iNotifier->BroadcastNotification( ECalenNotifySystemLanguageChanged );
   696         	iNotifier->BroadcastNotification( ECalenNotifySystemLanguageChanged );
   660         	// TODO: handle the locale changes
   699         	// TODO: handle the locale changes
   661             break;
   700             break;
   662         default:
   701         default:
   663             break;
   702             break;
   664         }
   703         }
       
   704     OstTraceFunctionExit0( CCALENCONTROLLER_EVENTFILTER_EXIT );
       
   705 
   665     return QObject::eventFilter(object, event);
   706     return QObject::eventFilter(object, event);
   666 }
   707 }
   667 // End of file
   708 // End of file