vtengines/videoteleng/Inc/Commands/MVtEngCommandHandler.h
changeset 0 ed9695c8bcbe
child 12 3e521e99f813
equal deleted inserted replaced
-1:000000000000 0:ed9695c8bcbe
       
     1 /*
       
     2 * Copyright (c) 2006 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:  Command handler interface of the engine.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef MVTENGCOMMANDHANDLER_H
       
    21 #define MVTENGCOMMANDHANDLER_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 #include "vtengcommands.h"
       
    26 
       
    27 // CONSTANTS
       
    28 
       
    29 // MACROS
       
    30 
       
    31 // DATA TYPES
       
    32 
       
    33 // FUNCTION PROTOTYPES
       
    34 
       
    35 // FORWARD DECLARATIONS
       
    36 
       
    37 class MVtEngCommandObserver;
       
    38 
       
    39 // CLASS DECLARATION
       
    40 
       
    41 /**
       
    42 *  Handler for commands from client.
       
    43 *
       
    44 *  @lib videoteleng
       
    45 *  @since 2.6
       
    46 */
       
    47 class MVtEngCommandHandler
       
    48     {
       
    49     public:        
       
    50 
       
    51         /**
       
    52         * EAttribAsync
       
    53         *  command is asynchronous. 
       
    54         * EAttribEnabled
       
    55         *  Command can be executed at the moment.
       
    56         * EAttribSupported
       
    57         *  Command is supported by the engine.
       
    58         */
       
    59         enum TCommandCaps 
       
    60             { 
       
    61             EAttribAsync      = 0x00000001,
       
    62             EAttribEnabled    = 0x00000002,
       
    63             EAttribSupported  = 0x00000004
       
    64             };
       
    65 
       
    66         /**
       
    67         * Excecutes a command. This function leaves KErrNotReady
       
    68         * if engine is in such a state that command cannot be
       
    69         * executed.
       
    70         * 
       
    71         * @param aCommandId command to be executed.
       
    72         * @param aParams command parameters, NULL if command
       
    73         * does not require any.
       
    74         */
       
    75         virtual void ExecuteL( 
       
    76             const TVtEngCommandId aCommandId,
       
    77             TDesC8* aParams ) = 0;
       
    78 
       
    79         /**
       
    80         * Cancels a command.
       
    81         * @param aCommandId command to cancel. 
       
    82         * @return KErrNotFound if command is not pending.
       
    83         */
       
    84         virtual TInt CancelCommand( const TVtEngCommandId aCommandId ) = 0;
       
    85 
       
    86         /**
       
    87         * Returns capabilities of a command.
       
    88         * @return command caps
       
    89         */
       
    90         virtual TInt GetCommandCaps( 
       
    91             const TVtEngCommandId aCommand ) = 0;
       
    92 
       
    93         /**
       
    94         * Returns pending command.
       
    95         * @return pending command
       
    96         */
       
    97         virtual TVtEngCommandId PendingCommand() = 0;
       
    98 
       
    99         /**
       
   100         * Sets command observer. First call on this is guaranteed
       
   101         * to succeed.
       
   102         * @param aObserver command observer.
       
   103         */
       
   104         virtual void AddObserverL( MVtEngCommandObserver& aObserver ) = 0;
       
   105 
       
   106         /**
       
   107         * Removes a command observer or if non-op if specified observer
       
   108         * is not found.
       
   109         * @param aObserver command observer to be removed.
       
   110         */
       
   111         virtual void RemoveObserver( MVtEngCommandObserver& aObserver ) = 0;
       
   112     };
       
   113 
       
   114 #endif //MVTENGCOMMANDHANDLER_H
       
   115 
       
   116 // End of File