RCntModel Class Reference

class RCntModel : public RSessionBase

Client-side Contacts Model session handle.

Inherits from

Public Member Functions
RCntModel()
voidAddObserverL(MContactDbObserver &)
TInt BeginDbTransaction()
voidBeginIterateL(TInt)
voidCancelAsyncOpen()
voidChangeSortOrderL(TInt, const CContactTextDef &)
voidClose()
TBool CloseContact(TContactItemId)
TInt CloseCrud()
voidCloseDatabase()
TInt CloseIterator()
TInt CloseProperties()
voidCloseTablesL()
voidCloseView(TInt)
CContactIdArray *CollectionL(TInt, TTime, const TDesC &)
voidCommitContactL(const CContactItem &, TBool)
TInt CommitDbTransaction()
voidConnectL()
TInt ConnectionId()
TInt ContactCountL()
TBool ContactMatchesHintFieldL(TInt, TContactItemId)
TContactItemId CreateContactL(CContactItem &)
TInt CreateDatabase(const TDesC &)
voidCrudAsyncOp(TInt, TRequestStatus &)
TInt CrudSyncOp(TInt)
TContactItemId CurrentItem()
TInt DatabaseDrive(TDriveUnit &)
TBool DatabaseExistsL(const TDesC &)
TBool DatabaseReadyL()
TInt DefaultDatabase(TDes &)
voidDeleteContactL(const TContactItemId, TCntSendEventAction, TBool)
TInt DeleteDatabase(const TDesC &)
voidEndIterateL(TInt)
voidEndNotificationTransfer()
CContactIdArray *FetchGroupListIdsL()
CContactIdArray *FetchTemplateListIdsL()
TInt FileSize()
TPtrC FileUidL()
voidFilterDatabaseL(CCntFilter &)
voidFindAsyncInitL(const TDesC &, CContactItemFieldDef *)
TBool FindAsyncL(CContactIdArray *&)
voidFindAsyncTextDefInitL(const CDesCArray &, CContactTextDef *)
CContactIdArray *FindL(const TDesC &, const CContactItemFieldDef *)
TInt GetCurrentDatabase(TDes &)
TUid GetDbViewContactType()
voidGetDefinitionsOfExistingViewsL(const TDesC &, RPointerArray< CContactDefaultViewDefinition > &)
CArrayFix< CContactDatabase::TSortPref > *GetSortPreferenceL()
TContactItemId GetSpeedDialFieldL(TInt, TDes &)
voidHandlePrematureServerTerminationL()
TContactItemId ICCTemplateIdL(TUid)
CViewContact *ItemAtL(TContactItemId, TInt)
voidIteratorAsyncOp(TInt, TRequestStatus &)
TInt IteratorSyncOp(TInt)
CDesCArray *ListDatabasesL(TDriveUnit *)
TInt64 MachineId()
CContactIdArray *MatchPhoneNumberL(const TDesC &, const TInt)
CViewContact *NextItemL(TInt, const TInt)
CContactItem *OpenContactLX(const CContactItemViewDef *, TContactItemId)
TInt OpenCrud()
TInt OpenDatabase(const TDesC &)
voidOpenDatabaseAsyncL(TRequestStatus &, const TDesC &)
TInt OpenIterator()
TInt OpenProperties()
voidOpenTablesL()
TInt OpenViewL(const CContactTextDef &, const TInt)
voidOverrideMachineUniqueId(TInt64)
TContactItemId OwnCard()
TContactItemId PhonebookGroupIdL()
TContactItemId PrefTemplateId()
voidPropertiesAsyncOp(TInt, TRequestStatus &)
TInt PropertiesSyncOp(TInt)
TInt ReCreateTemplate()
CContactItem *ReadContactL(const CContactItemViewDef *, TContactItemId)
voidReadContactTextDefL(TContactItemId, TDes &, const CContactTextDef &)
TInt RemoveCurrentItem()
voidRemoveObserver(const MContactDbObserver &)
voidRemoveSpeedDialFieldL(TContactItemId, TInt)
TInt ReplaceDatabase(const TDesC &)
voidResetServerSpeedDialsL()
TInt ResourceCount()
TInt RollbackDbTransaction()
TBool SeekContactL(TContactItemId, TContactItemId &, TUid &, TBool &)
voidSetAsyncActivityL(TBool)
TInt SetCurrentDatabase(const TDesC &)
voidSetCurrentItem(TContactItemId)
voidSetDatabaseDriveL(TDriveUnit, TBool)
voidSetDbViewContactType(const TUid)
voidSetFieldAsSpeedDialL(TContactItemId, TInt, TInt)
voidSetHeapFailure(RHeap::TAllocFail, TInt)
voidSetOperationTimeOutL(const TInt)
voidSetOwnCardL(const CContactItem &)
voidSetPrefTemplateL(const TContactItemId)
voidSetSortPreferenceL(const CArrayFix< CContactDatabase::TSortPref > &)
voidSetViewDefinitionL(const CContactViewDef &)
voidStartNotificationTransfer(TRequestStatus &, TDes8 &)
voidTextFieldL(TInt, TFieldType, TDes &)
voidUnlockLastLockedContact()
Private Member Functions
CContactIdArray *DoGetCollectionChangedSinceL(TTime)
CContactIdArray *DoGetCollectionGuidL(const TDesC &)
CContactIdArray *DoGetCollectionL(TInt)
voidPushUnlockL()
TInt SetFileName(const TDesC &)
CContactItem *UnPackContactLC(TInt, TIpcArgs &)
TVersion Version()
Inherited Functions
RHandleBase::Attributes()const
RHandleBase::BTraceId()const
RHandleBase::DoExtendedClose()
RHandleBase::Duplicate(const RThread &,TOwnerType)
RHandleBase::FullName()const
RHandleBase::FullName(TDes &)const
RHandleBase::Handle()const
RHandleBase::HandleInfo(THandleInfo *)
RHandleBase::Name()const
RHandleBase::NotifyDestruction(TRequestStatus &)
RHandleBase::Open(const TFindHandleBase &,TOwnerType)
RHandleBase::OpenByName(const TDesC &,TOwnerType,TInt)
RHandleBase::RHandleBase()
RHandleBase::RHandleBase(TInt)
RHandleBase::SetHandle(TInt)
RHandleBase::SetHandleNC(TInt)
RSessionBase::CreateSession(RServer2,const TVersion &)
RSessionBase::CreateSession(RServer2,const TVersion &,TInt)
RSessionBase::CreateSession(RServer2,const TVersion &,TInt,TIpcSessionType,const TSecurityPolicy *,TRequestStatus *)
RSessionBase::CreateSession(const TDesC &,const TVersion &)
RSessionBase::CreateSession(const TDesC &,const TVersion &,TInt)
RSessionBase::CreateSession(const TDesC &,const TVersion &,TInt,TIpcSessionType,const TSecurityPolicy *,TRequestStatus *)
RSessionBase::CreateSession(const TDesC &,const TVersion &,TInt,TRequestStatus *)
RSessionBase::Open(RMessagePtr2,TInt,TOwnerType)
RSessionBase::Open(RMessagePtr2,TInt,const TSecurityPolicy &,TOwnerType)
RSessionBase::Open(TInt,TOwnerType)
RSessionBase::Open(TInt,const TSecurityPolicy &,TOwnerType)
RSessionBase::Send(TInt)const
RSessionBase::Send(TInt,const TIpcArgs &)const
RSessionBase::SendReceive(TInt)const
RSessionBase::SendReceive(TInt,TRequestStatus &)const
RSessionBase::SendReceive(TInt,const TIpcArgs &)const
RSessionBase::SendReceive(TInt,const TIpcArgs &,TRequestStatus &)const
RSessionBase::SetReturnedHandle(TInt)
RSessionBase::SetReturnedHandle(TInt,RHandleBase &)
RSessionBase::SetReturnedHandle(TInt,const TSecurityPolicy &)
RSessionBase::ShareAuto()
RSessionBase::ShareProtected()
Inherited Enumerations
RHandleBase:TAttributes
RSessionBase:TAttachMode
Private Attributes
TInt iConnectionId
CCntDbNotifyMonitor *iDbNotifyMonitor
TBuf< KCntMaxFilePath >iFileName
TBuf< KUidBufferSize >iFileUid
TInt iNoOfSvrStartAttempts
CCntPackager *iPackager
Inherited Attributes
RHandleBase::iHandle

Constructor & Destructor Documentation

RCntModel()

RCntModel()

RCntModel constructor.

Member variables must be initialised (zero'd) in the constructor since RCntModel does not derive from CBase.

Member Functions Documentation

AddObserverL(MContactDbObserver &)

voidAddObserverL(MContactDbObserver &aObserver)

Add a database event observer.

Parameters

MContactDbObserver & aObserverObserver callback inteface used to send database event.

BeginDbTransaction()

TInt BeginDbTransaction()const

Start a database transaction.

BeginIterateL(TInt)

voidBeginIterateL(TIntaViewId)

Parameters

TInt aViewId

CancelAsyncOpen()

voidCancelAsyncOpen()

Cancel last asynchronous database open request.

capability
None

ChangeSortOrderL(TInt, const CContactTextDef &)

voidChangeSortOrderL(TIntaViewId,
const CContactTextDef &aTextDef
)

Parameters

TInt aViewId
const CContactTextDef & aTextDef

Close()

voidClose()

Close session.

CloseContact(TContactItemId)

TBool CloseContact(TContactItemIdaContactId)

Close/unLock an existing contact in the database.

Parameters

TContactItemId aContactIdThe contact ID of the contact to close.

CloseCrud()

TInt CloseCrud()const

CloseDatabase()

voidCloseDatabase()const

Close currently open database.

capability
None

CloseIterator()

TInt CloseIterator()const

CloseProperties()

TInt CloseProperties()const

CloseTablesL()

voidCloseTablesL()

Close the database tables.

capability
None

CloseView(TInt)

voidCloseView(TIntaViewId)

Parameters

TInt aViewId

CollectionL(TInt, TTime, const TDesC &)

CContactIdArray *CollectionL(TIntaCollectionType,
TTimeaTime = 0,
const TDesC &aGuid =  KNullDesC
)

Get a collection of contact IDs using the specified collection parameters.

Parameters

TInt aCollectionTypeType of collection.
TTime aTime = 0Used if collection type is "changed since".
const TDesC & aGuid =  KNullDesC Used if collection type is "find GUID".

CommitContactL(const CContactItem &, TBool)

voidCommitContactL(const CContactItem &aContact,
TBoolaSendChangedEvent = ETrue
)const

Update and unlock an existing contact in the database.

capability
WriteUserData

Parameters

const CContactItem & aContactThe contact to be updated and unlocked
TBool aSendChangedEvent = ETrueIf ETrue the changed event should be sent after the update/unlock.

CommitDbTransaction()

TInt CommitDbTransaction()const

Commit a database transaction.

ConnectL()

voidConnectL()

Open a Contacts server session.

ConnectionId()

TInt ConnectionId()const

Returns the connection ID of the current client session.

ContactCountL()

TInt ContactCountL()const

Get the number of contacts in the database.

ContactMatchesHintFieldL(TInt, TContactItemId)

TBool ContactMatchesHintFieldL(TIntaBitWiseFilter,
TContactItemIdaContactId
)

Tests whether a contact item's hint bit field matches a filter.

capability
None

Parameters

TInt aBitWiseFilterThe filter to compare the item against. This is a combination of TContactViewFilter values.
TContactItemId aContactIdThe ID of the item in the database.

CreateContactL(CContactItem &)

TContactItemId CreateContactL(CContactItem &aContact)const

Add a new contact to the database.

capability
WriteUserData

Parameters

CContactItem & aContactThe contact to be added to the database.

CreateDatabase(const TDesC &)

TInt CreateDatabase(const TDesC &aCntFile =  KNullDesC )const

Create an empty named contact database.

Creates the default contacts database if the default argument is used. The given descriptor must not contain more than KCntMaxFilePath characters.

capability
WriteUserData

Parameters

const TDesC & aCntFile =  KNullDesC Contacts database filename (in the form drive:database). Defaults to KCntDefaultDrive.

CrudAsyncOp(TInt, TRequestStatus &)

voidCrudAsyncOp(TIntaParam,
TRequestStatus &aStatus
)const

Parameters

TInt aParam
TRequestStatus & aStatus

CrudSyncOp(TInt)

TInt CrudSyncOp(TIntaParam)const

Parameters

TInt aParam

CurrentItem()

TContactItemId CurrentItem()const

Gets the ID of the current item, as set by SetCurrentItem(). The current item ID is initialised to KNullContactId when the database is opened.

capability
None

DatabaseDrive(TDriveUnit &)

TInt DatabaseDrive(TDriveUnit &aDriveUnit)const

Retrieve the current contact database drive.

capability
None

Parameters

TDriveUnit & aDriveUnitContains the current contact database drive unit on return.

DatabaseExistsL(const TDesC &)

TBool DatabaseExistsL(const TDesC &aCntFile =  KNullDesC )const

Determine if the named contact database file exists.

If the aCntFile argument is the default, determines if default contact database file exists.

leave
KErrArgument if the given descriptor contains more than the maximum length of 190 characters, otherwise one of the System error codes.
capability
None

Parameters

const TDesC & aCntFile =  KNullDesC Contacts database filename (in the form drive:database).

DatabaseReadyL()

TBool DatabaseReadyL()const

Determine if the database is ready. Ready in this context means that the database is open and readable/writable (i.e. the state machine is in CStateWritable).

capability
None

DefaultDatabase(TDes &)

TInt DefaultDatabase(TDes &aCntFile)const

Get the name of the default contact database file.

The given descriptor must have room for minimum of KCntMaxFilePath characters.

capability
None

Parameters

TDes & aCntFileContains the default contact database name on return.

DeleteContactL(const TContactItemId, TCntSendEventAction, TBool)

voidDeleteContactL(const TContactItemIdaCntId,
TCntSendEventActionaCntEventType,
TBoolaDecAccessCount = EFalse
)const

Delete a contact from the database.

capability
WriteUserData

Parameters

const TContactItemId aCntId
TCntSendEventAction aCntEventTypeThe event type to pass on to the observers.
TBool aDecAccessCount = EFalseIf ETrue access count should be decremented prior to the deletion.

DeleteDatabase(const TDesC &)

TInt DeleteDatabase(const TDesC &aCntFile =  KNullDesC )const

Delete a named contact database.

Deletes the default contacts database if the default argument is used. The given descriptor must not contain more than KCntMaxFilePath characters.

capability
WriteUserData

Parameters

const TDesC & aCntFile =  KNullDesC Contacts database filename (in the form drive:database). Defaults to KCntDefaultDrive.

DoGetCollectionChangedSinceL(TTime)

CContactIdArray *DoGetCollectionChangedSinceL(TTimeaTime)[private]

Get a collection of contact IDs which have changed since the given time.

Parameters

TTime aTimeChanged since time.

DoGetCollectionGuidL(const TDesC &)

CContactIdArray *DoGetCollectionGuidL(const TDesC &aGuid)[private]

Get a collection of contact IDs which have the given GUID. Since GUIDs are unique (i.e. no two contacts can have the same GUID) there will only ever be one contact ID in this collection.

Parameters

const TDesC & aGuidContact GUID.

DoGetCollectionL(TInt)

CContactIdArray *DoGetCollectionL(TIntaCollectionType)[private]

Get a collection of contact IDs for the given collection type.

Parameters

TInt aCollectionTypeCollection type.

EndIterateL(TInt)

voidEndIterateL(TIntaViewId)

Parameters

TInt aViewId

EndNotificationTransfer()

voidEndNotificationTransfer()

End (cancel) request for database event from server.

FetchGroupListIdsL()

CContactIdArray *FetchGroupListIdsL()

Get a list of group IDs from the server.

FetchTemplateListIdsL()

CContactIdArray *FetchTemplateListIdsL()

Get a list of template IDs from the server.

FileSize()

TInt FileSize()const

Gets the size of the database file in bytes.

capability
None

FileUidL()

TPtrC FileUidL()const

Get the database file UID.

capability
None

FilterDatabaseL(CCntFilter &)

voidFilterDatabaseL(CCntFilter &aFilter)

Filter the database using the given filter.

Parameters

CCntFilter & aFilterFilter to use. On return the contact IDs in this filter will be augmented with those contact IDs which match the given filter.

FindAsyncInitL(const TDesC &, CContactItemFieldDef *)

voidFindAsyncInitL(const TDesC &aText,
CContactItemFieldDef *aFieldDef
)

Initialise the Persistence Layer collection class ready for iterative calls to the FindAsyncL() method. This form of initialisation is for an asynchronous find which uses text and a field definition.

Parameters

const TDesC & aTextFind text.
CContactItemFieldDef * aFieldDefField definition to use in find.

FindAsyncL(CContactIdArray *&)

TBool FindAsyncL(CContactIdArray *&aIdArray)

Perform an asynchronous find iteration. Either the FindAsyncTextDefInitL() or the FindAsyncInitL() method above must have first been called.

Parameters

CContactIdArray *& aIdArraySet of contacts IDs from previous calls to FindAsyncL(). Will be NULL if this is the first iteration.

FindAsyncTextDefInitL(const CDesCArray &, CContactTextDef *)

voidFindAsyncTextDefInitL(const CDesCArray &aWords,
CContactTextDef *aTextDef
)

Initialise the Persistence Layer collection class ready for iterative calls to the FindAsyncL() method. This form of initialisation is for an asynchronous find which uses a text definition and an array of "find words".

Parameters

const CDesCArray & aWords"Find words" array.
CContactTextDef * aTextDefText definition to use in find.

FindL(const TDesC &, const CContactItemFieldDef *)

CContactIdArray *FindL(const TDesC &aText,
const CContactItemFieldDef *aFieldDef
)

Parameters

const TDesC & aText
const CContactItemFieldDef * aFieldDef

GetCurrentDatabase(TDes &)

TInt GetCurrentDatabase(TDes &aDatabase)const

When there are multiple contact databases on a device this method can be used to enquire which database is the current one.

The current database functions are provided as part of current item functionality. In order to pass a current item from one contacts model client to another, the receiving client needs to be using the same database.

The current database is a path and filename, set using SetCurrentDatabase(), which is persisted by the contacts server.

capability
None

Parameters

TDes & aDatabaseThe path and filename of the current database. KNullDesC if no current database has been set.

GetDbViewContactType()

TUid GetDbViewContactType()const

GetDefinitionsOfExistingViewsL(const TDesC &, RPointerArray< CContactDefaultViewDefinition > &)

voidGetDefinitionsOfExistingViewsL(const TDesC &aDbName,
RPointerArray< CContactDefaultViewDefinition > &aViewDefs
)

Parameters

const TDesC & aDbName
RPointerArray< CContactDefaultViewDefinition > & aViewDefs

GetSortPreferenceL()

CArrayFix< CContactDatabase::TSortPref > *GetSortPreferenceL()const

Get the sort preferences from the server.

GetSpeedDialFieldL(TInt, TDes &)

TContactItemId GetSpeedDialFieldL(TIntaSpeedDialPosition,
TDes &aPhoneNumber
)

Returns the ID of the contact item whose telephone number field is mapped to the speed dial position specified.

This function is provided so that information may be displayed about a contact item whose telephone number is being dialled using speed dialling.

The function also retrieves the telephone number stored in the field.

capability
ReadUserData

Parameters

TInt aSpeedDialPositionThe speed dial position. This is an integer in the range 1 to 9 inclusive. If outside this range, the function leaves with KErrArgument.
TDes & aPhoneNumberOn return contains the telephone number which is mapped to the speed dial position specified. Returns KNullDesC if the speed dial position requested has not been set.

HandlePrematureServerTerminationL()

voidHandlePrematureServerTerminationL()

Handle a premature termination of the contact server process by re-connecting the session and re-opening the database.

capability
ReadUserData

ICCTemplateIdL(TUid)

TContactItemId ICCTemplateIdL(TUidaPhonebookUid = KNullUid)

Returns the ID of the template that should be used with CContactICCEntry items. If aPhonebookUid is set, the ID of the template belonging to the phonebook with TUid aPhonebookUid is returned.

Parameters

TUid aPhonebookUid = KNullUidThe phonebook ID with default KNullUid.

ItemAtL(TContactItemId, TInt)

CViewContact *ItemAtL(TContactItemIdaContactId,
TIntaViewId
)

Parameters

TContactItemId aContactId
TInt aViewId

IteratorAsyncOp(TInt, TRequestStatus &)

voidIteratorAsyncOp(TIntaParam,
TRequestStatus &aStatus
)const

Parameters

TInt aParam
TRequestStatus & aStatus

IteratorSyncOp(TInt)

TInt IteratorSyncOp(TIntaParam)const

Parameters

TInt aParam

ListDatabasesL(TDriveUnit *)

CDesCArray *ListDatabasesL(TDriveUnit *aDriveUnit = NULL)const

List the contact database files for any given drive unit. Lists all databases on all drives if aDriveUnit is set to NULL.

leave
KErrNoMemory if not enough free memory, KErrNotReady if drive does not, otherwise one of the System error codes.
capability
ReadUserData

Parameters

TDriveUnit * aDriveUnit = NULLThe drive unit to search. Searches all drives if default argument is used.

MachineId()

TInt64 MachineId()const

Get the machine ID.

Note: This function can leave.

leave
KErrNone The send operation is successful
leave
KErrServerTerminated The server no longer present
leave
KErrServerBusy There are no message slots available
leave
KErrNoMemory There is insufficient memory available
capability
None

MatchPhoneNumberL(const TDesC &, const TInt)

CContactIdArray *MatchPhoneNumberL(const TDesC &aNumber,
const TIntaMatchLengthFromRight
)

Returns an array of contact item IDs for all the contact items which may contain the specified telephone number in a telephone, fax or SMS type field.

CContactDatabase::MatchPhoneNumberL() for more details on the match.
capability
ReadUserData

Parameters

const TDesC & aNumberPhone number string
const TInt aMatchLengthFromRightNumber of digits from the right of the phone number to use. Up to 15 digits can be specified and it is recommended that at least 7 match digits are specified.

NextItemL(TInt, const TInt)

CViewContact *NextItemL(TIntaViewId,
const TIntaViewPrefs
)

Parameters

TInt aViewId
const TInt aViewPrefs

OpenContactLX(const CContactItemViewDef *, TContactItemId)

CContactItem *OpenContactLX(const CContactItemViewDef *aCntItemVDef,
TContactItemIdaCntId
)const

Open and lock an existing contact in the database. The contact item lock is pushed onto the cleanup stack.

Parameters

const CContactItemViewDef * aCntItemVDefThe view definition to use.
TContactItemId aCntIdContact ID to read.

OpenCrud()

TInt OpenCrud()const

OpenDatabase(const TDesC &)

TInt OpenDatabase(const TDesC &aCntFile =  KNullDesC )const

Open a named contact database.

Opens the default contacts database if the default argument is used. The given descriptor must not contain more than KCntMaxFilePath characters.

capability
ReadUserData

Parameters

const TDesC & aCntFile =  KNullDesC Filename (in the form drive:database). Defaults to KCntDefaultDrive.

OpenDatabaseAsyncL(TRequestStatus &, const TDesC &)

voidOpenDatabaseAsyncL(TRequestStatus &aStatus,
const TDesC &aCntFile =  KNullDesC
)

Open a named contact database asynchronously.

Opens the default contacts database if the default argument is used. The given descriptor must not contain more than KCntMaxFilePath characters.

capability
ReadUserData

Parameters

TRequestStatus & aStatusAsynchronous request object. Request is completed when database has been opened.
const TDesC & aCntFile =  KNullDesC Contacts database filename (in the form drive:database). Defaults to KCntDefaultDrive.

OpenIterator()

TInt OpenIterator()const

OpenProperties()

TInt OpenProperties()const

OpenTablesL()

voidOpenTablesL()

Open the database tables.

capability
ReadUserData

OpenViewL(const CContactTextDef &, const TInt)

TInt OpenViewL(const CContactTextDef &aTextDef,
const TIntaViewPrefs
)

Parameters

const CContactTextDef & aTextDef
const TInt aViewPrefs

OverrideMachineUniqueId(TInt64)

voidOverrideMachineUniqueId(TInt64aMachineUniqueId)

Set the machine ID (debug only).

capability
None

Parameters

TInt64 aMachineUniqueIdNew machine ID.

OwnCard()

TContactItemId OwnCard()const

Returns the ID of the database's current own card.

Having obtained this ID, the client may then open the own card in the same way as an ordinary contact card (using ReadContactL() or OpenContactL()).

PhonebookGroupIdL()

TContactItemId PhonebookGroupIdL()

Returns the ID of the contacts model group which represents the ADN phonebook.

PrefTemplateId()

TContactItemId PrefTemplateId()const

Returns the ID of the database's preferred template, as set by the method SetPrefTemplateL(). The preferred template is for clients who may have multiple templates but want to identify one as preferred.

PropertiesAsyncOp(TInt, TRequestStatus &)

voidPropertiesAsyncOp(TIntaParam,
TRequestStatus &aStatus
)const

Parameters

TInt aParam
TRequestStatus & aStatus

PropertiesSyncOp(TInt)

TInt PropertiesSyncOp(TIntaParam)const

Parameters

TInt aParam

PushUnlockL()

voidPushUnlockL()const [private]

Push a Contact item unlock cleanup item on the cleanup stack.

ReCreateTemplate()

TInt ReCreateTemplate()const

Create the system template.

capability
WriteUserData

ReadContactL(const CContactItemViewDef *, TContactItemId)

CContactItem *ReadContactL(const CContactItemViewDef *aCntItemVDef,
TContactItemIdaCntId
)const

Read an existing contact in the database.

Parameters

const CContactItemViewDef * aCntItemVDefThe view definition to use.
TContactItemId aCntIdContact ID to read.

ReadContactTextDefL(TContactItemId, TDes &, const CContactTextDef &)

voidReadContactTextDefL(TContactItemIdaContactId,
TDes &aResult,
const CContactTextDef &aTextDef
)

Parameters

TContactItemId aContactId
TDes & aResult
const CContactTextDef & aTextDef

RemoveCurrentItem()

TInt RemoveCurrentItem()

RemoveObserver(const MContactDbObserver &)

voidRemoveObserver(const MContactDbObserver &aObserver)

Remove a database event observer.

Parameters

const MContactDbObserver & aObserverObserver callback inteface to be removed.

RemoveSpeedDialFieldL(TContactItemId, TInt)

voidRemoveSpeedDialFieldL(TContactItemIdaContactId,
TIntaSpeedDialPosition
)

Removes the mapping between a contact item field and a speed dial position.

Removes the KUidSpeedDialXxx UID from the field's content type, removes the field's speed dial attribute and commits the changes to the item.

leave
KErrDiskFull The disk does not have enough free space to perform the operation.
capability
ReadUserData
capability
WriteUserData

Parameters

TContactItemId aContactIdThe ID of the contact item containing the speed dial field.
TInt aSpeedDialPositionThe speed dial position. This is an integer in the range 1 to 9 inclusive. If outside this range, the function leaves with KErrArgument.

ReplaceDatabase(const TDesC &)

TInt ReplaceDatabase(const TDesC &aCntFile =  KNullDesC )const

Replace a named contact database with an empty one, replacing any database with the same name. Replaces the default contacts database if the default argument is used. The given descriptor must not contain more than KCntMaxFilePath characters.

capability
WriteUserData

Parameters

const TDesC & aCntFile =  KNullDesC Contacts database filename (in the form drive:database). Defaults to KCntDefaultDrive.

ResetServerSpeedDialsL()

voidResetServerSpeedDialsL()

ResourceCount()

TInt ResourceCount()

Debug only.

capability
None

RollbackDbTransaction()

TInt RollbackDbTransaction()const

Rollback a database transaction.

SeekContactL(TContactItemId, TContactItemId &, TUid &, TBool &)

TBool SeekContactL(TContactItemIdaContactId,
TContactItemId &aId,
TUid &aContactType,
TBool &aDeleted
)

Seek to the given contact ID.

Parameters

TContactItemId aContactIdContact ID to seek to.
TContactItemId & aIdOn return the contact ID that the seek found. This will be the nearest contact ID if the given aContactID cannot be found.
TUid & aContactTypeOn return the contact type of the contact that the seek found.
TBool & aDeletedOn return ETrue if the contact that the seek found is marked as deleted, EFalse otherwise.

SetAsyncActivityL(TBool)

voidSetAsyncActivityL(TBoolaAsyncActivity)

Set the asynchronous activity flag in the server. Any asynchronous activity such as asynchronous find or asynchronous sort prevent the database from being closed and should set this flag. When all asynchronous activites are finished this flag should be cleared.

capability
None

Parameters

TBool aAsyncActivityETrue if at least one asynchronous activity, EFalse if no asynchronous activities.

SetCurrentDatabase(const TDesC &)

TInt SetCurrentDatabase(const TDesC &aDatabase)const

When there are multiple contact databases on a device this method can be used to set a database as the current one.

Note: this function simply updates a file name which is stored by the Contacts server and its use is optional. It is provided as part of current item functionality.

In order to pass a current item from one contacts model client to another, the receiving client needs to be using the same database.

capability
WriteUserData

Parameters

const TDesC & aDatabaseThe path and filename of the current database.

SetCurrentItem(TContactItemId)

voidSetCurrentItem(TContactItemIdaContactId)const

Sets the ID of the current item and persists it in the database. The current item is provided for use by clients who want to identify one contact item in the database as the currently selected item.

capability
WriteUserData

Parameters

TContactItemId aContactIdThe ID of the current item.

SetDatabaseDriveL(TDriveUnit, TBool)

voidSetDatabaseDriveL(TDriveUnitaDriveUnit,
TBoolaCopy = ETrue
)

Sets the contact database drive and optionally moves the default contact database from its current location to the new drive. This function guarantees an all or nothing operation. If the database is not successfully moved, the drive setting is not updated to reflect the change.

capability
WriteUserData

Parameters

TDriveUnit aDriveUnitThe drive to which to move the contact database.
TBool aCopy = ETrueETrue moves the existing file to the specified drive. Deletion of the source file will fail if it is in use. EFalse does not move the file. The default argument value is ETrue.

SetDbViewContactType(const TUid)

voidSetDbViewContactType(const TUidaUid)

Parameters

const TUid aUid

SetFieldAsSpeedDialL(TContactItemId, TInt, TInt)

voidSetFieldAsSpeedDialL(TContactItemIdaContactId,
TIntaFieldIndex,
TIntaSpeedDialPosition
)

Sets a field containing a telephone number as a speed dial field. The field is identified by aFieldIndex within the contact item aItem. It is assigned a speed dial position between 1 and 9 inclusive.

The field's speed dial and user added attributes are set and the appropriate UID (KUidSpeedDialXxx) is added to the field's content type. The changes are committed to the database.

Notes:

  • If an item's telephone number field has already been assigned to position aSpeedDialPosition, that item is updated so that the speed dial attribute is removed from its field and the speed dial field type UID is removed from the field's content type, before the new speed dial field is set.

  • The contact item passed to this function (aItem) must have been obtained using one of the variants of CContactDatabase::OpenContactL(). This is because it is modified and committed to the database by this function - no further commits are necessary.

leave
KErrDiskFull The disk does not have enough free space to perform the operation.
capability
ReadUserData
capability
WriteUserData

Parameters

TContactItemId aContactId
TInt aFieldIndexIndex of a field in aItem's field set to set as a speed dial field.
TInt aSpeedDialPositionThe speed dial position. This is an integer in the range 1 to 9 inclusive. If outside this range, the function leaves with KErrArgument.

SetFileName(const TDesC &)

TInt SetFileName(const TDesC &aCntFile)const [private]

Set the database filename. Used to re-open the database if the server is terminated prematurely.

Parameters

const TDesC & aCntFileContacts database filename (in the form drive:database).

SetHeapFailure(RHeap::TAllocFail, TInt)

voidSetHeapFailure(RHeap::TAllocFailaType,
TIntaRate
)

Debug only.

capability
None

Parameters

RHeap::TAllocFail aType
TInt aRate

SetOperationTimeOutL(const TInt)

voidSetOperationTimeOutL(const TIntaMicroSeconds)const

Set the operation timeout value. This value is the length of time that a deferred request will remain in the request queue in the State Machine before being completed with an error code.

Parameters

const TInt aMicroSecondsThe operation timeout in microseconds. This timeout will only be applied to requests sent by clients of this database after this point in time.

SetOwnCardL(const CContactItem &)

voidSetOwnCardL(const CContactItem &aContact)

Sets an existing contact item to be the database's current own card.

leave
KErrNotFound aContact does not exist in the database.
leave
KErrDiskFull The disk does not have enough free space to perform the operation.
capability
None

Parameters

const CContactItem & aContactThe contact item to set as the database's current own card. It must already exist in the database. It cannot be a group or a template.

SetPrefTemplateL(const TContactItemId)

voidSetPrefTemplateL(const TContactItemIdaContactId)

Sets the database's preferred template.

The preferred template's ID persists when the database is opened and closed. If the preferred template is subsequently deleted, the preferred template ID is set to KNullContactId.

leave
KErrNotSupported The item is not a template (i.e. is not of type KUidContactCardTemplate).
leave
KErrDiskFull The disk does not have enough free space to perform the operation.
capability
WriteUserData

Parameters

const TContactItemId aContactId

SetSortPreferenceL(const CArrayFix< CContactDatabase::TSortPref > &)

voidSetSortPreferenceL(const CArrayFix< CContactDatabase::TSortPref > &aSortOrder)

Set the sort preferences in the server.

Parameters

const CArrayFix< CContactDatabase::TSortPref > & aSortOrderSort order preferences.

SetViewDefinitionL(const CContactViewDef &)

voidSetViewDefinitionL(const CContactViewDef &aView)

Change the existing contact view definition on the server.

Parameters

const CContactViewDef & aViewThe new contact view defintion.

StartNotificationTransfer(TRequestStatus &, TDes8 &)

voidStartNotificationTransfer(TRequestStatus &aStatus,
TDes8 &aEvent
)

Request a database event from the server.

Parameters

TRequestStatus & aStatusCompleted when database event is available.
TDes8 & aEventWhen aStatus is completed contains the database event.

TextFieldL(TInt, TFieldType, TDes &)

voidTextFieldL(TIntaCntItemId,
TFieldTypeaFieldType,
TDes &aText
)

Parameters

TInt aCntItemId
TFieldType aFieldType
TDes & aText

UnPackContactLC(TInt, TIpcArgs &)

CContactItem *UnPackContactLC(TIntaBufferSize,
TIpcArgs &aArgs
)const [private]

Unpacks a contact item contained within the Packager's internal buffer and creates a contact item object. Within the server, the contact item has been written to the Packager's internal buffer by the RMessage2.

If the buffer size was returned then the buffer was not large enough to hold a serialised contact item. The buffer must be expanded to the size returned by the server (ie aBufferSize) and the read operation performed again.

CCntPackager::SetBufferFromMessageL()
capability
ReadUserData

Parameters

TInt aBufferSizeThe new buffer size.
TIpcArgs & aArgsThe argument buffer where the serialised contact item is written by the server.

UnlockLastLockedContact()

voidUnlockLastLockedContact()

Unlock the last locked contact item on the server. Used by OpenLX().

capability
None

Version()

TVersion Version()const [private]

Get the Contacts server version number.

Member Data Documentation

TInt iConnectionId

TInt iConnectionId[private]

CCntDbNotifyMonitor * iDbNotifyMonitor

CCntDbNotifyMonitor *iDbNotifyMonitor[private]

TBuf< KCntMaxFilePath > iFileName

TBuf< KCntMaxFilePath >iFileName[private]

TBuf< KUidBufferSize > iFileUid

TBuf< KUidBufferSize >iFileUid[private]

TInt iNoOfSvrStartAttempts

TInt iNoOfSvrStartAttempts[private]

CCntPackager * iPackager

CCntPackager *iPackager[private]