menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdaction.h
changeset 0 f72a12da539e
equal deleted inserted replaced
-1:000000000000 0:f72a12da539e
       
     1 /*
       
     2 * Copyright (c) 2007-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:  
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef C_HNMDACTION_H
       
    21 #define C_HNMDACTION_H
       
    22 
       
    23 #include <e32base.h>
       
    24 #include <xmlengdom.h>
       
    25 
       
    26 class CLiwGenericParamList;
       
    27 class CLiwDefaultMap;
       
    28 class TLiwVariant;
       
    29 class CHnMdBaseKey;
       
    30 class CHnMdServiceCommand;
       
    31 class CHnActionModel;
       
    32 class CHnMdService;
       
    33 class CHnConditionInterface;
       
    34 
       
    35 /**
       
    36  * Action.
       
    37  * 
       
    38  * This is the class that represents the action. Actions are used
       
    39  * to invoke different functions or methods from services, plugins
       
    40  * or internally defined in the Matrix Menu.
       
    41  *
       
    42  * @lib hnmetadatamodel
       
    43  * @since S60 v5.0
       
    44  * @ingroup group_hnmetadatamodel
       
    45  */
       
    46 NONSHARABLE_CLASS(CHnMdAction) : public CBase
       
    47     {
       
    48 public:
       
    49 
       
    50     /**
       
    51      * Standard factory method.
       
    52      *
       
    53      * since S60 v5.0
       
    54      * @param aElement Xml element.
       
    55      * @return Fully constructed object.
       
    56      */
       
    57     static CHnMdAction* NewL( TXmlEngElement aElement );
       
    58 
       
    59     /**
       
    60      * Standard factory method.
       
    61      *
       
    62      * since S60 v5.0
       
    63      * @param aElement Xml element.
       
    64      * @return Fully constructed object.
       
    65      */
       
    66     static CHnMdAction* NewLC( TXmlEngElement aElement );
       
    67 
       
    68     /**
       
    69      * standard destructor
       
    70      */
       
    71     virtual ~CHnMdAction();
       
    72       
       
    73     /**
       
    74      * Evaluates action model based on the instance of meta data action.
       
    75      *
       
    76      * @since S60 5.0
       
    77      * @param aActionModel Visual model af an action.
       
    78      * @param aQueriesResultsList Query results.
       
    79      * @param aPos Position in the query.
       
    80      * @return Error code.
       
    81      */    
       
    82     TInt EvaluateL( CHnActionModel* aActionModel,
       
    83             const CLiwGenericParamList& aQueriesResultsList, 
       
    84             TInt aPos = 0);
       
    85     /**
       
    86      * Checks if the menu item is valid.
       
    87      *
       
    88      * @since S60 5.0
       
    89      * @param aQueryResults Query results in the form of the CLiwGenericParamList object.
       
    90      * @param aPos Position in the query.
       
    91      * @return True if valid, otherwise false.
       
    92      */
       
    93     TBool IsValidL( const CLiwGenericParamList& aQueryResults, 
       
    94             TInt aPos = 0 );
       
    95     
       
    96 private:
       
    97 
       
    98     /**
       
    99      * Default constructor.
       
   100      */
       
   101     CHnMdAction();
       
   102 
       
   103     /**
       
   104      * EPOC default constructor for performing 2nd stage construction.
       
   105      * 
       
   106      * @param aElement Xml element.
       
   107      */
       
   108     void ConstructL( TXmlEngElement aElement );
       
   109   
       
   110     /**
       
   111      * Sets interface.
       
   112      * @param aAttr Xml attribute.
       
   113      */  
       
   114     void SetConditionL( TXmlEngAttr aAttr );
       
   115   
       
   116     
       
   117 private: // data
       
   118 
       
   119     /**
       
   120      * Own - Condition.
       
   121      */
       
   122     CHnConditionInterface* iCondition;
       
   123      
       
   124     /**
       
   125      * Own.
       
   126      */
       
   127     CHnMdService* iService;
       
   128 
       
   129     };
       
   130 
       
   131 #endif // C_HNMMACTION_H