menufw/hierarchynavigator/hnutilities/inc/hnservicehandler.h
branchRCL_3
changeset 9 f966699dea19
parent 0 f72a12da539e
equal deleted inserted replaced
5:c743ef5928ba 9:f966699dea19
     9 * Initial Contributors:
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    10 * Nokia Corporation - initial contribution.
    11 *
    11 *
    12 * Contributors:
    12 * Contributors:
    13 *
    13 *
    14 * Description:  
    14 * Description:
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 #ifndef C_HNMDSERVICEHANDLER_H
    19 #ifndef C_HNMDSERVICEHANDLER_H
    20 #define C_HNMDSERVICEHANDLER_H
    20 #define C_HNMDSERVICEHANDLER_H
    21 
    21 
    22 //#include <mnaiwservices.h>
    22 //#include <mnaiwservices.h>
    23 #include <liwcommon.h>
    23 #include <liwcommon.h>
    24 #include <e32base.h>
    24 #include <e32base.h>
    25 #include <xmlengelement.h> 
    25 #include <xmlengelement.h>
    26 
    26 
    27 #include "hnglobals.h"
    27 #include "hnglobals.h"
    28 
    28 
    29 class CLiwServiceHandler;
    29 class CLiwServiceHandler;
    30 class CHnMdQuery;
    30 class CHnMdQuery;
    34 class CHnMdBaseKey;
    34 class CHnMdBaseKey;
    35 class CHnMdServiceCommand;
    35 class CHnMdServiceCommand;
    36 class CHnServiceHandler;
    36 class CHnServiceHandler;
    37 
    37 
    38 /**
    38 /**
    39  * Class represeting request to LIW service. 
    39  * Class represeting request to LIW service.
    40  * The request can be synchronous or asynchronous.
    40  * The request can be synchronous or asynchronous.
    41  *
    41  *
    42  * @since S60 5.0
    42  * @since S60 5.0
    43  * @ingroup group_hnutilities
    43  * @ingroup group_hnutilities
    44  */
    44  */
    57      * @param aConstructor Parameters used during Service construction.
    57      * @param aConstructor Parameters used during Service construction.
    58      * @param aServiceCommand Additional Parameters for the Request.
    58      * @param aServiceCommand Additional Parameters for the Request.
    59      * @return Fully cosntructed object.
    59      * @return Fully cosntructed object.
    60      */
    60      */
    61     IMPORT_C static CHnServiceHandler* NewL(
    61     IMPORT_C static CHnServiceHandler* NewL(
    62             const TDesC8& aService, const TDesC8& aInterface, 
    62             const TDesC8& aService, const TDesC8& aInterface,
    63             const TDesC8& aCommand, TServiceMode aMode,
    63             const TDesC8& aCommand, TServiceMode aMode,
    64             CLiwGenericParamList* aConstructor,
    64             CLiwGenericParamList* aConstructor,
    65             CLiwGenericParamList* aServiceCommand );
    65             CLiwGenericParamList* aServiceCommand );
    66 
    66 
    67     /**
    67     /**
    96      * @param aOutParamList Request outcome.
    96      * @param aOutParamList Request outcome.
    97      * @param aStatus Status for signalling when request completes.
    97      * @param aStatus Status for signalling when request completes.
    98      * @return Error code.
    98      * @return Error code.
    99      */
    99      */
   100     IMPORT_C TInt ExecuteL( CLiwGenericParamList& aOutParamList, TRequestStatus& aStatus );
   100     IMPORT_C TInt ExecuteL( CLiwGenericParamList& aOutParamList, TRequestStatus& aStatus );
   101     
   101 
   102     /**
   102     /**
   103      * Executes the query on the service, with external
   103      * Executes the query on the service, with external
   104      * notification callback.
   104      * notification callback.
   105      *
   105      *
   106      * since S60 v5.0
   106      * since S60 v5.0
   108      * @param aCmdOptions Additional options for the Request.
   108      * @param aCmdOptions Additional options for the Request.
   109      * @return Error code.
   109      * @return Error code.
   110      */
   110      */
   111     IMPORT_C TInt ExecuteL( MLiwNotifyCallback* aCallback,
   111     IMPORT_C TInt ExecuteL( MLiwNotifyCallback* aCallback,
   112             TInt aCmdOptions = 0 );
   112             TInt aCmdOptions = 0 );
   113             
   113 
   114             
   114 
   115     /**
   115     /**
   116      * Executes the query on the service.
   116      * Executes the query on the service.
   117      * Deprecated - Do not Use this method!!!! Will be removed asap.
   117      * Deprecated - Do not Use this method!!!! Will be removed asap.
       
   118      *
       
   119      * since S60 v5.0
       
   120      * @return Error code.
       
   121      */
       
   122     IMPORT_C TInt ExecuteL();
       
   123 
       
   124     /**
       
   125      * Checks if an action model matches an existing service.
       
   126      *
       
   127      * since S60 v5.0
       
   128      * @param aService service.
       
   129      * @param aInterface interface.
       
   130      * @param aConstructor constructor.
       
   131      * @return true if an action model matches the service.
       
   132      */
       
   133     IMPORT_C TBool ServiceHandlerMatchesModel(
       
   134         const TDesC8& aService,
       
   135         const TDesC8& aInterface,
       
   136         const CLiwGenericParamList* aConstructor ) const;
       
   137     
       
   138     /**
       
   139      * Allows for reusing the object when a request needs to be invoked on
       
   140      * the same interface of the same service.
   118      * 
   141      * 
   119      * since S60 v5.0
   142      * @param aCommand Request to the Service.
   120      * @return Error code.
   143      * @param aMode Asynchronous or Synchronous Request.
   121      */
   144      * @param aServiceCommand Additional Parameters for the Request.
   122     IMPORT_C TInt ExecuteL();
   145      */
   123     
   146     IMPORT_C void PrepareForNextExecutionL( const TDesC8& aCommand,
       
   147             TServiceMode aMode, CLiwGenericParamList* aServiceCommand );
       
   148 
   124 private:
   149 private:
   125 
   150 
   126     /**
   151     /**
   127      * Standard C++ constructor.
   152      * Standard C++ constructor.
   128      *
   153      *
   129      * @since S60 5.0
   154      * @since S60 5.0
   130      * @param aMode Synchronous or asynchronous.
   155      * @param aMode Synchronous or asynchronous.
   131      */
   156      */
   132     CHnServiceHandler( TServiceMode aMode ); 
   157     CHnServiceHandler( TServiceMode aMode );
   133 
   158 
   134 
   159 
   135     /**
   160     /**
   136      * Standard symbian 2nd phase contructor.
   161      * Standard symbian 2nd phase contructor.
   137      *
   162      *
   138      * @since S60 5.0
   163      * @since S60 5.0
   139      * @param aService Service name.
   164      * @param aService Service name.
   140      * @param aInterface Interface name.
   165      * @param aInterface Interface name.
   141      * @param aCommandName Request to the Service.
   166      * @param aCommandName Request to the Service.
   142      * @param aConstructor Parameters used during Service construction.
   167      * @param aConstructor Parameters used during Service construction.
   143      * @param aServiceCommand Additional Parameters for the Request.  
   168      * @param aServiceCommand Additional Parameters for the Request.
   144      */
   169      */
   145     void ConstructL(
   170     void ConstructL(
   146             const TDesC8& aService, const TDesC8& aInterface,
   171             const TDesC8& aService, const TDesC8& aInterface,
   147             const TDesC8& aCommandName,
   172             const TDesC8& aCommandName,
   148             CLiwGenericParamList* aConstructor,
   173             CLiwGenericParamList* aConstructor,
   149             CLiwGenericParamList* aServiceCommand );
   174             CLiwGenericParamList* aServiceCommand );
   150 
   175 
   151     
   176 
   152     /**
   177     /**
   153      * Handles notifications caused by an asynchronous Request.
   178      * Handles notifications caused by an asynchronous Request.
   154      *
   179      *
   155      * @param aCmdId The service command associated to the event.
   180      * @param aCmdId The service command associated to the event.
   156      * @param aEventId Occured event, see LiwCommon.hrh.
   181      * @param aEventId Occured event, see LiwCommon.hrh.
   166             CLiwGenericParamList& aEventParamList,
   191             CLiwGenericParamList& aEventParamList,
   167             const CLiwGenericParamList& aInParamList);
   192             const CLiwGenericParamList& aInParamList);
   168 
   193 
   169     /**
   194     /**
   170      * Creates interface.
   195      * Creates interface.
   171      * 
   196      *
   172      * @param aConstructor constructor
   197      * @param aConstructor constructor
   173      * @return Error code.
   198      * @return Error code.
   174      */
   199      */
   175     TInt SetServiceInterfaceL( CLiwGenericParamList* aConstructor );
   200     TInt SetServiceInterfaceL( CLiwGenericParamList* aConstructor );
   176      
   201 
   177 private: // data
   202 private: // data
   178 
   203 
   179     /**
   204     /**
   180      * Service name.
   205      * Service name.
   181      * Own.
   206      * Own.
   185     /**
   210     /**
   186      * Interface name.
   211      * Interface name.
   187      * Own.
   212      * Own.
   188      */
   213      */
   189     RBuf8 iInterfaceName;
   214     RBuf8 iInterfaceName;
   190     
   215 
   191     /**
   216     /**
   192      * Command (Request) name.
   217      * Command (Request) name.
   193      * Own.
   218      * Own.
   194      */
   219      */
   195     RBuf8 iCommandName;
   220     RBuf8 iCommandName;
   196 
   221 
   197     /**
   222     /**
   198      * Service mode.
   223      * Service mode.
   199      */
   224      */
   200     TServiceMode iMode;
   225     TServiceMode iMode;
   201     
   226 
   202     /**
   227     /**
   203      * Stores input parameters (not data) of the service search method\
   228      * Stores input parameters (not data) of the service search method\
   204      * (ExecuteServiceCmdL).
   229      * (ExecuteServiceCmdL).
   205      * Own. 
   230      * Own.
   206      */
   231      */
   207     CLiwGenericParamList* iConstructor;
   232     CLiwGenericParamList* iConstructor;
   208 
   233 
   209     /**
   234     /**
   210      * 
   235      *
   211      * Own.
   236      * Own.
   212      */
   237      */
   213     CLiwGenericParamList* iCommand;
   238     CLiwGenericParamList* iCommand;
   214     
   239 
   215     /**
   240     /**
   216      * Parameters for the Request.
   241      * Parameters for the Request.
   217      * Own.
   242      * Own.
   218      */
   243      */
   219     CLiwGenericParamList* iInput;
   244     CLiwGenericParamList* iInput;
   220     
   245 
   221     /**
   246     /**
   222      * Request results from ExecuteL();
   247      * Request results from ExecuteL();
   223      * Own.
   248      * Own.
   224      */
   249      */
   225     CLiwGenericParamList* iOutputForAS;
   250     CLiwGenericParamList* iOutputForAS;
   226     
   251 
   227     /**
   252     /**
   228      * Request results from 
   253      * Request results from
   229      * ExecuteL( CLiwGenericParamList& aOutParamList, TRequestStatus& aStatus ).
   254      * ExecuteL( CLiwGenericParamList& aOutParamList, TRequestStatus& aStatus ).
   230      * Own.
   255      * Own.
   231      */
   256      */
   232     CLiwGenericParamList* iOutputForAO;
   257     CLiwGenericParamList* iOutputForAO;
   233     
   258 
   234     /**
   259     /**
   235      * Service interface. 
   260      * Service interface.
   236      */
   261      */
   237     MLiwInterface* iServiceInterface;
   262     MLiwInterface* iServiceInterface;
   238     
   263 
   239     /**
   264     /**
   240      * Service Handler.
   265      * Service Handler.
   241      * Own.
   266      * Own.
   242      */
   267      */
   243     CLiwServiceHandler* iServiceHandler;
   268     CLiwServiceHandler* iServiceHandler;
   244     
   269 
   245     /**
   270     /**
   246      * Client status.
   271      * Client status.
   247      * Not Own.
   272      * Not Own.
   248      */
   273      */
   249     TRequestStatus* iClientStatus;
   274     TRequestStatus* iClientStatus;
   250     
   275 
   251     /**
   276     /**
   252      * Waits for asynchronous queries.
   277      * Waits for asynchronous queries.
   253      * Own.
   278      * Own.
   254      */
   279      */
   255     CActiveSchedulerWait* iWait;
   280     CActiveSchedulerWait* iWait;
   256     
   281 
   257     };
   282     };
   258 
   283 
   259 #endif // C_HNMDSERVICEHANDLER_H
   284 #endif // C_HNMDSERVICEHANDLER_H