vtuis/videotelui/inc/commands/cvtuicommandsetting.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 settings class definition.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_VTUICOMMANDSETTING_H
       
    20 #define C_VTUICOMMANDSETTING_H
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 #include "mvtuicommandsetting.h"
       
    25 
       
    26 class CVtUiCommandModifyBase;
       
    27 
       
    28 /**
       
    29  *  CVtUiCommandSetting
       
    30  *
       
    31  *  Template commmand setting class that takes command setting action as a
       
    32  *  templated parameter.
       
    33  *
       
    34  *  @since S60 v3.2
       
    35  */
       
    36 template < typename ACTION >
       
    37 class CVtUiCommandSetting : public CBase, public MVtUiCommandSetting
       
    38     {
       
    39 
       
    40 public:
       
    41 
       
    42     /**
       
    43      * Destructor
       
    44      */
       
    45     ~CVtUiCommandSetting();
       
    46 
       
    47     /**
       
    48      * Defines commands.
       
    49      *
       
    50      * @param aAction Action related to commands to be defined.
       
    51      */
       
    52     void DefineCommandsL( const ACTION& aAction );
       
    53 
       
    54     /**
       
    55      * Adds new modifer
       
    56      *
       
    57      * @param aModifier Reference to modifier to be added to this setting
       
    58      * instance.
       
    59      * @return KErrNone if modifier could be added, KErrAlreadyExists if same
       
    60      * modifier is already added or KErrArgument if another modifier with
       
    61      * same priority is already added.
       
    62      */
       
    63     TInt AddModifier( CVtUiCommandModifyBase& aModifier );
       
    64 
       
    65     /**
       
    66      * Removes modifier
       
    67      *
       
    68      * @param aModifier Constant reference to modifier to be removed.
       
    69      */
       
    70     void RemoveModifier( CVtUiCommandModifyBase& aModifier );
       
    71 
       
    72     /**
       
    73      * Return command type
       
    74      *
       
    75      * @return Type of commands this setting class instance is defining.
       
    76      */
       
    77     Type CommandType() const;
       
    78 
       
    79     /**
       
    80      * Returns reference to action
       
    81      *
       
    82      * @return Constant reference to action that is related to this command
       
    83      * definition process.
       
    84      */
       
    85     const ACTION& Action();
       
    86 
       
    87 protected:
       
    88 
       
    89     /**
       
    90      * Constructor
       
    91      */
       
    92     CVtUiCommandSetting( Type aCommandType );
       
    93 
       
    94 private:
       
    95 
       
    96     // Modifiers
       
    97     RPointerArray< CVtUiCommandModifyBase > iModifiers;
       
    98 
       
    99     // Command type
       
   100     const Type iCommandType;
       
   101 
       
   102     // Stored action
       
   103     const ACTION* iAction;
       
   104 
       
   105     };
       
   106 
       
   107 #include "cvtuicommandsetting.inl"
       
   108 
       
   109 #endif // C_VTUICOMMANDSETTING_H