menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdservice.h
changeset 0 f72a12da539e
child 27 7a8b39b569cb
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_HNMDSERVICE_H
       
    20 #define C_HNMDSERVICE_H
       
    21 
       
    22 //#include <mnaiwservices.h>
       
    23 #include <liwcommon.h>
       
    24 #include <e32base.h>
       
    25 #include <e32hashtab.h>
       
    26 #include <xmlengelement.h> 
       
    27 
       
    28 class CLiwServiceHandler;
       
    29 class CHnMdQuery;
       
    30 class CLiwGenericParamList;
       
    31 class MLiwInterface;
       
    32 class CLiwDefaultMap;
       
    33 class CHnMdBaseKey;
       
    34 class CHnMdServiceCommand;
       
    35 class CHnServiceHandler;
       
    36 
       
    37 /**
       
    38  * Service.
       
    39  * 
       
    40  * This class is desinged to facilitate dealing with services. 	
       
    41  *
       
    42  * @lib hnmetadatamodel
       
    43  * @since S60 5.0 *** for example, S60 v3.0
       
    44  * @ingroup group_hnmetadatamodel
       
    45  */
       
    46 NONSHARABLE_CLASS(CHnMdService) : public CBase
       
    47     {
       
    48 public:
       
    49 
       
    50     /**
       
    51      * Two-phase constructor.
       
    52      *
       
    53      * @since S60 5.0
       
    54      * @param aElement Xml element.
       
    55      * @return Fully cosntructed object.
       
    56      */
       
    57     static CHnMdService* NewL( TXmlEngElement aElement );
       
    58 
       
    59     /**
       
    60      * Two-phase constructor.
       
    61      *
       
    62      * @since S60 5.0
       
    63      * @param aElement Xml element.
       
    64      * @return Fully cosntructed object.
       
    65      */
       
    66     static CHnMdService* NewLC( TXmlEngElement aElement );
       
    67 
       
    68     /**
       
    69      * Standard C++ virtual destructor.
       
    70      *
       
    71      * @since S60 5.0
       
    72      */
       
    73     virtual ~CHnMdService();
       
    74     
       
    75     /**
       
    76      * Gets service.
       
    77      *
       
    78      * @since S60 5.0
       
    79      * @return Service name.
       
    80      */
       
    81     const TDesC8& GetServiceName() const;
       
    82     
       
    83     /**
       
    84      * Gets interface.
       
    85      *
       
    86      * @since S60 5.0
       
    87      * @return Interface name.
       
    88      */
       
    89     const TDesC8& GetInterfaceName() const;
       
    90     
       
    91     /**
       
    92      * Gets command.
       
    93      *
       
    94      * @since S60 5.0
       
    95      * @return Service command.
       
    96      */
       
    97     const CHnMdServiceCommand& GetCommand() const;   
       
    98     
       
    99     /**
       
   100      * returns query results
       
   101      *
       
   102      * since S60 v5.0
       
   103      * @return Result of the query to the service.
       
   104      */
       
   105     const CLiwGenericParamList& Output() const;
       
   106 
       
   107     /**
       
   108      * Returns service query constructor.
       
   109      *
       
   110      * since S60 v5.0
       
   111      * @return A structure of the key objects.
       
   112      */
       
   113     CHnMdBaseKey* GetConstructor() const;
       
   114    
       
   115     /**
       
   116      * Reads the consturctor into the model
       
   117      *
       
   118      * since S60 v5.0
       
   119      * @param aElement Xml element.
       
   120      * @return A structure of the key objects.
       
   121      */
       
   122     void CHnMdService::SetConstructorL( TXmlEngElement aElement );
       
   123     
       
   124     /**
       
   125      * Evaluates constructor.
       
   126      * 
       
   127      * @param aList Evaluation parameter.
       
   128      * @param aPos Position of the record in the parameter's list.
       
   129      * @return Evaluated generic parameters list.
       
   130      */
       
   131     CLiwGenericParamList* EvaluateConstructorL( const CLiwGenericParamList& aList,
       
   132             TInt aPos = 0);
       
   133     
       
   134     /**
       
   135      * Evaluates constructor as key.
       
   136      * 
       
   137      * @param aList Evaluation parameter.
       
   138      * @param aPos Position of the record in the parameter's list.
       
   139      * @return Evaluated key.
       
   140      */
       
   141     CHnMdBaseKey* EvaluateConstructorAsKeyL( const CLiwGenericParamList& aList,
       
   142             TInt aPos = 0);
       
   143     /**
       
   144      * Evaluates command.
       
   145      * 
       
   146      * @param aList Evaluation parameter.
       
   147      * @param aPos Position of the record in the parameter's list.
       
   148      * @return Evaluated generic parameters list.
       
   149      */
       
   150     CLiwGenericParamList* EvaluateCommandL( const CLiwGenericParamList& aList, 
       
   151             TInt aPos = 0);
       
   152     
       
   153     /**
       
   154      * Evaluates command as key.
       
   155      * 
       
   156      * @param aList Evaluation parameter.
       
   157      * @param aPos Position of the record in the parameter's list.
       
   158      * @return Evaluated key.
       
   159      */
       
   160     CHnMdBaseKey* EvaluateCommandAsKeyL( const CLiwGenericParamList& aList, 
       
   161             TInt aPos = 0);
       
   162 
       
   163 
       
   164 private:
       
   165 
       
   166     /**
       
   167      * Sets interface.
       
   168      * 
       
   169      * @param aAttr Xml attribute.
       
   170      */
       
   171     void SetInterfaceL( TXmlEngAttr aAttr );
       
   172     
       
   173     /**
       
   174      * Sets service.
       
   175      * 
       
   176      * @param aAttr Xml attribute.
       
   177      */
       
   178     void SetServiceL( TXmlEngAttr aAttr );
       
   179     
       
   180     /**
       
   181      * Standard C++ constructor.
       
   182      *
       
   183      * @since S60 5.0
       
   184      */
       
   185     CHnMdService(); 
       
   186 
       
   187 
       
   188     /**
       
   189      * Standard symbian 2nd phase contructor.
       
   190      *
       
   191      * @since S60 5.0
       
   192      * @param aElement Xml element.
       
   193      */
       
   194     void ConstructL( TXmlEngElement aElement );
       
   195   
       
   196 private: // data
       
   197 
       
   198     /**
       
   199      * Own - Service.
       
   200      */
       
   201     RBuf8 iServiceName;
       
   202 
       
   203     /**
       
   204      * Own - Interface.
       
   205      */
       
   206     RBuf8 iInterfaceName;
       
   207     
       
   208     /**
       
   209      * Own - Service command.
       
   210      */
       
   211     CHnMdServiceCommand* iServiceCommand;
       
   212     
       
   213     /**
       
   214      * Stores input parameters (not data) of the service search method
       
   215      * (ExecuteServiceCmdL).
       
   216      * Own.
       
   217      */
       
   218     CHnMdBaseKey* iConstructor;
       
   219      
       
   220     };
       
   221 
       
   222 #endif // C_HNMDSERVICEHANDLER_H