vtuis/lcvtplugin/inc/base/clcvtcmdexecutor.h
branchRCL_3
changeset 25 779871d1e4f4
parent 24 f15ac8e65a02
child 26 590f6f022902
equal deleted inserted replaced
24:f15ac8e65a02 25:779871d1e4f4
     1 /*
       
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Class for command execution for Video Telephone application.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CLCVTCMDEXECUTOR_H_
       
    19 #define CLCVTCMDEXECUTOR_H_
       
    20 
       
    21 //  INCLUDES
       
    22 #include    <e32base.h>
       
    23 #include    <mvtengcommandobserver.h>
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class MVtEngCommandHandler;
       
    27 class MLcVtEngineCommandManager;
       
    28 
       
    29 // CLASS DECLARATION
       
    30 
       
    31 /**
       
    32 *  Class for command execution for Video Telephone application.
       
    33 *
       
    34 *  @since Series 60 2.6
       
    35 */
       
    36 class CLcVtCmdExecutor
       
    37     : public CBase,
       
    38       private MVtEngCommandObserver
       
    39     {
       
    40     public: // Constructors and destructor
       
    41 
       
    42         /**
       
    43         * Constructor.
       
    44         *
       
    45         * @param aSelfPtr optional pointer to itself.
       
    46         * @param aCommandHandler command handler.
       
    47         * @param aCommandManager command manager.
       
    48         */
       
    49         CLcVtCmdExecutor(
       
    50             CLcVtCmdExecutor** aSelfPtr,
       
    51             MVtEngCommandHandler& aCommandHandler,
       
    52             MLcVtEngineCommandManager& aCommandManager );
       
    53 
       
    54         /**
       
    55         * Destructor.
       
    56         */
       
    57         ~CLcVtCmdExecutor();
       
    58 
       
    59     public: // New functions
       
    60 
       
    61         /**
       
    62         * Executes command.
       
    63         * @param aCommandId command identifier.
       
    64         * @param aParams parameters.
       
    65         * @param aRequest request status, optional.
       
    66         */
       
    67         void ExecuteCmdL(
       
    68             const TVtEngCommandId aCommandId,
       
    69             TDesC8* aParams,
       
    70             TRequestStatus* aRequest );
       
    71 
       
    72         /**
       
    73         * @see MVtEngCommandObserver::HandleVTCommandPerformedL.
       
    74         */
       
    75         virtual void HandleVTCommandPerformedL(
       
    76             TVtEngCommandId aCommand,
       
    77             const TInt aError );
       
    78         
       
    79     protected: // New functions
       
    80 
       
    81         /**
       
    82         * Completes dialog with error.
       
    83         * Note: this method will delete the dialog.
       
    84         * @param aError error code.
       
    85         */
       
    86         void Complete( const TInt aError );
       
    87         
       
    88     private:
       
    89         /**
       
    90         * Handles execution failure.
       
    91         * @param aResult error code.
       
    92         */
       
    93         void HandleExecuteFailed( TInt aResult );
       
    94 
       
    95     private:
       
    96 
       
    97         // Inner class.
       
    98         class CActiveCmd;
       
    99 
       
   100         // Friend.
       
   101         friend class CActiveCmd;
       
   102         
       
   103         //pointer to itself 
       
   104         CLcVtCmdExecutor** iSelfPtr;
       
   105         
       
   106         // Error code.
       
   107         TInt* iError;
       
   108 
       
   109         // Request status.
       
   110         TRequestStatus* iRequest;        
       
   111 
       
   112         // Ref to command handler.
       
   113         MVtEngCommandHandler& iCommandHandler;
       
   114 
       
   115         // Ref to command manager.
       
   116         MLcVtEngineCommandManager& iCommandManager;
       
   117 
       
   118         // Command to be executed.
       
   119         TVtEngCommandId iCommand;
       
   120 
       
   121         // Owned parameters.
       
   122         HBufC8* iCommandParams;
       
   123 
       
   124         // ETrue if command has been completed.
       
   125         TBool iCommandCompleted;
       
   126 
       
   127         // Owned active object to perform the command.
       
   128         CActiveCmd* iActiveCmd;        
       
   129         
       
   130         // ActiveSheduler Waiter inside CLcVtCmdExecutor
       
   131         CActiveSchedulerWait iWait;
       
   132         
       
   133     };
       
   134 
       
   135 
       
   136 
       
   137 #endif /* CLCVTCMDEXECUTOR_H_ */