menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdservicecommand.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 #ifndef C_HNMDSERVICECOMMAND_H
       
    20 #define C_HNMDSERVICECOMMAND_H
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 #include "hnglobals.h"
       
    25 
       
    26 class TXmlEngElement;
       
    27 class TXmlEngAttr;
       
    28 class CHnMdBaseKey;
       
    29 
       
    30 /**
       
    31  * Service Command.
       
    32  * 
       
    33  * This class represents the service command. In general, the service command
       
    34  * are parameters of the service queries.
       
    35  *
       
    36  * @lib hnmetadatamodel
       
    37  * @since S60 5.0 *** for example, S60 v3.0
       
    38  * @ingroup group_hnmetadatamodel
       
    39  */   
       
    40 NONSHARABLE_CLASS( CHnMdServiceCommand ) : public CBase
       
    41 {
       
    42 public:
       
    43     
       
    44     /**
       
    45      * Two-phase constructor.
       
    46      *
       
    47      * @since S60 5.0
       
    48      * @param aElement Xml element.
       
    49      * @return Fully constructed object.
       
    50      */
       
    51     static CHnMdServiceCommand* NewL( TXmlEngElement aElement );
       
    52 
       
    53     /**
       
    54      * Two-phase constructor.
       
    55      *
       
    56      * @since S60 5.0
       
    57      * @param aElement Xml element.
       
    58      * @return Fully constructed object.
       
    59      */
       
    60     static CHnMdServiceCommand* NewLC( TXmlEngElement aElement );
       
    61 
       
    62     /**
       
    63      * Standard C++ virtual destructor.
       
    64      */
       
    65     virtual ~CHnMdServiceCommand();
       
    66     
       
    67     /**
       
    68      * Returns command.
       
    69      *
       
    70      * @since S60 5.0
       
    71      * @return Command name.
       
    72      */
       
    73     const TDesC8& GetCommandName() const;
       
    74     
       
    75     /**
       
    76      * Returns data.
       
    77      *
       
    78      * @since S60 5.0
       
    79      * @return A list of keys.
       
    80      */
       
    81     CHnMdBaseKey* GetCommandData() const;
       
    82 
       
    83     /**
       
    84      * Returns service mode.
       
    85      *
       
    86      * @since S60 5.0
       
    87      * @return Command mode.
       
    88      */
       
    89     TServiceMode GetCommandMode() const;
       
    90        
       
    91 private:
       
    92     
       
    93     /**
       
    94      * Standard C++ constructor.
       
    95      */
       
    96     CHnMdServiceCommand();
       
    97 
       
    98     /**
       
    99      * Standard symbian 2nd phase constructor.
       
   100      *
       
   101      * @since S60 5.0
       
   102      * @param aElement Xml element.
       
   103      */
       
   104     void ConstructL( TXmlEngElement aElement );
       
   105         
       
   106     /**
       
   107      * Sets command parameters.
       
   108      * 
       
   109      * @param aElement Xml element.
       
   110      */  
       
   111     void SetCommandDataL( TXmlEngElement aElement );
       
   112     
       
   113     /**
       
   114      * Sets service name.
       
   115      *
       
   116      * @since S60 5.0
       
   117      * @param aAttr Xml attribute.
       
   118      */
       
   119     void SetCommandNameL( TXmlEngAttr aAttr );
       
   120        
       
   121     /**
       
   122      * Sets service mode.
       
   123      *
       
   124      * @since S60 5.0
       
   125      * @param aAttr Xml attribute.
       
   126      */
       
   127     void SetCommandModeL( TXmlEngAttr aAttr );
       
   128     
       
   129     /**
       
   130      * Removes redundant key.
       
   131      * TO BE REMOVED.
       
   132      * 
       
   133      * @param aElement Xml element.
       
   134      * @return Xml element with removed redundant key. 
       
   135      */
       
   136     TXmlEngElement RemoveRedundantKeyL( TXmlEngElement aElement );
       
   137     
       
   138 private:
       
   139     
       
   140     /**
       
   141      * Service mode: synchronous / asynchronous
       
   142      */
       
   143     TServiceMode iMode;
       
   144     
       
   145     /**
       
   146      * Command name, own
       
   147      */ 
       
   148     RBuf8 iName;
       
   149 
       
   150     /**
       
   151      * Data - service parameters, own
       
   152      */
       
   153     CHnMdBaseKey* iData;
       
   154 };
       
   155 
       
   156 #endif /*HNMDSERVICECOMMAND_H_*/