calendarui/controller/src/calendeletingstate.cpp
changeset 51 0b38fc5b94c6
parent 18 c198609911f9
child 89 b57382753122
equal deleted inserted replaced
46:ecd7b9840282 51:0b38fc5b94c6
    20 #include "calendeletingstate.h"
    20 #include "calendeletingstate.h"
    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 "OstTraceDefinitions.h"
       
    26 #ifdef OST_TRACE_COMPILER_IN_USE
       
    27 #include "calendeletingstateTraces.h"
       
    28 #endif
    25 
    29 
    26 // ----------------------------------------------------------------------------
    30 // ----------------------------------------------------------------------------
    27 // CCalenDeletingState::NewLC
    31 // CCalenDeletingState::NewLC
    28 // First stage construction
    32 // First stage construction
    29 // ----------------------------------------------------------------------------
    33 // ----------------------------------------------------------------------------
    30 CCalenDeletingState* CCalenDeletingState::NewLC( CCalenController& aController,
    34 CCalenDeletingState* CCalenDeletingState::NewLC( CCalenController& aController,
    31                                                       RHashSet<TCalenNotification>&  aOutstandingNotifications )
    35                                                       RHashSet<TCalenNotification>&  aOutstandingNotifications )
    32     {
    36     {
    33     TRACE_ENTRY_POINT;
    37     OstTraceFunctionEntry0( CCALENDELETINGSTATE_NEWLC_ENTRY );
    34 
    38     
    35     CCalenDeletingState* self = new( ELeave ) CCalenDeletingState( aController,aOutstandingNotifications );
    39     CCalenDeletingState* self = new( ELeave ) CCalenDeletingState( aController,aOutstandingNotifications );
    36 
    40 
    37     CleanupStack::PushL( self );
    41     CleanupStack::PushL( self );
    38     self->ConstructL();
    42     self->ConstructL();
    39 
    43 
    40     TRACE_EXIT_POINT;
    44     OstTraceFunctionExit0( CCALENDELETINGSTATE_NEWLC_EXIT );
    41     return self;
    45     return self;
    42     }
    46     }
    43 
    47 
    44 // ----------------------------------------------------------------------------
    48 // ----------------------------------------------------------------------------
    45 // CCalenDeletingState::ConstructL
    49 // CCalenDeletingState::ConstructL
    46 // Second stage construction
    50 // Second stage construction
    47 // ----------------------------------------------------------------------------
    51 // ----------------------------------------------------------------------------
    48 void CCalenDeletingState::ConstructL()
    52 void CCalenDeletingState::ConstructL()
    49     {
    53     {
    50     TRACE_ENTRY_POINT;
    54     OstTraceFunctionEntry0( CCALENDELETINGSTATE_CONSTRUCTL_ENTRY );
       
    55     
    51     BaseConstructL();
    56     BaseConstructL();
    52   
    57   
    53     TRACE_EXIT_POINT;
    58     OstTraceFunctionExit0( CCALENDELETINGSTATE_CONSTRUCTL_EXIT );
    54     }
    59     }
    55     
    60     
    56 // ----------------------------------------------------------------------------
    61 // ----------------------------------------------------------------------------
    57 // CCalenDeletingState::CCalenDeletingState
    62 // CCalenDeletingState::CCalenDeletingState
    58 // C++ Constructor
    63 // C++ Constructor
    59 // ----------------------------------------------------------------------------
    64 // ----------------------------------------------------------------------------
    60 CCalenDeletingState::CCalenDeletingState( CCalenController& aController,
    65 CCalenDeletingState::CCalenDeletingState( CCalenController& aController,
    61                                                     RHashSet<TCalenNotification>&  aOutstandingNotifications )
    66                                                     RHashSet<TCalenNotification>&  aOutstandingNotifications )
    62     : CCalenState( aController, aOutstandingNotifications )
    67     : CCalenState( aController, aOutstandingNotifications )
    63     {
    68     {
    64     TRACE_ENTRY_POINT;
    69     OstTraceFunctionEntry0( CCALENDELETINGSTATE_CCALENDELETINGSTATE_ENTRY );
    65     
    70     
    66     TRACE_EXIT_POINT;
    71     OstTraceFunctionExit0( CCALENDELETINGSTATE_CCALENDELETINGSTATE_EXIT );
    67     }
    72     }
    68     
    73     
    69 // ----------------------------------------------------------------------------
    74 // ----------------------------------------------------------------------------
    70 // CCalenDeletingState::CCalenDeletingState
    75 // CCalenDeletingState::CCalenDeletingState
    71 // Destructor
    76 // Destructor
    72 // ----------------------------------------------------------------------------    
    77 // ----------------------------------------------------------------------------    
    73 CCalenDeletingState::~CCalenDeletingState()
    78 CCalenDeletingState::~CCalenDeletingState()
    74     {
    79     {
    75     TRACE_ENTRY_POINT;
    80     OstTraceFunctionEntry0( DUP1_CCALENDELETINGSTATE_CCALENDELETINGSTATE_ENTRY );
    76     
    81 
    77     TRACE_EXIT_POINT;
    82     OstTraceFunctionExit0( DUP1_CCALENDELETINGSTATE_CCALENDELETINGSTATE_EXIT );
    78     }
    83     }
    79 
    84 
    80 // ----------------------------------------------------------------------------
    85 // ----------------------------------------------------------------------------
    81 // CCalenDeletingState::HandleCommandL
    86 // CCalenDeletingState::HandleCommandL
    82 // From CCCalenState
    87 // From CCCalenState
    83 // ----------------------------------------------------------------------------    
    88 // ----------------------------------------------------------------------------    
    84 TBool CCalenDeletingState::HandleCommandL( const TCalenCommand& aCommand,
    89 TBool CCalenDeletingState::HandleCommandL( const TCalenCommand& aCommand,
    85                                          CCalenStateMachine& aStateMachine )
    90                                          CCalenStateMachine& aStateMachine )
    86     {
    91     {
    87     TRACE_ENTRY_POINT;
    92     OstTraceFunctionEntry0( CCALENDELETINGSTATE_HANDLECOMMANDL_ENTRY );
    88     
    93     
    89     TInt cmd = aCommand.Command();
    94     TInt cmd = aCommand.Command();
    90     MCalenCommandHandler* handler = iController.GetCommandHandlerL( cmd );
    95     MCalenCommandHandler* handler = iController.GetCommandHandlerL( cmd );
    91     
    96     
    92     ASSERT( handler ); // FIXME: error ui
    97     ASSERT( handler ); // FIXME: error ui
   104         ActivateCurrentStateL(aStateMachine);
   109         ActivateCurrentStateL(aStateMachine);
   105         RequestCallbackL( handler, aCommand );
   110         RequestCallbackL( handler, aCommand );
   106         cmdUsed = ETrue;
   111         cmdUsed = ETrue;
   107     	}
   112     	}
   108 
   113 
   109     TRACE_EXIT_POINT;
   114     OstTraceFunctionExit0( CCALENDELETINGSTATE_HANDLECOMMANDL_EXIT );
   110     return cmdUsed;
   115     return cmdUsed;
   111     }
   116     }
   112 
   117 
   113 // ----------------------------------------------------------------------------
   118 // ----------------------------------------------------------------------------
   114 // CCalenDeletingState::HandleNotificationL
   119 // CCalenDeletingState::HandleNotificationL
   115 // From CCCalenState
   120 // From CCCalenState
   116 // ----------------------------------------------------------------------------        
   121 // ----------------------------------------------------------------------------        
   117 void CCalenDeletingState::HandleNotificationL(const TCalenNotification& aNotification,
   122 void CCalenDeletingState::HandleNotificationL(const TCalenNotification& aNotification,
   118                                               CCalenStateMachine& aStateMachine )
   123                                               CCalenStateMachine& aStateMachine )
   119     {
   124     {
   120     TRACE_ENTRY_POINT;
   125     OstTraceFunctionEntry0( CCALENDELETINGSTATE_HANDLENOTIFICATIONL_ENTRY );
   121     
   126     
   122     switch( aNotification )
   127     switch( aNotification )
   123         {
   128         {
   124         case ECalenNotifyEntryDeleted:  // issued when new entry dialog is cancelled
   129         case ECalenNotifyEntryDeleted:  // issued when new entry dialog is cancelled
   125         case ECalenNotifyInstanceDeleted:
   130         case ECalenNotifyInstanceDeleted:
   148         default:
   153         default:
   149             CCalenState::HandleNotificationL( aNotification, aStateMachine );
   154             CCalenState::HandleNotificationL( aNotification, aStateMachine );
   150             break;
   155             break;
   151         }
   156         }
   152 
   157 
   153     TRACE_EXIT_POINT;
   158     OstTraceFunctionExit0( CCALENDELETINGSTATE_HANDLENOTIFICATIONL_EXIT );
   154     }
   159     }
   155  
   160  
   156  // end of file
   161  // end of file