calendarui/controller/inc/calenstate.h
branchRCL_3
changeset 66 bd7edf625bdd
parent 65 12af337248b1
equal deleted inserted replaced
65:12af337248b1 66:bd7edf625bdd
    20 #define CALENSTATE_H
    20 #define CALENSTATE_H
    21 
    21 
    22 // INCLUDES
    22 // INCLUDES
    23 #include <e32base.h>
    23 #include <e32base.h>
    24 #include <e32hashtab.h>
    24 #include <e32hashtab.h>
    25 #include "calennotificationhandler.h"       // TCalenNotification
    25 #include <calennotificationhandler.h>       // TCalenNotification
    26 #include "calenstatemachine.h"              // TCalenStateIndex
    26 #include "calenstatemachine.h"              // TCalenStateIndex
    27 
    27 
    28 class CCalenController;
    28 class CCalenController;
    29 class CalenAsyncCallBack;
    29 class CCalenAsyncCallBack;
    30 class CalenCallbackPackage;
    30 class CCalenCallbackPackage;
    31 
    31 
    32 // CLASS DEFINITIONS
    32 // CLASS DEFINITIONS
    33 
    33 
    34 /**
    34 /**
    35 * Calendar state
    35 * Calendar state
    60 		void SetCurrentState( CCalenStateMachine& aStateMachine,
    60 		void SetCurrentState( CCalenStateMachine& aStateMachine,
    61 		                     const CCalenStateMachine::TCalenStateIndex& aState );
    61 		                     const CCalenStateMachine::TCalenStateIndex& aState );
    62 		/**
    62 		/**
    63          * Interface to get the current state
    63          * Interface to get the current state
    64          */        
    64          */        
    65         CCalenStateMachine::TCalenStateIndex GetCurrentState(
    65         CCalenStateMachine::TCalenStateIndex CCalenState::GetCurrentState(
    66         									CCalenStateMachine& aStateMachine);
    66         									CCalenStateMachine& aStateMachine);
    67         
    67         
    68         /**
    68         /**
    69          * Interface to set the previous state through state machine
    69          * Interface to set the previous state through state machine
    70          */
    70          */
    88     protected:
    88     protected:
    89         void BaseConstructL();
    89         void BaseConstructL();
    90         CCalenState( CCalenController& aController, RHashSet<TCalenNotification>&  aOutstandingNotifications );
    90         CCalenState( CCalenController& aController, RHashSet<TCalenNotification>&  aOutstandingNotifications );
    91 
    91 
    92     private:
    92     private:
    93         class CalenCallbackPackage : public CBase // going on heap
    93         class CCalenCallbackPackage : public CBase // going on heap
    94             {
    94             {
    95             public: 
    95             public: 
    96                 CalenCallbackPackage( CCalenState* aSelf,
    96                 CCalenCallbackPackage( CCalenState* aSelf,
    97                                        TCalenCommand aCommand,
    97                                        TCalenCommand aCommand,
    98                                        MCalenCommandHandler* aCommandHandler);
    98                                        MCalenCommandHandler* aCommandHandler);
    99                 
    99                 
   100                 TBool HandleCallBack();
   100                 TBool HandleCallBack();
   101                 void SetCommandHandler( CCalenState* aSelf,
   101                 void SetCommandHandler( CCalenState* aSelf,
   105                 CCalenState* iSelf; // not own
   105                 CCalenState* iSelf; // not own
   106                 TCalenCommand iCommand;
   106                 TCalenCommand iCommand;
   107                 MCalenCommandHandler* iCommandHandler; // not own
   107                 MCalenCommandHandler* iCommandHandler; // not own
   108             };
   108             };
   109         static TInt CommandCallback( TAny* aCommandStruct );
   109         static TInt CommandCallback( TAny* aCommandStruct );
   110         CalenCallbackPackage* iCallBackPackage;
   110         CCalenCallbackPackage* iCallBackPackage;
   111 
   111 
   112     protected:
   112     protected:
   113         CCalenController& iController;
   113         CCalenController& iController;
   114         RHashSet<TCalenNotification>& iOutstandingNotifications;
   114         RHashSet<TCalenNotification>& iOutstandingNotifications;
   115         CCalenStateMachine::TCalenStateIndex iPreviousState;
   115         CCalenStateMachine::TCalenStateIndex iPreviousState;
   116 
   116 
   117     private:
   117     private:
   118         CalenAsyncCallBack*     iCmdCallback;
   118         CCalenAsyncCallBack*     iCmdCallback;
   119      };
   119      };
   120 
   120 
   121 
   121 
   122 #endif // CALENSTATE_H
   122 #endif // CALENSTATE_H
   123 
   123