phoneengine/PhoneCntFinder/ContactService/inc/CPhCntService.h
changeset 0 5f000ab63145
equal deleted inserted replaced
-1:000000000000 0:5f000ab63145
       
     1 /*
       
     2 * Copyright (c) 2006 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:  AIW service wrapper
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CPHCNTSERVICE_H
       
    19 #define CPHCNTSERVICE_H
       
    20 
       
    21 #include <e32base.h>
       
    22 #include <AiwCommon.h>
       
    23 
       
    24 #include "cphcntasynctosync.h"
       
    25 #include "MPhCntService.h"
       
    26 #include "tphcntaiwserviceobserver.h"
       
    27 
       
    28 class CAiwServiceHandler;
       
    29 class MPhCntServiceObserver;
       
    30 class CAiwGenericParamList;
       
    31 
       
    32 /**
       
    33  *  Wrapper for phonebook's AIW service.
       
    34  *
       
    35  *  @lib PhoneCntFinder.lib
       
    36  *  @since S60 v3.1
       
    37  */
       
    38 NONSHARABLE_CLASS( CPhCntService ):     
       
    39     public CPhCntAsyncToSync, 
       
    40     public MPhCntService,
       
    41     public MPhCntAiwServiceCompleteObserver
       
    42     {
       
    43 public:
       
    44     
       
    45     /**
       
    46      * Static constructor.
       
    47      *
       
    48      * @since S60 v3.1
       
    49      */
       
    50     static CPhCntService* NewL();
       
    51     
       
    52     /**
       
    53      * Destructor.
       
    54      *
       
    55      * @since S60 v3.1
       
    56      */
       
    57     virtual ~CPhCntService();
       
    58 
       
    59 
       
    60 // from base class MPhCntService
       
    61 		
       
    62     /**
       
    63      * From MPhCntService
       
    64      *
       
    65      * @since S60 v3.1
       
    66      * @see MPhCntService
       
    67      */
       
    68     void ExecuteRequestL( 
       
    69         MPhCntServiceRequestParam& aServiceRequestParams, 
       
    70         MPhCntServiceResult& aResult ); 
       
    71 
       
    72 // from base class MPhCntAiwServiceCompleteObserver
       
    73     
       
    74     /**
       
    75      * From MPhCntAiwServiceCompleteObserver.
       
    76      *
       
    77      * Notification that AIW service request is done.
       
    78      *
       
    79      * @since S60 v3.2
       
    80      * @see MPhCntAiwServiceCompleteObserver
       
    81      */
       
    82     void ServiceRequestComplete( TInt aError );
       
    83 
       
    84 protected:
       
    85 
       
    86     /**
       
    87      * Attach AIW criterias
       
    88      */
       
    89 	void AttachCriteriasL();
       
    90 	
       
    91 	/**
       
    92 	 * Cancels request.
       
    93 	 * @return Error code.
       
    94 	 */
       
    95 	TInt CancelRequest();
       
    96 	
       
    97 protected:
       
    98 
       
    99     CPhCntService();
       
   100 
       
   101     void ConstructL();
       
   102     
       
   103     /**
       
   104      * From CPhCntAsyncToSync.
       
   105      *
       
   106      * @since S60 v3.2
       
   107      * @see CPhCntAsyncToSync.    
       
   108      */
       
   109     void DoMakeAsyncRequestL();
       
   110     
       
   111     void SetRequestAndResult( 
       
   112         MPhCntServiceRequestParam& aServiceRequestParams, 
       
   113         MPhCntServiceResult& aResult );
       
   114     
       
   115 protected: // Protected because of unit testing.
       
   116 
       
   117 	/**
       
   118 	 * Result of the request.
       
   119 	 * Now own.
       
   120 	 */
       
   121 	MPhCntServiceResult* iResult;
       
   122 	
       
   123 	/**
       
   124 	 * Request params.
       
   125 	 * Not own.
       
   126 	 */
       
   127 	MPhCntServiceRequestParam* iParams;
       
   128 	
       
   129 private: // data
       
   130 
       
   131     /**
       
   132      * Handle to AIW service
       
   133      * Own. 
       
   134      */
       
   135    	CAiwServiceHandler* iAiwService;
       
   136 	
       
   137 	/**
       
   138 	 * Criteria array.
       
   139 	 * Own.
       
   140 	 */
       
   141 	RCriteriaArray iCriteriaArray;
       
   142 	
       
   143 	/**
       
   144 	 * Options for the command, see TAiwServiceCmdOptions in AiwCommon.hrh.
       
   145 	 */	
       
   146 	TUint iCommandOptions;
       
   147 	
       
   148 	/**
       
   149 	 * Indication for that request has been canceled by client.
       
   150 	 */
       
   151 	TBool* iClientCanceledRequest;
       
   152 	
       
   153 protected:
       
   154 	
       
   155 	/**
       
   156 	 * Observes the AIW service.
       
   157 	 * Protected to ease unit testing.
       
   158 	 */
       
   159 	TPhCntAiwServiceObserver iAiwServiceObserver;
       
   160 
       
   161     };
       
   162 
       
   163 #endif // CPHCNTSERVICE_H