CSmlDataStore Class Reference

class CSmlDataStore : public CBase

Data Store interface.

Inherits from

Public Member Functions
IMPORT_C const MSmlDataItemUidSet &AddedItems()
IMPORT_C voidBeginBatchL()
IMPORT_C voidBeginTransactionL()
IMPORT_C voidCancelBatch()
IMPORT_C voidCancelRequest()
IMPORT_C voidCloseItem()
IMPORT_C voidCommitBatchL(RArray< TInt > &, TRequestStatus &)
IMPORT_C voidCommitChangeInfoL(TRequestStatus &, const MSmlDataItemUidSet &)
IMPORT_C voidCommitChangeInfoL(TRequestStatus &)
IMPORT_C voidCommitItemL(TRequestStatus &)
IMPORT_C voidCommitTransactionL(TRequestStatus &)
IMPORT_C voidCreateItemL(TSmlDbItemUid &, TInt, TSmlDbItemUid, const TDesC8 &, const TDesC8 &, TRequestStatus &)
IMPORT_C voidDeleteAllItemsL(TRequestStatus &)
IMPORT_C voidDeleteItemL(TSmlDbItemUid, TRequestStatus &)
IMPORT_C const MSmlDataItemUidSet &DeletedItems()
IMPORT_C TBoolHasSyncHistory()
IMPORT_C TIntMaxObjectSize()
IMPORT_C const MSmlDataItemUidSet &ModifiedItems()
IMPORT_C voidMoveItemL(TSmlDbItemUid, TSmlDbItemUid, TRequestStatus &)
IMPORT_C const MSmlDataItemUidSet &MovedItems()
IMPORT_C voidOpenItemL(TSmlDbItemUid, TBool &, TInt &, TSmlDbItemUid &, TDes8 &, TDes8 &, TRequestStatus &)
IMPORT_C voidOpenL(const TDesC &, MSmlSyncRelationship &, TRequestStatus &)
IMPORT_C voidReadItemL(TDes8 &)
IMPORT_C voidReplaceItemL(TSmlDbItemUid, TInt, TSmlDbItemUid, TBool, TRequestStatus &)
IMPORT_C voidResetChangeInfoL(TRequestStatus &)
IMPORT_C voidRevertTransaction(TRequestStatus &)
IMPORT_C voidSetRemoteMaxObjectSize(TInt)
IMPORT_C voidSetRemoteStoreFormatL(const CSmlDataStoreFormat &)
IMPORT_C voidSoftDeleteItemL(TSmlDbItemUid, TRequestStatus &)
IMPORT_C const MSmlDataItemUidSet &SoftDeletedItems()
IMPORT_C const TDesC &StoreName()
IMPORT_C voidWriteItemL(const TDesC8 &)
Protected Member Functions
const MSmlDataItemUidSet &DoAddedItems()
voidDoBeginBatchL()
voidDoBeginTransactionL()
voidDoCancelBatch()
voidDoCancelRequest()
voidDoCloseItem()
voidDoCommitBatchL(RArray< TInt > &, TRequestStatus &)
voidDoCommitChangeInfoL(TRequestStatus &, const MSmlDataItemUidSet &)
voidDoCommitChangeInfoL(TRequestStatus &)
voidDoCommitItemL(TRequestStatus &)
voidDoCommitTransactionL(TRequestStatus &)
voidDoCreateItemL(TSmlDbItemUid &, TInt, TSmlDbItemUid, const TDesC8 &, const TDesC8 &, TRequestStatus &)
voidDoDeleteAllItemsL(TRequestStatus &)
voidDoDeleteItemL(TSmlDbItemUid, TRequestStatus &)
const MSmlDataItemUidSet &DoDeletedItems()
TBool DoHasSyncHistory()
TInt DoMaxObjectSize()
const MSmlDataItemUidSet &DoModifiedItems()
voidDoMoveItemL(TSmlDbItemUid, TSmlDbItemUid, TRequestStatus &)
const MSmlDataItemUidSet &DoMovedItems()
voidDoOpenItemL(TSmlDbItemUid, TBool &, TInt &, TSmlDbItemUid &, TDes8 &, TDes8 &, TRequestStatus &)
voidDoOpenL(const TDesC &, MSmlSyncRelationship &, TRequestStatus &)
voidDoReadItemL(TDes8 &)
voidDoReplaceItemL(TSmlDbItemUid, TInt, TSmlDbItemUid, TBool, TRequestStatus &)
voidDoResetChangeInfoL(TRequestStatus &)
voidDoRevertTransaction(TRequestStatus &)
voidDoSetRemoteMaxObjectSize(TInt)
voidDoSetRemoteStoreFormatL(const CSmlDataStoreFormat &)
voidDoSoftDeleteItemL(TSmlDbItemUid, TRequestStatus &)
const MSmlDataItemUidSet &DoSoftDeletedItems()
const TDesC &DoStoreName()
voidDoWriteItemL(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 voidBeginBatchL()

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 voidBeginTransactionL()

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 voidCancelBatch()

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 voidCancelRequest()

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

CloseItem()

IMPORT_C voidCloseItem()

CommitBatchL(RArray< TInt > &, TRequestStatus &)

IMPORT_C voidCommitBatchL(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 voidCommitChangeInfoL(TRequestStatus &aStatus,
const MSmlDataItemUidSet &aItems
)

Parameters

TRequestStatus & aStatus
const MSmlDataItemUidSet & aItems

CommitChangeInfoL(TRequestStatus &)

IMPORT_C voidCommitChangeInfoL(TRequestStatus &aStatus)

Parameters

TRequestStatus & aStatus

CommitItemL(TRequestStatus &)

IMPORT_C voidCommitItemL(TRequestStatus &aStatus)

Parameters

TRequestStatus & aStatus

CommitTransactionL(TRequestStatus &)

IMPORT_C voidCommitTransactionL(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 voidCreateItemL(TSmlDbItemUid &aUid,
TIntaSize,
TSmlDbItemUidaParent,
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 voidDeleteAllItemsL(TRequestStatus &aStatus)

Parameters

TRequestStatus & aStatus

DeleteItemL(TSmlDbItemUid, TRequestStatus &)

IMPORT_C voidDeleteItemL(TSmlDbItemUidaUid,
TRequestStatus &aStatus
)

Parameters

TSmlDbItemUid aUid
TRequestStatus & aStatus

DeletedItems()

IMPORT_C const MSmlDataItemUidSet &DeletedItems()const

DoAddedItems()

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

DoBeginBatchL()

voidDoBeginBatchL()[protected, pure virtual]

DoBeginTransactionL()

voidDoBeginTransactionL()[protected, pure virtual]

DoCancelBatch()

voidDoCancelBatch()[protected, pure virtual]

DoCancelRequest()

voidDoCancelRequest()[protected, pure virtual]

DoCloseItem()

voidDoCloseItem()[protected, pure virtual]

DoCommitBatchL(RArray< TInt > &, TRequestStatus &)

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

Parameters

RArray< TInt > & aResultArray
TRequestStatus & aStatus

DoCommitChangeInfoL(TRequestStatus &, const MSmlDataItemUidSet &)

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

Parameters

TRequestStatus & aStatus
const MSmlDataItemUidSet & aItems

DoCommitChangeInfoL(TRequestStatus &)

voidDoCommitChangeInfoL(TRequestStatus &aStatus)[protected, pure virtual]

Parameters

TRequestStatus & aStatus

DoCommitItemL(TRequestStatus &)

voidDoCommitItemL(TRequestStatus &aStatus)[protected, pure virtual]

Parameters

TRequestStatus & aStatus

DoCommitTransactionL(TRequestStatus &)

voidDoCommitTransactionL(TRequestStatus &aStatus)[protected, pure virtual]

Parameters

TRequestStatus & aStatus

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

voidDoCreateItemL(TSmlDbItemUid &aUid,
TIntaSize,
TSmlDbItemUidaParent,
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 &)

voidDoDeleteAllItemsL(TRequestStatus &aStatus)[protected, pure virtual]

Parameters

TRequestStatus & aStatus

DoDeleteItemL(TSmlDbItemUid, TRequestStatus &)

voidDoDeleteItemL(TSmlDbItemUidaUid,
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 &)

voidDoMoveItemL(TSmlDbItemUidaUid,
TSmlDbItemUidaNewParent,
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 &)

voidDoOpenItemL(TSmlDbItemUidaUid,
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 &)

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

Parameters

const TDesC & aStoreName
MSmlSyncRelationship & aContext
TRequestStatus & aStatus

DoReadItemL(TDes8 &)

voidDoReadItemL(TDes8 &aBuffer)[protected, pure virtual]

Parameters

TDes8 & aBuffer

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

voidDoReplaceItemL(TSmlDbItemUidaUid,
TIntaSize,
TSmlDbItemUidaParent,
TBoolaFieldChange,
TRequestStatus &aStatus
)[protected, pure virtual]

Parameters

TSmlDbItemUid aUid
TInt aSize
TSmlDbItemUid aParent
TBool aFieldChange
TRequestStatus & aStatus

DoResetChangeInfoL(TRequestStatus &)

voidDoResetChangeInfoL(TRequestStatus &aStatus)[protected, pure virtual]

Parameters

TRequestStatus & aStatus

DoRevertTransaction(TRequestStatus &)

voidDoRevertTransaction(TRequestStatus &aStatus)[protected, pure virtual]

Parameters

TRequestStatus & aStatus

DoSetRemoteMaxObjectSize(TInt)

voidDoSetRemoteMaxObjectSize(TIntaServerMaxObjectSize)[protected, pure virtual]

Parameters

TInt aServerMaxObjectSize

DoSetRemoteStoreFormatL(const CSmlDataStoreFormat &)

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

Parameters

const CSmlDataStoreFormat & aServerDataStoreFormat

DoSoftDeleteItemL(TSmlDbItemUid, TRequestStatus &)

voidDoSoftDeleteItemL(TSmlDbItemUidaUid,
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 &)

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

Parameters

const TDesC8 & aData

HasSyncHistory()

IMPORT_C TBoolHasSyncHistory()const

MaxObjectSize()

IMPORT_C TIntMaxObjectSize()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 voidMoveItemL(TSmlDbItemUidaUid,
TSmlDbItemUidaNewParent,
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 voidOpenItemL(TSmlDbItemUidaUid,
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 voidOpenL(const TDesC &aStoreName,
MSmlSyncRelationship &aContext,
TRequestStatus &aStatus
)

Opens the data store specified by aStoreName asynchronously.

Parameters

const TDesC & aStoreNameThe name of the data store to open.
MSmlSyncRelationship & aContextIdentifies the specific synchronisation relationship to use for the synchronisation.
TRequestStatus & aStatusOn completion of the open, contains the result code.

ReadItemL(TDes8 &)

IMPORT_C voidReadItemL(TDes8 &aBuffer)

Parameters

TDes8 & aBuffer

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

IMPORT_C voidReplaceItemL(TSmlDbItemUidaUid,
TIntaSize,
TSmlDbItemUidaParent,
TBoolaFieldChange,
TRequestStatus &aStatus
)

Parameters

TSmlDbItemUid aUid
TInt aSize
TSmlDbItemUid aParent
TBool aFieldChange
TRequestStatus & aStatus

ResetChangeInfoL(TRequestStatus &)

IMPORT_C voidResetChangeInfoL(TRequestStatus &aStatus)

Parameters

TRequestStatus & aStatus

RevertTransaction(TRequestStatus &)

IMPORT_C voidRevertTransaction(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 voidSetRemoteMaxObjectSize(TIntaServerMaxObjectSize)

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 voidSetRemoteStoreFormatL(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 voidSoftDeleteItemL(TSmlDbItemUidaUid,
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 voidWriteItemL(const TDesC8 &aData)

Parameters

const TDesC8 & aData