vtuis/videotelui/inc/commands/cvtuiprimarycmdpolicy.h
branchRCL_3
changeset 24 f15ac8e65a02
parent 23 890b5dd735f8
child 25 779871d1e4f4
equal deleted inserted replaced
23:890b5dd735f8 24:f15ac8e65a02
     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:  Primary command policy class definition.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_VTUIPRIMARYCMDPOLICY_H
       
    20 #define C_VTUIPRIMARYCMDPOLICY_H
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 #include "tvtuicmdpolicypriority.h"
       
    25 #include "cvtuicmdvalidatorbase.h"
       
    26 #include "tvtuilocalvariation.h"
       
    27 
       
    28 class CVtUiCmdValidationActionBase;
       
    29 class TVtUiStates;
       
    30 class CVtUiAppUi;
       
    31 /**
       
    32  * CVtUiPrimaryCmdPolicy
       
    33  *
       
    34  * Primary policy is the highest priority policy. It does the basic validation,
       
    35  * results of which can be modified by the lower priority validators.
       
    36  *
       
    37  * @since S60 v3.2
       
    38  */
       
    39 NONSHARABLE_CLASS( CVtUiPrimaryCmdPolicy ) : public CVtUiCmdValidatorBase
       
    40     {
       
    41 
       
    42 public: // public methods
       
    43 
       
    44     /**
       
    45      * Static constructor.
       
    46      *
       
    47      * @param aUiStates Constant reference to UI states object.
       
    48      * @return Newly created instace of CVtUiPrimaryCmdPolicy class.
       
    49      */
       
    50     static CVtUiPrimaryCmdPolicy* NewL( const TVtUiStates& aUiStates, 
       
    51         const CVtUiAppUi& aAppUi );
       
    52 
       
    53     /**
       
    54      * Destructor
       
    55      */
       
    56     ~CVtUiPrimaryCmdPolicy();
       
    57 
       
    58 public: // from CVtUiCmdValidatorBase
       
    59 
       
    60     /**
       
    61      * @see CVtUiCmdValidatorBase::ValidateMenuItemsL
       
    62      */
       
    63     void ValidateMenuItemsL( CVtUiCmdValidationActionBase& aAction,
       
    64         TInt aReferencePriority );
       
    65 
       
    66     /**
       
    67      * @see CVtUiCmdValidatorBase::ValidateSoftkeyItemsL
       
    68      */
       
    69     void ValidateSoftkeyItemsL( CVtUiCmdValidationActionBase& aAction,
       
    70         TInt aReferencePriority );
       
    71 
       
    72     /**
       
    73      * @see CVtUiCmdValidatorBase::ValidateToolbarItemsL
       
    74      */
       
    75     void ValidateToolbarItemsL( CVtUiCmdValidationActionBase& aAction,
       
    76         TInt aReferencePriority );
       
    77 
       
    78     /**
       
    79      * @see CVtUiCmdValidatorBase::CustomValidationL
       
    80      */
       
    81     void CustomValidationL( CVtUiCmdCustomValidationActionBase& aAction,
       
    82         TInt aReferencePriority );
       
    83 
       
    84     /**
       
    85      * @see CVtUiCmdValidatorBase::ValidatesContext
       
    86      */
       
    87     TBool ValidatesContext( const TVtUiCmdContextType& aCtxType )
       
    88         const;
       
    89 
       
    90 private:
       
    91 
       
    92     /**
       
    93      * C++ constructor
       
    94      */
       
    95     CVtUiPrimaryCmdPolicy( const TVtUiStates& aUiStates, 
       
    96         const CVtUiAppUi& aAppUi );
       
    97 
       
    98     /**
       
    99      * 2nd constructor
       
   100      */
       
   101     void ConstructL();
       
   102 
       
   103     /**
       
   104      * Callback for menu validation.
       
   105      */
       
   106     TBool ValidateMenuCommand( TInt aCommandId ) const;
       
   107 
       
   108     /**
       
   109      * Callback for softkey resource id validation.
       
   110      */
       
   111     TBool ValidateSoftkey( TInt aResourceId ) const;
       
   112 
       
   113     /**
       
   114      * Callback for toolbar command validation.
       
   115      */
       
   116     TBool ValidateToolbarCommand( TInt aCommandId ) const;
       
   117 
       
   118     /**
       
   119      * Callback for command state validation.
       
   120      */
       
   121     TBool ValidateCommandState( TInt aCommandId ) const;
       
   122 
       
   123     /**
       
   124      * Callback for command validation.
       
   125      */
       
   126     TBool ValidateCommand( TInt aCommandId, TBool& aHandled ) const;
       
   127 
       
   128 private: // data
       
   129 
       
   130     // UI states
       
   131     const TVtUiStates& iUiStates;
       
   132 
       
   133     // Active idle local variation    
       
   134     TBool iAIEnabled;
       
   135     
       
   136     // Reference to appui
       
   137     const CVtUiAppUi& iAppUi;
       
   138 
       
   139     };
       
   140 
       
   141 #endif // C_VTUIPRIMARYCMDPOLICY_H