williamr@4: /* williamr@4: * Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). williamr@4: * All rights reserved. williamr@4: * This component and the accompanying materials are made available williamr@4: * under the terms of "Eclipse Public License v1.0" williamr@4: * which accompanies this distribution, and is available williamr@4: * at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@4: * williamr@4: * Initial Contributors: williamr@4: * Nokia Corporation - initial contribution. williamr@4: * williamr@4: * Contributors: williamr@4: * williamr@4: * Description: For adding content to be synchronized. williamr@4: * williamr@4: */ williamr@4: williamr@4: #ifndef __SMLDATASYNCDEFS_H__ williamr@4: #define __SMLDATASYNCDEFS_H__ williamr@4: // williamr@4: #include williamr@4: // williamr@4: class RReadStream; williamr@4: class RWriteStream; williamr@4: // williamr@4: williamr@4: /** williamr@4: TSmlDbItemUid is the unique ID of an item in a data store williamr@4: williamr@4: @publishedPartner williamr@4: @released williamr@4: */ williamr@4: typedef TInt TSmlDbItemUid; williamr@4: williamr@4: /** williamr@4: KNullDataItemId is a null value of a Data Item ID, no item may have this ID. williamr@4: williamr@4: @publishedPartner williamr@4: @released williamr@4: */ williamr@4: const TSmlDbItemUid KNullDataItemId = KMinTInt; williamr@4: williamr@4: /** williamr@4: TSmlSyncTaskKey uniquely identifies a sync relationship between a local and remote data store. williamr@4: It should be used by Data Providers to resolve change information for a sync. williamr@4: williamr@4: @publishedPartner williamr@4: @released williamr@4: */ williamr@4: typedef TUint32 TSmlSyncTaskKey; williamr@4: williamr@4: williamr@4: class MSmlSyncRelationship williamr@4: /** williamr@4: SyncML store interface exposed to Database Adaptor implementations. williamr@4: This interface may be used by a DBA to store change information for a Data Store, in the context williamr@4: of a sync relationship with a remote Data Store. williamr@4: It is vital for correct synchronisation behaviour that change information is stored separately for williamr@4: different remote Data Stores. This interface facilitates this by providing streams that are stored williamr@4: against specific Sync Tasks, and a unique key that identifies the sync relationship. williamr@4: williamr@4: @publishedPartner williamr@4: @released williamr@4: */ williamr@4: { williamr@4: public: williamr@4: /** williamr@4: Returns the unique identifier for the synchronisation relationship. williamr@4: williamr@4: @return A unique identifier for the sync relationship. williamr@4: */ williamr@4: virtual TSmlSyncTaskKey SyncTaskKey() const = 0; williamr@4: /** williamr@4: Opens a specified stream for reading, and places an item on the cleanup stack to close it. williamr@4: williamr@4: @param aReadStream On return, an open read stream williamr@4: @param aStreamUid The UID of the stream to open for reading. williamr@4: */ williamr@4: virtual void OpenReadStreamLC(RReadStream& aReadStream, TUid aStreamUid) = 0; williamr@4: /** williamr@4: Opens the specified stream, or creates a new one if it does not exist, and places an item on the cleanup stack to close it. williamr@4: williamr@4: @param aWriteStream On return, an open write stream williamr@4: @param aStreamUid The UID of the stream to open or create williamr@4: */ williamr@4: virtual void OpenWriteStreamLC(RWriteStream& aWriteStream, TUid aStreamUid) = 0; williamr@4: /** williamr@4: Tests if the specified stream identified exists in the store. williamr@4: williamr@4: @param aStreamUid The stream UID williamr@4: @return Non-zero if the stream exists, otherwise EFalse. williamr@4: */ williamr@4: virtual TBool IsStreamPresentL(TUid aStreamUid) const = 0 ; williamr@4: }; williamr@4: williamr@4: williamr@4: williamr@4: williamr@4: williamr@4: /////////////////////////////////////////////////////////////////////////////// williamr@4: /////////////////////////////////////////////////////////////////////////////// williamr@4: /////////////////////////////////////////////////////////////////////////////// williamr@4: #endif