calendarui/controller/src/calensettingsstate.cpp
changeset 51 0b38fc5b94c6
parent 45 b6db4fd4947b
child 89 b57382753122
equal deleted inserted replaced
46:ecd7b9840282 51:0b38fc5b94c6
    21 #include "calendarui_debug.h"           // Debug macros
    21 #include "calendarui_debug.h"           // Debug macros
    22 #include "calencontroller.h"
    22 #include "calencontroller.h"
    23 #include "calenstatemachine.h"
    23 #include "calenstatemachine.h"
    24 #include "calennotifier.h"
    24 #include "calennotifier.h"
    25 #include "calenviewmanager.h"
    25 #include "calenviewmanager.h"
       
    26 #include "OstTraceDefinitions.h"
       
    27 #ifdef OST_TRACE_COMPILER_IN_USE
       
    28 #include "calensettingsstateTraces.h"
       
    29 #endif
    26 
    30 
    27 // ----------------------------------------------------------------------------
    31 // ----------------------------------------------------------------------------
    28 // CCalenSettingsState::NewLC
    32 // CCalenSettingsState::NewLC
    29 // First stage construction
    33 // First stage construction
    30 // ----------------------------------------------------------------------------
    34 // ----------------------------------------------------------------------------
    31 CCalenSettingsState* CCalenSettingsState::NewLC( CCalenController& aController,
    35 CCalenSettingsState* CCalenSettingsState::NewLC( CCalenController& aController,
    32                     RHashSet<TCalenNotification>& aOutstandingNotifications )
    36                     RHashSet<TCalenNotification>& aOutstandingNotifications )
    33     {
    37     {
    34     TRACE_ENTRY_POINT;
    38     OstTraceFunctionEntry0( CCALENSETTINGSSTATE_NEWLC_ENTRY );
    35 
    39     
    36     CCalenSettingsState* self = new ( ELeave ) CCalenSettingsState( aController,
    40     CCalenSettingsState* self = new ( ELeave ) CCalenSettingsState( aController,
    37                                                     aOutstandingNotifications );
    41                                                     aOutstandingNotifications );
    38     CleanupStack::PushL( self );
    42     CleanupStack::PushL( self );
    39     self->ConstructL();
    43     self->ConstructL();
    40 
    44 
    41     TRACE_EXIT_POINT;
    45     OstTraceFunctionExit0( CCALENSETTINGSSTATE_NEWLC_EXIT );
    42     return self;
    46     return self;
    43     }
    47     }
    44 
    48 
    45 // ----------------------------------------------------------------------------
    49 // ----------------------------------------------------------------------------
    46 // CCalenSettingsState::ConstructL
    50 // CCalenSettingsState::ConstructL
    47 // Second stage construction
    51 // Second stage construction
    48 // ----------------------------------------------------------------------------
    52 // ----------------------------------------------------------------------------
    49 void CCalenSettingsState::ConstructL()
    53 void CCalenSettingsState::ConstructL()
    50     {
    54     {
    51     TRACE_ENTRY_POINT;
    55     OstTraceFunctionEntry0( CCALENSETTINGSSTATE_CONSTRUCTL_ENTRY );
       
    56     
    52     BaseConstructL();
    57     BaseConstructL();
    53     
    58     
    54     TRACE_EXIT_POINT;
    59     OstTraceFunctionExit0( CCALENSETTINGSSTATE_CONSTRUCTL_EXIT );
    55     }
    60     }
    56     
    61     
    57 // ----------------------------------------------------------------------------
    62 // ----------------------------------------------------------------------------
    58 // CCalenSettingsState::CCalenSettingsState
    63 // CCalenSettingsState::CCalenSettingsState
    59 // C++ Constructor
    64 // C++ Constructor
    60 // ----------------------------------------------------------------------------
    65 // ----------------------------------------------------------------------------
    61 CCalenSettingsState::CCalenSettingsState( CCalenController& aController,
    66 CCalenSettingsState::CCalenSettingsState( CCalenController& aController,
    62                     RHashSet<TCalenNotification>& aOutstandingNotifications )
    67                     RHashSet<TCalenNotification>& aOutstandingNotifications )
    63     : CCalenState( aController, aOutstandingNotifications )
    68     : CCalenState( aController, aOutstandingNotifications )
    64     {
    69     {
    65     TRACE_ENTRY_POINT;
    70     OstTraceFunctionEntry0( CCALENSETTINGSSTATE_CCALENSETTINGSSTATE_ENTRY );
    66     
    71     
    67     TRACE_EXIT_POINT;
    72     OstTraceFunctionExit0( CCALENSETTINGSSTATE_CCALENSETTINGSSTATE_EXIT );
    68     }
    73     }
    69     
    74     
    70 // ----------------------------------------------------------------------------
    75 // ----------------------------------------------------------------------------
    71 // CCalenSettingsState::CCalenSettingsState
    76 // CCalenSettingsState::CCalenSettingsState
    72 // Destructor
    77 // Destructor
    73 // ----------------------------------------------------------------------------    
    78 // ----------------------------------------------------------------------------    
    74 CCalenSettingsState::~CCalenSettingsState()
    79 CCalenSettingsState::~CCalenSettingsState()
    75     {
    80     {
    76     TRACE_ENTRY_POINT;
    81     OstTraceFunctionEntry0( DUP1_CCALENSETTINGSSTATE_CCALENSETTINGSSTATE_ENTRY );
    77     
    82     
    78     TRACE_EXIT_POINT;
    83     OstTraceFunctionExit0( DUP1_CCALENSETTINGSSTATE_CCALENSETTINGSSTATE_EXIT );
    79     }
    84     }
    80 
    85 
    81 // ----------------------------------------------------------------------------
    86 // ----------------------------------------------------------------------------
    82 // CCalenSettingsState::HandleCommandL
    87 // CCalenSettingsState::HandleCommandL
    83 // From CCalenState
    88 // From CCalenState
    84 // ----------------------------------------------------------------------------    
    89 // ----------------------------------------------------------------------------    
    85 TBool CCalenSettingsState::HandleCommandL( const TCalenCommand& aCommand,
    90 TBool CCalenSettingsState::HandleCommandL( const TCalenCommand& aCommand,
    86                                         CCalenStateMachine& aStateMachine  )
    91                                         CCalenStateMachine& aStateMachine  )
    87     {
    92     {
    88     TRACE_ENTRY_POINT;
    93     OstTraceFunctionEntry0( CCALENSETTINGSSTATE_HANDLECOMMANDL_ENTRY );
    89 	    
    94     
    90     TInt cmd = aCommand.Command();
    95     TInt cmd = aCommand.Command();
    91     MCalenCommandHandler* handler = iController.GetCommandHandlerL( cmd );
    96     MCalenCommandHandler* handler = iController.GetCommandHandlerL( cmd );
    92 	    
    97 	    
    93     ASSERT( handler ); 
    98     ASSERT( handler ); 
    94     TBool cmdUsed = EFalse;
    99     TBool cmdUsed = EFalse;
   121     if(cmdUsed)
   126     if(cmdUsed)
   122         {
   127         {
   123         RequestCallbackL( handler, aCommand );
   128         RequestCallbackL( handler, aCommand );
   124         }
   129         }
   125 
   130 
   126     TRACE_EXIT_POINT;
   131     OstTraceFunctionExit0( CCALENSETTINGSSTATE_HANDLECOMMANDL_EXIT );
   127     return cmdUsed;
   132     return cmdUsed;
   128     }
   133     }
   129 
   134 
   130 // ----------------------------------------------------------------------------
   135 // ----------------------------------------------------------------------------
   131 // CCalenSettingsState::HandleNotificationL
   136 // CCalenSettingsState::HandleNotificationL
   132 // From CCalenState
   137 // From CCalenState
   133 // ----------------------------------------------------------------------------        
   138 // ----------------------------------------------------------------------------        
   134 void CCalenSettingsState::HandleNotificationL(const TCalenNotification& aNotification,
   139 void CCalenSettingsState::HandleNotificationL(const TCalenNotification& aNotification,
   135                                                CCalenStateMachine& aStateMachine )
   140                                                CCalenStateMachine& aStateMachine )
   136     {
   141     {
   137     TRACE_ENTRY_POINT;
   142     OstTraceFunctionEntry0( CCALENSETTINGSSTATE_HANDLENOTIFICATIONL_ENTRY );
   138     
   143     
   139     switch( aNotification )
   144     switch( aNotification )
   140         {
   145         {
   141         case ECalenNotifyPluginEnabledDisabled:
   146         case ECalenNotifyPluginEnabledDisabled:
   142             {
   147             {
   160             // default is defer all other notifications when we are in setting state
   165             // default is defer all other notifications when we are in setting state
   161             iOutstandingNotifications.InsertL(aNotification);
   166             iOutstandingNotifications.InsertL(aNotification);
   162             break;
   167             break;
   163         }
   168         }
   164     
   169     
   165     TRACE_EXIT_POINT;
   170     OstTraceFunctionExit0( CCALENSETTINGSSTATE_HANDLENOTIFICATIONL_EXIT );
   166     }
   171     }
   167 
   172 
   168 // ----------------------------------------------------------------------------
   173 // ----------------------------------------------------------------------------
   169 // CCalenSettingsState::HandleStateActivationL
   174 // CCalenSettingsState::HandleStateActivationL
   170 // Behavior when state is activated.
   175 // Behavior when state is activated.
   171 // ----------------------------------------------------------------------------
   176 // ----------------------------------------------------------------------------
   172 void CCalenSettingsState::HandleStateActivationL()
   177 void CCalenSettingsState::HandleStateActivationL()
   173     {
   178     {
   174     TRACE_ENTRY_POINT;
   179     OstTraceFunctionEntry0( CCALENSETTINGSSTATE_HANDLESTATEACTIVATIONL_ENTRY );
   175     
   180     
   176     if( iOutstandingNotifications.FindL(ECalenNotifySettingsCRepKeyChanged) )
   181     if( iOutstandingNotifications.FindL(ECalenNotifySettingsCRepKeyChanged) )
   177         {
   182         {
   178         iController.Notifier().BroadcastApprovedNotification( ECalenNotifySettingsCRepKeyChanged );
   183         iController.Notifier().BroadcastApprovedNotification( ECalenNotifySettingsCRepKeyChanged );
   179         }
   184         }
   180     
   185     
   181     TRACE_EXIT_POINT;
   186     OstTraceFunctionExit0( CCALENSETTINGSSTATE_HANDLESTATEACTIVATIONL_EXIT );
   182     }
   187     }
   183 
   188 
   184  // end of file
   189  // end of file