phonebookui/Phonebook2/ccapplication/ccacommlauncherplugin/inc/ccappcommlauncherplugin.h
branchRCL_3
changeset 39 a6539d1e8e43
parent 14 81f8547efd4f
child 64 c1e8ba0c2b16
equal deleted inserted replaced
35:4ae315f230bc 39:a6539d1e8e43
    25 #include <mccappviewpluginbase2.h>
    25 #include <mccappviewpluginbase2.h>
    26 
    26 
    27 class CCCAppCommLauncherContactHandler;
    27 class CCCAppCommLauncherContactHandler;
    28 class CCCAppCommLauncherMenuHandler;
    28 class CCCAppCommLauncherMenuHandler;
    29 class CCAContactorService;
    29 class CCAContactorService;
       
    30 class TCSParameter;
       
    31 
       
    32 /**
       
    33  * A helper class to keep up the command running state correct.
       
    34  * Only one command should be able to run at a time.
       
    35  */
       
    36 class TCCAppCommandState
       
    37     {
       
    38 public:
       
    39     /**
       
    40      * Constructor
       
    41      */
       
    42     TCCAppCommandState();
       
    43     /**
       
    44      * Returns ETrue if a command is running.
       
    45      * @return ETrue if a command is running.
       
    46      */
       
    47     inline TBool IsRunning() const { return iState; }
       
    48     /**
       
    49      * Change to Running state.
       
    50      */
       
    51     void SetRunning();
       
    52     /**
       
    53      * Change to Not Running state.
       
    54      */
       
    55     void SetNotRunning();
       
    56     /**
       
    57      * Sets state to Running and pushes a cleanup item to the CleanupStack.
       
    58      * The state will be changed to 'Not Running' in case of leave.
       
    59      */
       
    60     void SetRunningAndPushCleanupL();
       
    61     /**
       
    62      * Change to Not Running state and pops up the cleanup item previously
       
    63      * pushed by PushCleanupL or SetRunningAndPushCleanupL.
       
    64      */
       
    65     void SetNotRunningAndPopCleanup();
       
    66     /**
       
    67      * Pushes a cleanup item to the CleanupStack. 
       
    68      * The state will be changed to 'Not Running' in case of leave.
       
    69      */
       
    70     void PushCleanupL();
       
    71     /**
       
    72      * Pops up the cleanup item previously pushed by 
       
    73      * PushCleanupL or SetRunningAndPushCleanupL.
       
    74      */
       
    75     void PopCleanup();
       
    76 private:
       
    77     TCCAppCommandState& operator=(const TCCAppCommandState&);
       
    78     TCCAppCommandState(const TCCAppCommandState&);
       
    79     static void CleanupOperation( TAny* aCommanState );
       
    80 private:
       
    81     /// Own: ETrue if command is running, false otherwise.
       
    82     TBool iState;
       
    83     };
       
    84    
    30 
    85 
    31 /**
    86 /**
    32  *  Class implementing CCCAppViewPluginBase interface. This is
    87  *  Class implementing CCCAppViewPluginBase interface. This is
    33  *  the main class and controlling the other classes of the plugin.
    88  *  the main class and controlling the other classes of the plugin.
    34  *
    89  *
    45     public MCCAppViewPluginBase2
   100     public MCCAppViewPluginBase2
    46     {
   101     {
    47 #ifdef __COMMLAUNCHERPLUGINUNITTESTMODE
   102 #ifdef __COMMLAUNCHERPLUGINUNITTESTMODE
    48     friend class T_CCCAppCommLauncherPlugin;
   103     friend class T_CCCAppCommLauncherPlugin;
    49 #endif// __COMMLAUNCHERPLUGINUNITTESTMODE
   104 #endif// __COMMLAUNCHERPLUGINUNITTESTMODE
    50 
   105     
    51 public:
   106 public:
    52 
   107 
    53     /**
   108     /**
    54      * Two-phased constructor.
   109      * Two-phased constructor.
    55      */
   110      */
   211     {
   266     {
   212         return *iContainer;
   267         return *iContainer;
   213     }
   268     }
   214 
   269 
   215     /**
   270     /**
   216      * Return pointer to contactor service.
   271      * Returns a const pointer to contactor service.
   217      */
   272      * Use ExecuteServiceL to run contactor service.
   218     CCAContactorService* ContactorService();
   273      */
       
   274     const CCAContactorService* ContactorService();
       
   275     
       
   276     /**
       
   277      * Executes the service using CCAContactorService. This must
       
   278      * be used instead of direct call to CCAContactorService to keep
       
   279      * the command running/not running state correct.
       
   280      */
       
   281     void ExecuteServiceL(const CCAContactorService::TCSParameter& aParameter);
   219     
   282     
   220     /**
   283     /**
   221      *  Start timer.
   284      *  Start timer.
   222      */
   285      */
   223     void StartTimerL();
   286     void StartTimerL();
   272      * Sets the CBA labels.
   335      * Sets the CBA labels.
   273      * @param aEditable Boolean that tells if contact has communication
   336      * @param aEditable Boolean that tells if contact has communication
   274      * methods or not.
   337      * methods or not.
   275      */
   338      */
   276     void UpdateMSKinCbaL( TBool aCommMethodsAvailable );
   339     void UpdateMSKinCbaL( TBool aCommMethodsAvailable );
       
   340     
       
   341     /**
       
   342      * Returns the command running state instance. Command state must be
       
   343      * to running before executing the command and to not running after
       
   344      * the command has completed.
       
   345      */
       
   346     inline TCCAppCommandState& CommandState() {return iCommandState;}
   277     
   347     
   278     /**
   348     /**
   279      * Notify the timeout after sent an aiw service request.
   349      * Notify the timeout after sent an aiw service request.
   280      * 
   350      * 
   281      */
   351      */
   331     /**
   401     /**
   332      * Timer start flag.
   402      * Timer start flag.
   333      * Own.
   403      * Own.
   334      */
   404      */
   335     TBool iIsTimerStart;
   405     TBool iIsTimerStart;
       
   406     
       
   407     /**
       
   408      * 
       
   409      */
       
   410     TCCAppCommandState iCommandState;
   336     };
   411     };
   337 
   412 
   338 #endif // C_CCAPPCOMMLAUNCHERPLUGIN_H
   413 #endif // C_CCAPPCOMMLAUNCHERPLUGIN_H
   339 
   414 
   340 // End of File
   415 // End of File