vtuis/videotelui/inc/commands/mvtuicommandmanager.h
branchRCL_3
changeset 35 779871d1e4f4
parent 0 ed9695c8bcbe
equal deleted inserted replaced
34:f15ac8e65a02 35:779871d1e4f4
       
     1 /*
       
     2 * Copyright (c) 2007 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 manager API definition.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef M_VTUICOMMANDMANAGER_H
       
    20 #define M_VTUICOMMANDMANAGER_H
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 class CEikMenuPane;
       
    25 class CVtUiCmdContext;
       
    26 class CVtUiCmdValidatorBase;
       
    27 class CVtUiCmdValidationActionBase;
       
    28 class MVtUiCommandUi;
       
    29 class CVtUiCommandModifyBase;
       
    30 class CVtUiCmdCustomValidationActionBase;
       
    31 class CVtUiCmdBase;
       
    32 
       
    33 /**
       
    34  *  MVtUiCommandManager
       
    35  *
       
    36  *  Command manager API for other components. Command manager holds command UI
       
    37  *  instances and does command validation for all registered commands.
       
    38  *
       
    39  *  @since S60 v3.2
       
    40  */
       
    41 class MVtUiCommandManager
       
    42     {
       
    43 
       
    44 public:
       
    45 
       
    46     /**
       
    47      * Adds new command ui to command manager.
       
    48      * @param aCommandUi Reference to command ui to be added.
       
    49      * @return KErrNone if command ui was added successfully.
       
    50      */
       
    51     virtual TInt AddCommandUi( MVtUiCommandUi& aCommandUi ) = 0;
       
    52 
       
    53     /**
       
    54      * Removes command ui from command manager.
       
    55      * @param aCommandUi Constant reference to command ui to be removed.
       
    56      *
       
    57      */
       
    58     virtual void RemoveCommandUi( MVtUiCommandUi& aCommandUi ) = 0;
       
    59 
       
    60     /**
       
    61      * Validate menu items in given manu pane.
       
    62      *
       
    63      * @param aAction Reference to action to be carried on all menu commands.
       
    64      */
       
    65     virtual void ValidateMenuItemsL(
       
    66         CVtUiCmdValidationActionBase& aAction ) = 0;
       
    67 
       
    68     /**
       
    69      * Validate softkeys.
       
    70      *
       
    71      * @param aAction Reference to action to be carried on all softkeys.
       
    72      */
       
    73     virtual void ValidateSoftkeyItemsL(
       
    74         CVtUiCmdValidationActionBase& aAction ) = 0;
       
    75 
       
    76     /**
       
    77      * Validate toolbar buttons.
       
    78      *
       
    79      * @param aAction Reference to action to be carried on all toolbar commands.
       
    80      */
       
    81     virtual void ValidateToolbarItemsL(
       
    82         CVtUiCmdValidationActionBase& aAction ) = 0;
       
    83 
       
    84     /**
       
    85      * Validate command.
       
    86      *
       
    87      * @param aCommandId Id of command that is being checked.
       
    88      * @return ETrue if command can be executed, EFalse otherwise.
       
    89      */
       
    90     virtual TBool IsCommandAllowedL( TInt aCommandId ) = 0;
       
    91 
       
    92     /**
       
    93      * Registers command context.
       
    94      *
       
    95      * @param aContext Reference to command context to be registered.
       
    96      * @return KErrNone if registration succeeded.
       
    97      */
       
    98     virtual TInt RegisterCommandContext( CVtUiCmdContext& aContext ) = 0;
       
    99 
       
   100     /**
       
   101      * Unregisters command context.
       
   102      *
       
   103      * @param aContext Reference to command context to be unregistered.
       
   104      */
       
   105     virtual void UnregisterCommandContext( CVtUiCmdContext& aContext ) = 0;
       
   106 
       
   107     /**
       
   108      * Adds validator to policy manager and registered contexts.
       
   109      *
       
   110      * @param aValidator Reference to validator to be added.
       
   111      * @return KErrNone if registration succeeded.
       
   112      */
       
   113     virtual TInt AddValidator( CVtUiCmdValidatorBase& aValidator ) = 0;
       
   114 
       
   115     /**
       
   116      * Removes validator from policy manager and registered contexts.
       
   117      *
       
   118      * @param aValidator Constant reference to validator to be removed.
       
   119      */
       
   120     virtual void RemoveValidator( CVtUiCmdValidatorBase& aValidator ) = 0;
       
   121 
       
   122     /**
       
   123      * Refresh command uis.
       
   124      */
       
   125     virtual void RefreshL() = 0;
       
   126 
       
   127     /**
       
   128      * Add new command modifier.
       
   129      *
       
   130      * @param aModifier Reference to command modifier to be added to every
       
   131      * registered command setting.
       
   132      * @return KErrNone if modifier could be added, KErrAlreadyExists if same
       
   133      * modifier is already added or KErrArgument if another modifier with
       
   134      * same priority is already added.
       
   135      */
       
   136     virtual TInt AddCommandModifier( CVtUiCommandModifyBase& aModifier ) = 0;
       
   137 
       
   138     /**
       
   139      * Remove command modifier.
       
   140      *
       
   141      * @param aModifier Reference to command modifier to be removed from every
       
   142      * registered command setting.
       
   143      */
       
   144     virtual void RemoveCommandModifier( CVtUiCommandModifyBase& aModifier ) = 0;
       
   145 
       
   146     /**
       
   147      * Registers new command to command manager.
       
   148      *
       
   149      * @param aCommand Reference to command to be registered.
       
   150      */
       
   151     virtual void RegisterCommandL( CVtUiCmdBase& aCommand ) = 0;
       
   152 
       
   153     /**
       
   154      * Unregisters command from command manager.
       
   155      *
       
   156      * @param aCommand Constant reference to command to be unregistered.
       
   157      */
       
   158     virtual void UnregisterCommand( const CVtUiCmdBase& aCommand ) = 0;
       
   159 
       
   160     };
       
   161 
       
   162 #endif // M_VTUICOMMANDMANAGER_H