syncmlfw/ds/hostserver/dshostclient/inc/nsmldshostclient.h
changeset 0 b497e44ab2fc
equal deleted inserted replaced
-1:000000000000 0:b497e44ab2fc
       
     1 /*
       
     2 * Copyright (c) 2005 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:  Client module of DS Host Servers
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __NSMLDSHOSTCLIENT_H__ 
       
    20 #define __NSMLDSHOSTCLIENT_H__ 
       
    21 
       
    22 // ------------------------------------------------------------------------------------------------
       
    23 // Includes
       
    24 // ------------------------------------------------------------------------------------------------
       
    25 #include <e32base.h>
       
    26 #include <e32std.h>
       
    27 #include <badesca.h>
       
    28 #include <SyncMLDef.h>
       
    29 #include <SmlDataProvider.h>
       
    30 #include <SyncMLDataFilter.h>
       
    31 
       
    32 #include "nsmldshostclientsession.h"
       
    33 #include "nsmldsdpinformation.h"
       
    34 #include "nsmldsitemmodificationset.h"
       
    35 
       
    36 // ------------------------------------------------------------------------------------------------
       
    37 // Class forwards
       
    38 // ------------------------------------------------------------------------------------------------
       
    39 class RSmlFilter;
       
    40 class RSmlFilterDef;
       
    41 class CNSmlDbCaps;
       
    42 class RNSmlDbItemModificationSet;
       
    43 
       
    44 // ------------------------------------------------------------------------------------------------
       
    45 // client API for DS Host Servers.
       
    46 //
       
    47 //  @lib nsmldshostclient.lib
       
    48 // ------------------------------------------------------------------------------------------------
       
    49 class CNSmlDSHostClient : public CBase
       
    50 	{
       
    51 public:
       
    52 	/**
       
    53 	* Creates new instance of CNSmlDSHostClient based class.
       
    54 	* @return CNSmlDSHostClient*. Newly created instance.
       
    55 	*/
       
    56 	IMPORT_C static CNSmlDSHostClient* NewL();
       
    57 	
       
    58 	/**
       
    59 	* Creates new instance of CNSmlDSHostClient based class.
       
    60 	* @return CNSmlDSHostClient*. Newly created instance that is pushed to cleanup stack.
       
    61 	*/
       
    62 	IMPORT_C static CNSmlDSHostClient* NewLC();
       
    63 	
       
    64 	/**
       
    65 	* C++ Destructor.
       
    66 	*/
       
    67 	IMPORT_C ~CNSmlDSHostClient();
       
    68 	
       
    69 	/**
       
    70 	* Creates Data Providers.
       
    71 	* @param aIds. The array of IDs of Data Providers.
       
    72 	* @param aResultArray. The result for each Data Provider. KErrNone or one of the system wide error codes.
       
    73 	* 		 Order of results must be same as IDs of Data Providers.
       
    74 	*/
       
    75 	IMPORT_C void CreateDataProvidersL( const RArray<TSmlDataProviderId>& aIds, RArray<TInt>& aResultArray );
       
    76 	
       
    77 	/**
       
    78 	* Creates all possible Data Providers.
       
    79 	* @param aIds. At return the array of IDs of Data Providers.
       
    80 	*/
       
    81 	IMPORT_C void CreateAllDataProvidersL( RArray<TSmlDataProviderId>& aIds );
       
    82 	
       
    83 	/**
       
    84 	* fetches information on data provider
       
    85 	* The caller has the responsibility to free all the memory reserved for returned struct.
       
    86 	* @param aId. The ID of Data Provider.
       
    87 	* @param aResultCode. The result of method. KErrNone if everything goes correctly.
       
    88 	* @return TNSmlDPInformation*. Struct filled with fetched information. 
       
    89 	*/
       
    90 	IMPORT_C TNSmlDPInformation* DataProviderInformationL( const TSmlDataProviderId aId, TInt& aResultCode ) const;
       
    91 
       
    92 	/**
       
    93 	* Asks if Data Provider supports some operation.
       
    94 	* @param aOpId. The ID of Operation.
       
    95 	* @param aId. The ID of Data Provider.
       
    96 	* @param aResultCode. The result of method. KErrNone if everything goes correctly.
       
    97 	* @return TBool, ETrue if operation is supported and EFalse if not.
       
    98 	*/
       
    99 	IMPORT_C TBool SupportsOperationL( TUid aOpId, const TSmlDataProviderId aId, TInt& aResultCode ) const;
       
   100 	
       
   101 	/**
       
   102 	* Creates Data Store format of Data Provider.
       
   103 	* @param aId. The ID of Data Provider.
       
   104 	* @param aResultCode. The result of method. KErrNone if everything goes correctly.
       
   105 	* @return CNSmlDbCaps. Store format of Data Provider.
       
   106 	*/
       
   107 	IMPORT_C CNSmlDbCaps* StoreFormatL( const TSmlDataProviderId aId, TInt& aResultCode );
       
   108 	
       
   109 	/**
       
   110 	* Creates list of Data Store names of Data Provider.
       
   111 	* @param aNameList. Return the names of datastores that the Data Provider can open.
       
   112 	* @param aId. The ID of Data Provider.
       
   113 	* @param aResultCode. The result of method. KErrNone if everything goes correctly.
       
   114 	*/
       
   115 	IMPORT_C void ListStoresL( CDesCArray* aNameList, const TSmlDataProviderId aId, TInt& aResultCode );
       
   116 	
       
   117 	/**
       
   118 	* Creates default name for Data Store of Data Provider.
       
   119 	* @param aId. The ID of Data Provider.
       
   120 	* @param aResultCode. The result of method. KErrNone if everything goes correctly.
       
   121 	* @return HBufC*. Contains default Data Store name.
       
   122 	*/
       
   123 	IMPORT_C HBufC* DefaultStoreL( const TSmlDataProviderId aId, TInt& aResultCode );
       
   124 	
       
   125 	/**
       
   126 	* This method returns the set of filters that can be used to send to the Sync Partner.
       
   127 	* @param aId. The ID of Data Provider.
       
   128 	* @param aResultCode. The result of method. KErrNone if everything goes correctly.
       
   129 	* @return RPointerArray<CSyncMLFilter>*. Array, that includes filter.
       
   130 	*/
       
   131 	IMPORT_C RPointerArray<CSyncMLFilter>* SupportedServerFiltersL( const TSmlDataProviderId aId, TSyncMLFilterMatchType& aMatchType, TSyncMLFilterChangeInfo& aChangeInfo, TInt& aResultCode ) const;
       
   132 	
       
   133 	/**
       
   134 	* This method updates dynamic filters up-to-date.
       
   135 	* @param aFilters. The array that includes filters
       
   136 	* @param aChangeInfo. The change information about changes that data provider did
       
   137 	* @param aId. The ID of Data Provider.
       
   138 	* @param aResultCode. The result of method. KErrNone if everything goes correctly.
       
   139 	*/
       
   140 	IMPORT_C void CheckServerFiltersL( const TSmlDataProviderId aId, RPointerArray<CSyncMLFilter>& aFilters, TSyncMLFilterChangeInfo& aChangeInfo, TInt& aResultCode ) const;
       
   141 	
       
   142 	/**
       
   143 	* This method checks what filters are supported by server.
       
   144 	* @param aServerDataStoreFormat. The store format of Sync Partner.
       
   145 	* @param aFilterInfoArr. Array of filter information
       
   146 	* @param aFilters. The array that includes filters
       
   147 	* @param aChangeInfo. The change information about changes that data provider did
       
   148 	* @param aId. The ID of Data Provider.
       
   149 	* @param aResultCode. The result of method. KErrNone if everything goes correctly.
       
   150 	*/
       
   151 	IMPORT_C void CheckSupportedServerFiltersL( const TSmlDataProviderId aId, const CNSmlDbCaps& aServerDataStoreFormat, const CArrayFix<TNSmlFilterCapData>& aFilterInfoArr, RPointerArray<CSyncMLFilter>& aFilters, TSyncMLFilterChangeInfo& aChangeInfo, TInt& aResultCode ) const;
       
   152 
       
   153 	/**
       
   154 	* Get Filters.
       
   155 	* @param aId. The ID of Data Provider.
       
   156 	* @param aFilterArray. The filters to be used for the query generation
       
   157 	* @param aFilter. Results
       
   158 	* @param aMatchType. The filter match type to be used
       
   159 	* @param aResultCode. The result of method. KErrNone if everything goes correctly.
       
   160 	*/	
       
   161 	IMPORT_C void GetFilterL( const TSmlDataProviderId aId, const TDesC& aStoreName, const RPointerArray<CSyncMLFilter>& aFilterArray, CNSmlFilter*& aFilter, TSyncMLFilterMatchType aMatchType, TInt& aResultCode );
       
   162 	
       
   163 	/**
       
   164 	* Opens the data store specified by aStoreName asynchronously.
       
   165 	* @param aContext. Identifies the specific synchronisation relationship to use.
       
   166 	* @param aId. The ID of Data Provider.
       
   167 	* @param aStoreName. The name of the data store that is used.
       
   168 	* @param aResultCode. The result of method. KErrNone if everything goes correctly.
       
   169 	*/
       
   170 	IMPORT_C void OpenL( const TSmlDataProviderId aId, const TDesC& aStoreName, const TDesC& aServerId, const TDesC& aRemoteDB, TInt& aResultCode );
       
   171 			
       
   172 	/**
       
   173 	* Cancel the current asynchronous request.
       
   174 	* @param aId. The ID of Data Provider.
       
   175 	* @param aStoreName. The name of the data store that is used.
       
   176 	* @param aResultCode. The result of method. KErrNone if everything goes correctly.
       
   177 	*/
       
   178 	IMPORT_C void CancelRequestL( const TSmlDataProviderId aId, const TDesC& aStoreName, TInt& aResultCode );
       
   179 	
       
   180 	/**
       
   181 	* Starts the transaction mode.
       
   182 	* @param aId. The ID of Data Provider.
       
   183 	* @param aStoreName. The name of the data store that is used.
       
   184 	* @param aResultCode. The result of method. KErrNone if everything goes correctly.
       
   185 	*/
       
   186 	IMPORT_C void BeginTransactionL( const TSmlDataProviderId aId, const TDesC& aStoreName, TInt& aResultCode );
       
   187 	
       
   188 	/**
       
   189 	* Method will be called at the end of a successful transaction.
       
   190 	* @param aId. The ID of Data Provider.
       
   191 	* @param aStoreName. The name of the data store that is used.
       
   192 	* @param aResultCode. The result of method. KErrNone if everything goes correctly.
       
   193 	*/
       
   194 	IMPORT_C void CommitTransactionL( const TSmlDataProviderId aId, const TDesC& aStoreName, TInt& aResultCode );
       
   195 	
       
   196 	/**
       
   197 	* Method will be called to abort an ongoing transaction.
       
   198 	* @param aId. The ID of Data Provider.
       
   199 	* @param aStoreName. The name of the data store that is used.
       
   200 	* @param aResultCode. The result of method. KErrNone if everything goes correctly.
       
   201 	*/
       
   202 	IMPORT_C void RevertTransactionL( const TSmlDataProviderId aId, const TDesC& aStoreName, TInt& aResultCode );
       
   203 	
       
   204 	/**
       
   205 	* Starts the batch mode.
       
   206 	* @param aId. The ID of Data Provider.
       
   207 	* @param aStoreName. The name of the data store that is used.
       
   208 	* @param aResultCode. The result of method. KErrNone if everything goes correctly.
       
   209 	*/
       
   210 	IMPORT_C void BeginBatchL( const TSmlDataProviderId aId, const TDesC& aStoreName, TInt& aResultCode );
       
   211 	
       
   212 	/**
       
   213 	* Method will be called at the end of the batch mode.
       
   214 	* @param aResultArray is used to store result for each operation
       
   215 	*		 (in the order they were submitted) during batch.
       
   216 	* @param aId. The ID of Data Provider.
       
   217 	* @param aStoreName. The name of the data store that is used.
       
   218 	* @param aResultCode. The result of method. KErrNone if everything goes correctly.
       
   219 	*/
       
   220 	IMPORT_C void CommitBatchL( RArray<TInt>& aResultArray, const TSmlDataProviderId aId, const TDesC& aStoreName, TInt& aResultCode );
       
   221 	
       
   222 	/**
       
   223 	* Method will be called to abort an ongoing batch mode.
       
   224 	* @param aId. The ID of Data Provider.
       
   225 	* @param aStoreName. The name of the data store that is used.
       
   226 	* @param aResultCode. The result of method. KErrNone if everything goes correctly.
       
   227 	*/
       
   228 	IMPORT_C void CancelBatchL( const TSmlDataProviderId aId, const TDesC& aStoreName, TInt& aResultCode );
       
   229 	
       
   230 	/**
       
   231 	* Sets the Sync Partner Data Format
       
   232 	* @param aServerDataStoreFormat. The data store format of Sync Partner.
       
   233 	* @param aId. The ID of Data Provider.
       
   234 	* @param aStoreName. The name of the data store that is used.
       
   235 	* @param aResultCode. The result of method. KErrNone if everything goes correctly.
       
   236 	*/
       
   237 	IMPORT_C void SetRemoteDataStoreFormatL( const CNSmlDbCaps& aServerDataStoreFormat, const TSmlDataProviderId aId, const TDesC& aStoreName, TInt& aResultCode );
       
   238 	
       
   239 	/**
       
   240 	* Sets the SyncML server Sync Partner maximum object size
       
   241 	* @param aServerMaxObjectSize. The maximum object size of Sync Partner.
       
   242 	* @param aId. The ID of Data Provider.
       
   243 	* @param aStoreName. The name of the data store that is used.
       
   244 	* @param aResultCode. The result of method. KErrNone if everything goes correctly.
       
   245 	*/
       
   246 	IMPORT_C void SetRemoteMaxObjectSizeL( TInt aServerMaxObjectSize, const TSmlDataProviderId aId, const TDesC& aStoreName, TInt& aResultCode );
       
   247 	
       
   248 	/**
       
   249 	* Gets the Data Store maximum object size which is reported to the SyncML partner.
       
   250 	* @param aId. The ID of Data Provider.
       
   251 	* @param aStoreName. The name of the data store that is used.
       
   252 	* @return TInt. The maximum object size of Data Store.
       
   253 	* @param aResultCode. The result of method. KErrNone if everything goes correctly.
       
   254 	*/
       
   255 	IMPORT_C TInt MaxObjectSizeL( const TSmlDataProviderId aId, const TDesC& aStoreName, TInt& aResultCode ) const;
       
   256 	
       
   257 	/**
       
   258 	* Opens item at Data Store.
       
   259 	* @param aUid. The UID of item.
       
   260 	* @param aFieldChange. Data Provider change to ETrue if there is only some field changes at item.
       
   261 	* @param aSize. The Data Provider puts the size of item to this parameter.
       
   262 	* @param aParent. Data Provider puts the UID of parent of item to this parameter.
       
   263 	* @param aMimeType. Data Provider puts the mime type of item to this parameter.
       
   264 	* @param aMimeVer. Data Provider puts the mime version of item to this parameter.
       
   265 	* @param aId. The ID of Data Provider.
       
   266 	* @param aStoreName. The name of the data store that is used.
       
   267 	* @param aResultCode. The result of method. KErrNone if everything goes correctly.
       
   268 	*/
       
   269 	IMPORT_C void OpenItemL( TSmlDbItemUid aUid, TBool& aFieldChange, TInt& aSize, TSmlDbItemUid& aParent, HBufC8*& aMimeType, HBufC8*& aMimeVer, const TSmlDataProviderId aId, const TDesC& aStoreName, TInt& aResultCode );
       
   270 	
       
   271 	/**
       
   272 	* Creates new item to Data Store.
       
   273 	* @param aUid. The Data Provider puts the UID of new item to this parameter. It can be also put just after commit method.
       
   274 	* @param aSize. The size of new item.
       
   275 	* @param aParent. The UID of parent of new item.
       
   276 	* @param aMimeType. The mime type of new item.
       
   277 	* @param aMimeVer. The mime version of new item.
       
   278 	* @param aId. The ID of Data Provider.
       
   279 	* @param aStoreName. The name of the data store that is used.
       
   280 	* @param aResultCode. The result of method. KErrNone if everything goes correctly.
       
   281 	*/
       
   282 	IMPORT_C void CreateItemL( TSmlDbItemUid& aUid, TInt aSize, TSmlDbItemUid aParent, const TDesC8& aMimeType, const TDesC8& aMimeVer, const TSmlDataProviderId aId, const TDesC& aStoreName, TInt& aResultCode );
       
   283 	
       
   284 	/**
       
   285 	* Replaces old item at Data Store.
       
   286 	* @param aUid. The UID of item. If item is added to the Data Store then The Data Provider
       
   287 	*		 puts the UID of new item to this parameter. It can be also put just after commit method.
       
   288 	* @param aSize. The size of item.
       
   289 	* @param aParent. The UID of parent of item.
       
   290 	* @param aFieldChange. If this is true then replace is only partial,
       
   291 	* @param aId. The ID of Data Provider.
       
   292 	* @param aStoreName. The name of the data store that is used.
       
   293 	* @param aResultCode. The result of method. KErrNone if everything goes correctly.
       
   294 	*/
       
   295 	IMPORT_C void ReplaceItemL( TSmlDbItemUid aUid, TInt aSize, TSmlDbItemUid aParent, TBool aFieldChange, TSmlDataProviderId aId, const TDesC& aStoreName, TInt& aResultCode );
       
   296 	
       
   297 	/**
       
   298 	* Reads data from item at Data Store. Item must be opened before this method can be called.
       
   299 	* This method is called until aBuffer is not used totally or method leaves with KErrEof.
       
   300 	* @param aBuffer. The Data Provider puts readed data to this parameter,
       
   301 	* @param aId. The ID of Data Provider.
       
   302 	* @param aStoreName. The name of the data store that is used.
       
   303 	* @param aResultCode. The result of method. KErrNone if everything goes correctly.
       
   304 	*/
       
   305 	IMPORT_C void ReadItemL( TDes8& aBuffer, const TSmlDataProviderId aId, const TDesC& aStoreName, TInt& aResultCode );
       
   306 	
       
   307 	/**
       
   308 	* Writes data to item to Data Provider. CreateItemL or ReplaceItemL method must be called before
       
   309 	* this method can be called. This method is called until all data to current item is written.
       
   310 	* @param aData. The data that is written to item at Data Store,
       
   311 	* @param aId. The ID of Data Provider.
       
   312 	* @param aStoreName. The name of the data store that is used.
       
   313 	* @param aResultCode. The result of method. KErrNone if everything goes correctly.
       
   314 	*/
       
   315 	IMPORT_C void WriteItemL( const TDesC8& aData, const TSmlDataProviderId aId, const TDesC& aStoreName, TInt& aResultCode );
       
   316 	
       
   317 	/**
       
   318 	* After item is written to Data Provider it can be saved to the Data Store.
       
   319 	* This method can be called just after WriteItemL method.
       
   320 	* @param aId. The ID of Data Provider.
       
   321 	* @param aStoreName. The name of the data store that is used.
       
   322 	* @param aResultCode. The result of method. KErrNone if everything goes correctly.
       
   323 	*/
       
   324 	IMPORT_C void CommitItemL( const TSmlDataProviderId aId, const TDesC& aStoreName, TInt& aResultCode );
       
   325 	
       
   326 	/**
       
   327 	* Closes opened item.
       
   328 	* This method can be called just if some item is open.
       
   329 	* @param aId. The ID of Data Provider.
       
   330 	* @param aStoreName. The name of the data store that is used.
       
   331 	* @param aResultCode. The result of method. KErrNone if everything goes correctly.
       
   332 	*/
       
   333 	IMPORT_C void CloseItemL( const TSmlDataProviderId aId, const TDesC& aStoreName, TInt& aResultCode );
       
   334 	
       
   335 	/**
       
   336 	* Moves item to new location.
       
   337 	* @param aUid. The UID of item.
       
   338 	* @param aNewParent. The UID of new parent of item.
       
   339 	* @param aId. The ID of Data Provider.
       
   340 	* @param aStoreName. The name of the data store that is used.
       
   341 	* @param aResultCode. The result of method. KErrNone if everything goes correctly.
       
   342 	*/
       
   343 	IMPORT_C void MoveItemL( TSmlDbItemUid aUid, TSmlDbItemUid aNewParent, const TSmlDataProviderId aId, const TDesC& aStoreName, TInt& aResultCode );
       
   344 	
       
   345 	/**
       
   346 	* Deletes one item at Data Store permanently.
       
   347 	* @param aUid. The UID of item.
       
   348 	* @param aId. The ID of Data Provider.
       
   349 	* @param aStoreName. The name of the data store that is used.
       
   350 	* @param aResultCode. The result of method. KErrNone if everything goes correctly.
       
   351 	*/
       
   352 	IMPORT_C void DeleteItemL( TSmlDbItemUid aUid, const TSmlDataProviderId aId, const TDesC& aStoreName, TInt& aResultCode );
       
   353 	
       
   354 	/**
       
   355 	* Soft deletes one item at Data Store.
       
   356 	* @param aUid. The UID of item.
       
   357 	* @param aId. The ID of Data Provider.
       
   358 	* @param aStoreName. The name of the data store that is used.
       
   359 	* @param aResultCode. The result of method. KErrNone if everything goes correctly.
       
   360 	*/
       
   361 	IMPORT_C void SoftDeleteItemL( TSmlDbItemUid aUid, const TSmlDataProviderId aId, const TDesC& aStoreName, TInt& aResultCode );
       
   362 	
       
   363 	/**
       
   364 	* Deletes all items at Data Store permanently.
       
   365 	* @param aId. The ID of Data Provider.
       
   366 	* @param aStoreName. The name of the data store that is used.
       
   367 	* @param aResultCode. The result of method. KErrNone if everything goes correctly.
       
   368 	*/
       
   369 	IMPORT_C void DeleteAllItemsL( const TSmlDataProviderId aId, const TDesC& aStoreName, TInt& aResultCode );
       
   370 	
       
   371 	/**
       
   372 	* Checks if the Data Store has sync history. If not then slow sync is proposed to Sync Partner.
       
   373 	* @param aId. The ID of Data Provider.
       
   374 	* @param aStoreName. The name of the data store that is used.
       
   375 	* @param aResultCode. The result of method. KErrNone if everything goes correctly.
       
   376 	* @return TBool. ETrue, if the data store has sync history, EFalse otherwise.
       
   377 	*/
       
   378 	IMPORT_C TBool HasSyncHistoryL( const TSmlDataProviderId aId, const TDesC& aStoreName, TInt& aResultCode ) const;
       
   379 	
       
   380 	/**
       
   381 	* The Data Provider returns UIDs of items that are added after previous synchronization.
       
   382 	* If the Data Provider uses hierarchical synchronization then added folders must be placed
       
   383 	* first (from root to leaves) to UID set and finally items.
       
   384 	* @param aUidSet. The set of added items.
       
   385 	* @param aId. The ID of Data Provider.
       
   386 	* @param aStoreName. The name of the data store that is used.
       
   387 	* @param aResultCode. The result of method. KErrNone if everything goes correctly.
       
   388 	*/
       
   389 	IMPORT_C void AddedItemsL( RNSmlDbItemModificationSet& aUidSet, const TSmlDataProviderId aId, const TDesC& aStoreName, TInt& aResultCode ) const;
       
   390 	
       
   391 	/**
       
   392 	* The Data Provider returns UIDs of items that are deleted after previous synchronization.
       
   393 	* If the Data Provider uses hierarchical synchronization then deleted items must be placed
       
   394 	* first to UID set and folders after items (from leaves to root).
       
   395 	* @param aUidSet. The set of deleted items.
       
   396 	* @param aId. The ID of Data Provider.
       
   397 	* @param aStoreName. The name of the data store that is used.
       
   398 	* @param aResultCode. The result of method. KErrNone if everything goes correctly.
       
   399 	*/
       
   400 	IMPORT_C void DeletedItemsL( RNSmlDbItemModificationSet& aUidSet, const TSmlDataProviderId aId, const TDesC& aStoreName, TInt& aResultCode ) const;
       
   401 	
       
   402 	/**
       
   403 	* The Data Provider returns UIDs of items that are soft deleted after previous synchronization.
       
   404 	* If the Data Provider uses hierarchical synchronization then soft deleted items must be placed
       
   405 	* first to UID set and folders after items (from leaves to root).
       
   406 	* @param aUidSet. The set of soft deleted items.
       
   407 	* @param aId. The ID of Data Provider.
       
   408 	* @param aStoreName. The name of the data store that is used.
       
   409 	* @param aResultCode. The result of method. KErrNone if everything goes correctly.
       
   410 	*/
       
   411 	IMPORT_C void SoftDeleteItemsL( RNSmlDbItemModificationSet& aUidSet, const TSmlDataProviderId aId, const TDesC& aStoreName, TInt& aResultCode ) const;
       
   412 	
       
   413 	/**
       
   414 	* The Data Provider returns UIDs of items that are modified after previous synchronization.
       
   415 	* If the Data Provider uses hierarchical synchronization then modified folders must be placed
       
   416 	* first (from root to leaves) to UID set and finally items.
       
   417 	* @param aUidSet. The set of modified items.
       
   418 	* @param aId. The ID of Data Provider.
       
   419 	* @param aStoreName. The name of the data store that is used.
       
   420 	* @param aResultCode. The result of method. KErrNone if everything goes correctly.
       
   421 	*/
       
   422 	IMPORT_C void ModifiedItemsL( RNSmlDbItemModificationSet& aUidSet, const TSmlDataProviderId aId, const TDesC& aStoreName, TInt& aResultCode ) const;
       
   423 	
       
   424 	/**
       
   425 	* The Data Provider returns UIDs of items that are moved after previous synchronization.
       
   426 	* If the Data Provider uses hierarchical synchronization then moved folders must be placed
       
   427 	* first (from root to leaves) to UID set and finally items.
       
   428 	* @param aUidSet. The set of moved items.
       
   429 	* @param aId. The ID of Data Provider.
       
   430 	* @param aStoreName. The name of the data store that is used.
       
   431 	* @param aResultCode. The result of method. KErrNone if everything goes correctly.
       
   432 	*/
       
   433 	IMPORT_C void MovedItemsL( RNSmlDbItemModificationSet& aUidSet, const TSmlDataProviderId aId, const TDesC& aStoreName, TInt& aResultCode ) const;
       
   434 	
       
   435 	/**
       
   436 	* The Data Provider returns UIDs of items that are added, deleted, modified, softdeleted or moved after previous synchronization.
       
   437 	* @param aUidSet. The set of items.
       
   438 	* @param aId. The ID of Data Provider.
       
   439 	* @param aStoreName. The name of the data store that is used.
       
   440 	* @param aResultCode. The result of method. KErrNone if everything goes correctly.
       
   441 	*/
       
   442 	IMPORT_C void AllItemsL( RNSmlDbItemModificationSet& aUidSet, const TSmlDataProviderId aId, const TDesC& aStoreName, TInt& aResultCode ) const;
       
   443 	
       
   444 	/**
       
   445 	* Reset change info from the Data Provider. The following synchronization will be slow sync.
       
   446 	* @param aId. The ID of Data Provider.
       
   447 	* @param aStoreName. The name of the data store that is used.
       
   448 	* @param aResultCode. The result of method. KErrNone if everything goes correctly.
       
   449 	*/
       
   450 	IMPORT_C void ResetChangeInfoL( const TSmlDataProviderId aId, const TDesC& aStoreName, TInt& aResultCode );
       
   451 	
       
   452 	/**
       
   453 	* This method is called after some changes are synchronized to Sync Partner. If some changes
       
   454 	* were synchronized correctly then those UIDs are included to aItems.
       
   455 	* @param aItems. The UIDs of items that were correctly synchronized to Sync Partner.
       
   456 	* @param aId. The ID of Data Provider.
       
   457 	* @param aStoreName. The name of the data store that is used.
       
   458 	* @param aResultCode. The result of method. KErrNone if everything goes correctly.
       
   459 	*/
       
   460 	IMPORT_C void CommitChangeInfoL( const MSmlDataItemUidSet& aItems, const TSmlDataProviderId aId, const TDesC& aStoreName, TInt& aResultCode );
       
   461 	
       
   462 	/**
       
   463 	* This method is called after some changes are synchronized to Sync Partner. This method is used if
       
   464 	* all changes were synchronized correctly.
       
   465 	* @param aId. The ID of Data Provider.
       
   466 	* @param aStoreName. The name of the data store that is used.
       
   467 	* @param aResultCode. The result of method. KErrNone if everything goes correctly.
       
   468 	*/
       
   469 	IMPORT_C void CommitChangeInfoL( const TSmlDataProviderId aId, const TDesC& aStoreName, TInt& aResultCode );
       
   470 	
       
   471 	/**
       
   472 	* Replaces the give old server ID with new one.
       
   473     * @param aOldServerId Old remote server ID.
       
   474 	* @param aNewValue New remote server ID.
       
   475 	*/
       
   476 	IMPORT_C void UpdateServerIdL( TDesC& aOldServerId, TDesC& aNewValue, TInt& aResultCode  );
       
   477 	
       
   478 private:
       
   479 	/**
       
   480 	* C++ constructor.
       
   481 	*/	
       
   482 	CNSmlDSHostClient();
       
   483 	
       
   484 	/**
       
   485 	* ConstrucL
       
   486 	*/	
       
   487 	void ConstructL();
       
   488 	
       
   489 	/**
       
   490 	* Return session to correct server that has current Data Provider.
       
   491 	* @param aId. The ID of the Data Provider.
       
   492 	* @return RNSmlDSHostClient, Session to correct server.
       
   493 	*/
       
   494 	TInt SessionForDataProvider( const TSmlDataProviderId aId ) const;
       
   495 	
       
   496 	/**
       
   497 	* converts host error code to general error.
       
   498 	* @param aStatusFromHost. Status code from host.
       
   499 	* @return general error.
       
   500 	*/
       
   501 	static TInt HostErrorConversion( TInt aStatusFromHost );
       
   502 
       
   503 private:
       
   504 	RArray<TSmlDataProviderId> iDataProviders1;	// Data Providers that are at Host Server 1
       
   505 	RArray<TSmlDataProviderId> iDataProviders2;	// Data Providers that are at Host Server 2
       
   506 	RNSmlDSHostClient iClient1;					// Session to Host Server 1
       
   507 	RNSmlDSHostClient iClient2;					// Session to Host Server 2
       
   508 	};
       
   509 	
       
   510 #endif // __NSMLDSHOSTCLIENT_H__
       
   511 
       
   512 // End of File