CSmlDataStore Class Reference

class CSmlDataStore : public CBase

Data Store interface.

Inherits from

Public Member Functions
IMPORT_C const MSmlDataItemUidSet & AddedItems ()
IMPORT_C void BeginBatchL ()
IMPORT_C void BeginTransactionL ()
IMPORT_C void CancelBatch ()
IMPORT_C void CancelRequest ()
IMPORT_C void CloseItem ()
IMPORT_C void CommitBatchL ( RArray < TInt > &, TRequestStatus &)
IMPORT_C void CommitChangeInfoL ( TRequestStatus &, const MSmlDataItemUidSet &)
IMPORT_C void CommitChangeInfoL ( TRequestStatus &)
IMPORT_C void CommitItemL ( TRequestStatus &)
IMPORT_C void CommitTransactionL ( TRequestStatus &)
IMPORT_C void CreateItemL ( TSmlDbItemUid &, TInt , TSmlDbItemUid , const TDesC8 &, const TDesC8 &, TRequestStatus &)
IMPORT_C void DeleteAllItemsL ( TRequestStatus &)
IMPORT_C void DeleteItemL ( TSmlDbItemUid , TRequestStatus &)
IMPORT_C const MSmlDataItemUidSet & DeletedItems ()
IMPORT_C TBool HasSyncHistory ()
IMPORT_C TInt MaxObjectSize ()
IMPORT_C const MSmlDataItemUidSet & ModifiedItems ()
IMPORT_C void MoveItemL ( TSmlDbItemUid , TSmlDbItemUid , TRequestStatus &)
IMPORT_C const MSmlDataItemUidSet & MovedItems ()
IMPORT_C void OpenItemL ( TSmlDbItemUid , TBool &, TInt &, TSmlDbItemUid &, TDes8 &, TDes8 &, TRequestStatus &)
IMPORT_C void OpenL (const TDesC &, MSmlSyncRelationship &, TRequestStatus &)
IMPORT_C void ReadItemL ( TDes8 &)
IMPORT_C void ReplaceItemL ( TSmlDbItemUid , TInt , TSmlDbItemUid , TBool , TRequestStatus &)
IMPORT_C void ResetChangeInfoL ( TRequestStatus &)
IMPORT_C void RevertTransaction ( TRequestStatus &)
IMPORT_C void SetRemoteMaxObjectSize ( TInt )
IMPORT_C void SetRemoteStoreFormatL (const CSmlDataStoreFormat &)
IMPORT_C void SoftDeleteItemL ( TSmlDbItemUid , TRequestStatus &)
IMPORT_C const MSmlDataItemUidSet & SoftDeletedItems ()
IMPORT_C const TDesC & StoreName ()
IMPORT_C void WriteItemL (const TDesC8 &)
Protected Member Functions
const MSmlDataItemUidSet & DoAddedItems ()
void DoBeginBatchL ()
void DoBeginTransactionL ()
void DoCancelBatch ()
void DoCancelRequest ()
void DoCloseItem ()
void DoCommitBatchL ( RArray < TInt > &, TRequestStatus &)
void DoCommitChangeInfoL ( TRequestStatus &, const MSmlDataItemUidSet &)
void DoCommitChangeInfoL ( TRequestStatus &)
void DoCommitItemL ( TRequestStatus &)
void DoCommitTransactionL ( TRequestStatus &)
void DoCreateItemL ( TSmlDbItemUid &, TInt , TSmlDbItemUid , const TDesC8 &, const TDesC8 &, TRequestStatus &)
void DoDeleteAllItemsL ( TRequestStatus &)
void DoDeleteItemL ( TSmlDbItemUid , TRequestStatus &)
const MSmlDataItemUidSet & DoDeletedItems ()
TBool DoHasSyncHistory ()
TInt DoMaxObjectSize ()
const MSmlDataItemUidSet & DoModifiedItems ()
void DoMoveItemL ( TSmlDbItemUid , TSmlDbItemUid , TRequestStatus &)
const MSmlDataItemUidSet & DoMovedItems ()
void DoOpenItemL ( TSmlDbItemUid , TBool &, TInt &, TSmlDbItemUid &, TDes8 &, TDes8 &, TRequestStatus &)
void DoOpenL (const TDesC &, MSmlSyncRelationship &, TRequestStatus &)
void DoReadItemL ( TDes8 &)
void DoReplaceItemL ( TSmlDbItemUid , TInt , TSmlDbItemUid , TBool , TRequestStatus &)
void DoResetChangeInfoL ( TRequestStatus &)
void DoRevertTransaction ( TRequestStatus &)
void DoSetRemoteMaxObjectSize ( TInt )
void DoSetRemoteStoreFormatL (const CSmlDataStoreFormat &)
void DoSoftDeleteItemL ( TSmlDbItemUid , TRequestStatus &)
const MSmlDataItemUidSet & DoSoftDeletedItems ()
const TDesC & DoStoreName ()
void DoWriteItemL (const TDesC8 &)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()

Member Functions Documentation

AddedItems()

IMPORT_C const MSmlDataItemUidSet & AddedItems ( ) const

BeginBatchL()

IMPORT_C void BeginBatchL ( )

BeginBatchL() starts the batch mode. During this mode calls to CreateItemL, ReplaceItemL, WriteItemL, CommitItemL, MoveItemL, DeleteItemL and SoftDeleteItemL will be part of this batch. Their RequestStatus must be completed with KErrNone, which only signals acceptance of the operation for batch processing.

BeginTransactionL()

IMPORT_C void BeginTransactionL ( )

BeginTransactionL() starts the transaction mode. During this mode calls to CreateItemL, ReplaceItemL, WriteItemL, CommitItemL, MoveItemL, DeleteItemL and SoftDeleteItemL will be part of this transaction. Their RequestStatus must be completed, even if the change is not yet really executed in the Data Store. If a RequestStatus is completed with an error code, the transaction has failed and a rollback must be done. In this case RevertTransaction will be called.

CancelBatch()

IMPORT_C void CancelBatch ( )

CancelBatch() will be called to abort an ongoing batch mode. None of the operations already submitted may be applied to the Data Store.

CancelRequest()

IMPORT_C void CancelRequest ( )

Cancel the current asynchronous request, including open. Only one asynchronous request may be outstanding at any one time.

CloseItem()

IMPORT_C void CloseItem ( )

CommitBatchL(RArray< TInt > &, TRequestStatus &)

IMPORT_C void CommitBatchL ( RArray < TInt > & aResultArray,
TRequestStatus & aStatus
)

CommitBatchL() will be called at the end of the batch mode. This tells the Data Store to process the batched operations (in the order they were submitted), and to append the error code for each operation to aResultArray. The error codes in aResultArray are only valid if the RequestStatus is completed with KErrNone. If the RequestStatus is completed with an error code none of the operations in the batch mode were applied to the Data Store.

Parameters

RArray < TInt > & aResultArray
TRequestStatus & aStatus

CommitChangeInfoL(TRequestStatus &, const MSmlDataItemUidSet &)

IMPORT_C void CommitChangeInfoL ( TRequestStatus & aStatus,
const MSmlDataItemUidSet & aItems
)

Parameters

TRequestStatus & aStatus
const MSmlDataItemUidSet & aItems

CommitChangeInfoL(TRequestStatus &)

IMPORT_C void CommitChangeInfoL ( TRequestStatus & aStatus )

Parameters

TRequestStatus & aStatus

CommitItemL(TRequestStatus &)

IMPORT_C void CommitItemL ( TRequestStatus & aStatus )

Parameters

TRequestStatus & aStatus

CommitTransactionL(TRequestStatus &)

IMPORT_C void CommitTransactionL ( TRequestStatus & aStatus )

CommitTransactionL() will be called at the end of a successful transaction. At this point in time the operations within the transaction are applied to the Data Store in an atomic way. If all operations succeed, the RequestStatus must be completed with KErrNone. If an operation fails, a rollback must be done and the RequestStatus must be completed with an appropriate error code.

Parameters

TRequestStatus & aStatus

CreateItemL(TSmlDbItemUid &, TInt, TSmlDbItemUid, const TDesC8 &, const TDesC8 &, TRequestStatus &)

IMPORT_C void CreateItemL ( TSmlDbItemUid & aUid,
TInt aSize,
TSmlDbItemUid aParent,
const TDesC8 & aMimeType,
const TDesC8 & aMimeVer,
TRequestStatus & aStatus
)

Parameters

TSmlDbItemUid & aUid
TInt aSize
TSmlDbItemUid aParent
const TDesC8 & aMimeType
const TDesC8 & aMimeVer
TRequestStatus & aStatus

DeleteAllItemsL(TRequestStatus &)

IMPORT_C void DeleteAllItemsL ( TRequestStatus & aStatus )

Parameters

TRequestStatus & aStatus

DeleteItemL(TSmlDbItemUid, TRequestStatus &)

IMPORT_C void DeleteItemL ( TSmlDbItemUid aUid,
TRequestStatus & aStatus
)

Parameters

TSmlDbItemUid aUid
TRequestStatus & aStatus

DeletedItems()

IMPORT_C const MSmlDataItemUidSet & DeletedItems ( ) const

DoAddedItems()

const MSmlDataItemUidSet & DoAddedItems ( ) const [protected, pure virtual]

DoBeginBatchL()

void DoBeginBatchL ( ) [protected, pure virtual]

DoBeginTransactionL()

void DoBeginTransactionL ( ) [protected, pure virtual]

DoCancelBatch()

void DoCancelBatch ( ) [protected, pure virtual]

DoCancelRequest()

void DoCancelRequest ( ) [protected, pure virtual]

DoCloseItem()

void DoCloseItem ( ) [protected, pure virtual]

DoCommitBatchL(RArray< TInt > &, TRequestStatus &)

void DoCommitBatchL ( RArray < TInt > & aResultArray,
TRequestStatus & aStatus
) [protected, pure virtual]

Parameters

RArray < TInt > & aResultArray
TRequestStatus & aStatus

DoCommitChangeInfoL(TRequestStatus &, const MSmlDataItemUidSet &)

void DoCommitChangeInfoL ( TRequestStatus & aStatus,
const MSmlDataItemUidSet & aItems
) [protected, pure virtual]

Parameters

TRequestStatus & aStatus
const MSmlDataItemUidSet & aItems

DoCommitChangeInfoL(TRequestStatus &)

void DoCommitChangeInfoL ( TRequestStatus & aStatus ) [protected, pure virtual]

Parameters

TRequestStatus & aStatus

DoCommitItemL(TRequestStatus &)

void DoCommitItemL ( TRequestStatus & aStatus ) [protected, pure virtual]

Parameters

TRequestStatus & aStatus

DoCommitTransactionL(TRequestStatus &)

void DoCommitTransactionL ( TRequestStatus & aStatus ) [protected, pure virtual]

Parameters

TRequestStatus & aStatus

DoCreateItemL(TSmlDbItemUid &, TInt, TSmlDbItemUid, const TDesC8 &, const TDesC8 &, TRequestStatus &)

void DoCreateItemL ( TSmlDbItemUid & aUid,
TInt aSize,
TSmlDbItemUid aParent,
const TDesC8 & aMimeType,
const TDesC8 & aMimeVer,
TRequestStatus & aStatus
) [protected, pure virtual]

Parameters

TSmlDbItemUid & aUid
TInt aSize
TSmlDbItemUid aParent
const TDesC8 & aMimeType
const TDesC8 & aMimeVer
TRequestStatus & aStatus

DoDeleteAllItemsL(TRequestStatus &)

void DoDeleteAllItemsL ( TRequestStatus & aStatus ) [protected, pure virtual]

Parameters

TRequestStatus & aStatus

DoDeleteItemL(TSmlDbItemUid, TRequestStatus &)

void DoDeleteItemL ( TSmlDbItemUid aUid,
TRequestStatus & aStatus
) [protected, pure virtual]

Parameters

TSmlDbItemUid aUid
TRequestStatus & aStatus

DoDeletedItems()

const MSmlDataItemUidSet & DoDeletedItems ( ) const [protected, pure virtual]

DoHasSyncHistory()

TBool DoHasSyncHistory ( ) const [protected, pure virtual]

DoMaxObjectSize()

TInt DoMaxObjectSize ( ) const [protected, pure virtual]

DoModifiedItems()

const MSmlDataItemUidSet & DoModifiedItems ( ) const [protected, pure virtual]

DoMoveItemL(TSmlDbItemUid, TSmlDbItemUid, TRequestStatus &)

void DoMoveItemL ( TSmlDbItemUid aUid,
TSmlDbItemUid aNewParent,
TRequestStatus & aStatus
) [protected, pure virtual]

Parameters

TSmlDbItemUid aUid
TSmlDbItemUid aNewParent
TRequestStatus & aStatus

DoMovedItems()

const MSmlDataItemUidSet & DoMovedItems ( ) const [protected, pure virtual]

DoOpenItemL(TSmlDbItemUid, TBool &, TInt &, TSmlDbItemUid &, TDes8 &, TDes8 &, TRequestStatus &)

void DoOpenItemL ( TSmlDbItemUid aUid,
TBool & aFieldChange,
TInt & aSize,
TSmlDbItemUid & aParent,
TDes8 & aMimeType,
TDes8 & aMimeVer,
TRequestStatus & aStatus
) [protected, pure virtual]

Parameters

TSmlDbItemUid aUid
TBool & aFieldChange
TInt & aSize
TSmlDbItemUid & aParent
TDes8 & aMimeType
TDes8 & aMimeVer
TRequestStatus & aStatus

DoOpenL(const TDesC &, MSmlSyncRelationship &, TRequestStatus &)

void DoOpenL ( const TDesC & aStoreName,
MSmlSyncRelationship & aContext,
TRequestStatus & aStatus
) [protected, pure virtual]

Parameters

const TDesC & aStoreName
MSmlSyncRelationship & aContext
TRequestStatus & aStatus

DoReadItemL(TDes8 &)

void DoReadItemL ( TDes8 & aBuffer ) [protected, pure virtual]

Parameters

TDes8 & aBuffer

DoReplaceItemL(TSmlDbItemUid, TInt, TSmlDbItemUid, TBool, TRequestStatus &)

void DoReplaceItemL ( TSmlDbItemUid aUid,
TInt aSize,
TSmlDbItemUid aParent,
TBool aFieldChange,
TRequestStatus & aStatus
) [protected, pure virtual]

Parameters

TSmlDbItemUid aUid
TInt aSize
TSmlDbItemUid aParent
TBool aFieldChange
TRequestStatus & aStatus

DoResetChangeInfoL(TRequestStatus &)

void DoResetChangeInfoL ( TRequestStatus & aStatus ) [protected, pure virtual]

Parameters

TRequestStatus & aStatus

DoRevertTransaction(TRequestStatus &)

void DoRevertTransaction ( TRequestStatus & aStatus ) [protected, pure virtual]

Parameters

TRequestStatus & aStatus

DoSetRemoteMaxObjectSize(TInt)

void DoSetRemoteMaxObjectSize ( TInt aServerMaxObjectSize ) [protected, pure virtual]

Parameters

TInt aServerMaxObjectSize

DoSetRemoteStoreFormatL(const CSmlDataStoreFormat &)

void DoSetRemoteStoreFormatL ( const CSmlDataStoreFormat & aServerDataStoreFormat ) [protected, pure virtual]

Parameters

const CSmlDataStoreFormat & aServerDataStoreFormat

DoSoftDeleteItemL(TSmlDbItemUid, TRequestStatus &)

void DoSoftDeleteItemL ( TSmlDbItemUid aUid,
TRequestStatus & aStatus
) [protected, pure virtual]

Parameters

TSmlDbItemUid aUid
TRequestStatus & aStatus

DoSoftDeletedItems()

const MSmlDataItemUidSet & DoSoftDeletedItems ( ) const [protected, pure virtual]

DoStoreName()

const TDesC & DoStoreName ( ) const [protected, pure virtual]

DoWriteItemL(const TDesC8 &)

void DoWriteItemL ( const TDesC8 & aData ) [protected, pure virtual]

Parameters

const TDesC8 & aData

HasSyncHistory()

IMPORT_C TBool HasSyncHistory ( ) const

MaxObjectSize()

IMPORT_C TInt MaxObjectSize ( ) const

Gets the Data Store maximum object size which is reported to the SyncML server. 0 means there is no limit.

ModifiedItems()

IMPORT_C const MSmlDataItemUidSet & ModifiedItems ( ) const

MoveItemL(TSmlDbItemUid, TSmlDbItemUid, TRequestStatus &)

IMPORT_C void MoveItemL ( TSmlDbItemUid aUid,
TSmlDbItemUid aNewParent,
TRequestStatus & aStatus
)

Parameters

TSmlDbItemUid aUid
TSmlDbItemUid aNewParent
TRequestStatus & aStatus

MovedItems()

IMPORT_C const MSmlDataItemUidSet & MovedItems ( ) const

OpenItemL(TSmlDbItemUid, TBool &, TInt &, TSmlDbItemUid &, TDes8 &, TDes8 &, TRequestStatus &)

IMPORT_C void OpenItemL ( TSmlDbItemUid aUid,
TBool & aFieldChange,
TInt & aSize,
TSmlDbItemUid & aParent,
TDes8 & aMimeType,
TDes8 & aMimeVer,
TRequestStatus & aStatus
)

Parameters

TSmlDbItemUid aUid
TBool & aFieldChange
TInt & aSize
TSmlDbItemUid & aParent
TDes8 & aMimeType
TDes8 & aMimeVer
TRequestStatus & aStatus

OpenL(const TDesC &, MSmlSyncRelationship &, TRequestStatus &)

IMPORT_C void OpenL ( const TDesC & aStoreName,
MSmlSyncRelationship & aContext,
TRequestStatus & aStatus
)

Opens the data store specified by aStoreName asynchronously.

Parameters

const TDesC & aStoreName The name of the data store to open.
MSmlSyncRelationship & aContext Identifies the specific synchronisation relationship to use for the synchronisation.
TRequestStatus & aStatus On completion of the open, contains the result code.

ReadItemL(TDes8 &)

IMPORT_C void ReadItemL ( TDes8 & aBuffer )

Parameters

TDes8 & aBuffer

ReplaceItemL(TSmlDbItemUid, TInt, TSmlDbItemUid, TBool, TRequestStatus &)

IMPORT_C void ReplaceItemL ( TSmlDbItemUid aUid,
TInt aSize,
TSmlDbItemUid aParent,
TBool aFieldChange,
TRequestStatus & aStatus
)

Parameters

TSmlDbItemUid aUid
TInt aSize
TSmlDbItemUid aParent
TBool aFieldChange
TRequestStatus & aStatus

ResetChangeInfoL(TRequestStatus &)

IMPORT_C void ResetChangeInfoL ( TRequestStatus & aStatus )

Parameters

TRequestStatus & aStatus

RevertTransaction(TRequestStatus &)

IMPORT_C void RevertTransaction ( TRequestStatus & aStatus )

RevertTransaction() will be called to abort an ongoing transaction. None of the operations already submitted may be applied to the Data Store. The RequestStatus must be completed with KErrNone as a revert cannot fail.

Parameters

TRequestStatus & aStatus

SetRemoteMaxObjectSize(TInt)

IMPORT_C void SetRemoteMaxObjectSize ( TInt aServerMaxObjectSize )

Sets the SyncML server maximum object size - this may optionally be used by the Data Provider to not send items to the server exceeding its maximum size. 0 means there is no limit.

Parameters

TInt aServerMaxObjectSize

SetRemoteStoreFormatL(const CSmlDataStoreFormat &)

IMPORT_C void SetRemoteStoreFormatL ( const CSmlDataStoreFormat & aServerDataStoreFormat )

Sets the SyncML server Data Format - this may optionally be used by the Data Provider to filter out properties that the server does not support, and should be used to avoid deleting these properties in case the server sends a changed item to the Data Provider

Parameters

const CSmlDataStoreFormat & aServerDataStoreFormat

SoftDeleteItemL(TSmlDbItemUid, TRequestStatus &)

IMPORT_C void SoftDeleteItemL ( TSmlDbItemUid aUid,
TRequestStatus & aStatus
)

Parameters

TSmlDbItemUid aUid
TRequestStatus & aStatus

SoftDeletedItems()

IMPORT_C const MSmlDataItemUidSet & SoftDeletedItems ( ) const

StoreName()

IMPORT_C const TDesC & StoreName ( ) const

Returns the name of the open data store.

WriteItemL(const TDesC8 &)

IMPORT_C void WriteItemL ( const TDesC8 & aData )

Parameters

const TDesC8 & aData