calendarui/controller/src/calensendingstate.cpp
branchRCL_3
changeset 65 12af337248b1
parent 12 38571fd2a704
child 66 bd7edf625bdd
equal deleted inserted replaced
60:96907930389d 65:12af337248b1
     9 * Initial Contributors:
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    10 * Nokia Corporation - initial contribution.
    11 *
    11 *
    12 * Contributors:
    12 * Contributors:
    13 *
    13 *
    14 * Description:   Calendar state machine
    14 * Description:  Calendar state machine
    15 *
    15 *
    16 */
    16 */
    17 
       
    18 
    17 
    19 
    18 
    20 // includes
    19 // includes
    21 #include "calensendingstate.h"
    20 #include "calensendingstate.h"
    22 #include "calendarui_debug.h"           // Debug macros
    21 #include "calendarui_debug.h"           // Debug macros
    23 #include "calencontroller.h"
    22 #include "calencontroller.h"
    24 #include "calenstatemachine.h"
    23 #include "calenstatemachine.h"
    25 #include "calennotifier.h"
    24 #include "calennotifier.h"
       
    25 #include "OstTraceDefinitions.h"
       
    26 #ifdef OST_TRACE_COMPILER_IN_USE
       
    27 #include "calensendingstateTraces.h"
       
    28 #endif
    26 
    29 
    27 // ----------------------------------------------------------------------------
    30 // ----------------------------------------------------------------------------
    28 // CCalenSendingState::NewLC
    31 // CCalenSendingState::NewLC
    29 // First stage construction
    32 // First stage construction
    30 // ----------------------------------------------------------------------------
    33 // ----------------------------------------------------------------------------
    31 CCalenSendingState* CCalenSendingState::NewLC( CCalenController& aController,
    34 CCalenSendingState* CCalenSendingState::NewLC( CCalenController& aController,
    32                                                     RHashSet<TCalenNotification>&  aOutstandingNotifications )
    35                                                     RHashSet<TCalenNotification>&  aOutstandingNotifications )
    33     {
    36     {
    34     TRACE_ENTRY_POINT;
    37     OstTraceFunctionEntry0( CCALENSENDINGSTATE_NEWLC_ENTRY );
    35 
    38     
    36     CCalenSendingState* self = new ( ELeave ) CCalenSendingState( aController,aOutstandingNotifications );
    39     CCalenSendingState* self = new ( ELeave ) CCalenSendingState( aController,aOutstandingNotifications );
    37     CleanupStack::PushL( self );
    40     CleanupStack::PushL( self );
    38     self->ConstructL();
    41     self->ConstructL();
    39 
    42 
    40     TRACE_EXIT_POINT;
    43     OstTraceFunctionExit0( CCALENSENDINGSTATE_NEWLC_EXIT );
    41     return self;
    44     return self;
    42     }
    45     }
    43 
    46 
    44 // ----------------------------------------------------------------------------
    47 // ----------------------------------------------------------------------------
    45 // CCalenSendingState::ConstructL
    48 // CCalenSendingState::ConstructL
    46 // Second stage construction
    49 // Second stage construction
    47 // ----------------------------------------------------------------------------
    50 // ----------------------------------------------------------------------------
    48 void CCalenSendingState::ConstructL()
    51 void CCalenSendingState::ConstructL()
    49     {
    52     {
    50     TRACE_ENTRY_POINT;
    53     OstTraceFunctionEntry0( CCALENSENDINGSTATE_CONSTRUCTL_ENTRY );
       
    54     
    51     BaseConstructL();
    55     BaseConstructL();
    52     
    56     
    53     TRACE_EXIT_POINT;
    57     OstTraceFunctionExit0( CCALENSENDINGSTATE_CONSTRUCTL_EXIT );
    54     }
    58     }
    55     
    59     
    56 // ----------------------------------------------------------------------------
    60 // ----------------------------------------------------------------------------
    57 // CCalenSendingState::CCalenSendingState
    61 // CCalenSendingState::CCalenSendingState
    58 // C++ Constructor
    62 // C++ Constructor
    59 // ----------------------------------------------------------------------------
    63 // ----------------------------------------------------------------------------
    60 CCalenSendingState::CCalenSendingState( CCalenController& aController,
    64 CCalenSendingState::CCalenSendingState( CCalenController& aController,
    61                                                     RHashSet<TCalenNotification>&  aOutstandingNotifications )
    65                                                     RHashSet<TCalenNotification>&  aOutstandingNotifications )
    62     : CCalenState( aController, aOutstandingNotifications )
    66     : CCalenState( aController, aOutstandingNotifications )
    63     {
    67     {
    64     TRACE_ENTRY_POINT;
    68     OstTraceFunctionEntry0( CCALENSENDINGSTATE_CCALENSENDINGSTATE_ENTRY );
    65     
    69     
    66     TRACE_EXIT_POINT;
    70     OstTraceFunctionExit0( CCALENSENDINGSTATE_CCALENSENDINGSTATE_EXIT );
    67     }
    71     }
    68     
    72     
    69 // ----------------------------------------------------------------------------
    73 // ----------------------------------------------------------------------------
    70 // CCalenSendingState::CCalenSendingState
    74 // CCalenSendingState::CCalenSendingState
    71 // Destructor
    75 // Destructor
    72 // ----------------------------------------------------------------------------    
    76 // ----------------------------------------------------------------------------    
    73 CCalenSendingState::~CCalenSendingState()
    77 CCalenSendingState::~CCalenSendingState()
    74     {
    78     {
    75     TRACE_ENTRY_POINT;
    79     OstTraceFunctionEntry0( DUP1_CCALENSENDINGSTATE_CCALENSENDINGSTATE_ENTRY );
    76     
    80     
    77     TRACE_EXIT_POINT;
    81     OstTraceFunctionExit0( DUP1_CCALENSENDINGSTATE_CCALENSENDINGSTATE_EXIT );
    78     }
    82     }
    79 
    83 
    80 // ----------------------------------------------------------------------------
    84 // ----------------------------------------------------------------------------
    81 // CCalenSendingState::HandleCommandL
    85 // CCalenSendingState::HandleCommandL
    82 // From CCalenState
    86 // From CCalenState
    83 // ----------------------------------------------------------------------------    
    87 // ----------------------------------------------------------------------------    
    84 TBool CCalenSendingState::HandleCommandL( const TCalenCommand& aCommand,
    88 TBool CCalenSendingState::HandleCommandL( const TCalenCommand& aCommand,
    85                                          CCalenStateMachine& aStateMachine )
    89                                          CCalenStateMachine& aStateMachine )
    86     {
    90     {
    87     TRACE_ENTRY_POINT;
    91     OstTraceFunctionEntry0( CCALENSENDINGSTATE_HANDLECOMMANDL_ENTRY );
       
    92     
    88     TInt cmd = aCommand.Command();
    93     TInt cmd = aCommand.Command();
    89     MCalenCommandHandler* handler = iController.GetCommandHandlerL( cmd );
    94     MCalenCommandHandler* handler = iController.GetCommandHandlerL( cmd );
    90     
    95     
    91     ASSERT( handler ); // FIXME: error ui
    96     ASSERT( handler ); // FIXME: error ui
    92     
    97     
    93     TBool cmdUsed = EFalse;
    98     TBool cmdUsed = EFalse;
    94     
    99     
    95     if(ECalenFasterAppExit == cmd)
   100     if( ECalenFasterAppExit == cmd )
    96         {
   101         {
    97         SetCurrentState( aStateMachine, CCalenStateMachine::ECalenIdleState );
   102         SetCurrentState( aStateMachine, CCalenStateMachine::ECalenIdleState );
    98         ActivateCurrentStateL(aStateMachine);
   103         ActivateCurrentStateL(aStateMachine);
    99         RequestCallbackL( handler, aCommand );
   104         RequestCallbackL( handler, aCommand );
   100         cmdUsed = ETrue;
   105         cmdUsed = ETrue;
   101         }
   106         }
   102     else if(ECalenStartActiveStep == cmd)
       
   103         {
       
   104         RequestCallbackL( handler, aCommand );
       
   105         cmdUsed = ETrue;
       
   106         }    
       
   107 
   107 
   108     TRACE_EXIT_POINT;
   108     OstTraceFunctionExit0( CCALENSENDINGSTATE_HANDLECOMMANDL_EXIT );
   109     return cmdUsed;
   109     return cmdUsed;
   110     }
   110     }
   111 
   111 
   112 // ----------------------------------------------------------------------------
   112 // ----------------------------------------------------------------------------
   113 // CCalenSendingState::HandleNotificationL
   113 // CCalenSendingState::HandleNotificationL
   114 // From CCalenState
   114 // From CCalenState
   115 // ----------------------------------------------------------------------------        
   115 // ----------------------------------------------------------------------------        
   116 void CCalenSendingState::HandleNotificationL(const TCalenNotification& aNotification,
   116 void CCalenSendingState::HandleNotificationL(const TCalenNotification& aNotification,
   117                                               CCalenStateMachine& aStateMachine )
   117                                               CCalenStateMachine& aStateMachine )
   118     {
   118     {
   119     TRACE_ENTRY_POINT;
   119     OstTraceFunctionEntry0( CCALENSENDINGSTATE_HANDLENOTIFICATIONL_ENTRY );
   120 
   120     
   121     switch( aNotification )
   121     switch( aNotification )
   122         {
   122         {
   123         case ECalenNotifyEntrySendCancel:
       
   124         case ECalenNotifyDialogClosed:  // issued when send method query dialog is cancelled
   123         case ECalenNotifyDialogClosed:  // issued when send method query dialog is cancelled
   125         	{
   124         	{
   126         	// FIXME Should have a ECalenNotifyEntrySent?
   125         	// FIXME Should have a ECalenNotifyEntrySent?
   127             SetCurrentState( aStateMachine, iPreviousState);
   126             SetCurrentState( aStateMachine, iPreviousState);
   128             iOutstandingNotifications.InsertL(aNotification);
   127             iOutstandingNotifications.InsertL(aNotification);
   138         default:
   137         default:
   139             CCalenState::HandleNotificationL( aNotification, aStateMachine );
   138             CCalenState::HandleNotificationL( aNotification, aStateMachine );
   140             break;
   139             break;
   141         }
   140         }
   142 
   141 
   143     TRACE_EXIT_POINT;
   142     OstTraceFunctionExit0( CCALENSENDINGSTATE_HANDLENOTIFICATIONL_EXIT );
   144     }
   143     }
   145 
   144 
   146 
   145 
   147  // end of file
   146  // end of file