Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: CNTDB.H
Link against: cntmodel.lib

Class CContactDatabase

class CContactDatabase : public CBase, public MContactDbPrivObserver, public MContactStorageObserver;

Description

A database of contact items.

Contact items can be added to and removed from the database and items in the database can be opened or read. To edit an item, it must first be opened. Changes to the item can then be committed using CommitContactL() (committing can only take place to an open item).

If the available disk space is less than 128 kilobytes then changes to the contact database cannot be started, and methods such as CreateL() or CommitContactL() will leave with a KErrDiskFull error. Less obviously OpenL() can also fail with KErrDiskFull when trying to update the system template.

Each item has an access count. An item cannot be fully deleted unless its access count is zero. This is to prevent items which have been synchronised with another contacts application from being deleted. Also, if the item is a template, it cannot be deleted if other items are based on it.

More than one contact database can exist on a phone, but there is a default contact database. Its filename is contacts.cdb. It can be moved between drives.

CContactDatabase implements searching and sorting and also provides separate phone number matching functions. These provide a fast way of indexing and looking up phone numbers, e.g. for looking up caller IDs on incoming calls.

The database owns speed dial information. This is a mapping between a single digit integer and a telephone number. There may be up to 9 speed dial telephone numbers; each of them belongs to a contact item in the database. If a contact item is deleted, its speed dial mapping is removed.

The following functions defined in class CContactDatabase are not supported. If called, they leave with KErrNotSupported.

Derivation

Members

Defined in CContactDatabase:
AddContactToGroupL(), AddContactToGroupL(), AddContactToGroupL(), AddNewContactL(), CancelAsyncSort(), CloseContactL(), CloseTables(), CommitContactL(), CompactL(), CompressRequired(), ConnectionId(), ContactDatabaseExistsL(), ContactsChangedSinceL(), CountL(), CreateCompressorLC(), CreateContactCardTemplateL(), CreateContactCardTemplateL(), CreateContactCardTemplateLC(), CreateContactCardTemplateLC(), CreateContactGroupL(), CreateContactGroupL(), CreateContactGroupLC(), CreateContactGroupLC(), CreateL(), CreateL(), CreateOwnCardL(), CreateOwnCardLC(), CreateRecoverLC(), DatabaseDrive(), DefaultContactDatabaseExistsL(), DeleteContactL(), DeleteContactsL(), DeleteDatabaseL(), DeleteDefaultFileL(), EAsc, EConverterDefined1, EConverterDefined2, EConverterDefined3, EConverterDefined4, EConverterDefined5, EConverterDefined6, EConverterDefined7, EConverterDefined8, EConverterReserved1, EConverterReserved10, EConverterReserved11, EConverterReserved12, EConverterReserved13, EConverterReserved14, EConverterReserved15, EConverterReserved16, EConverterReserved2, EConverterReserved3, EConverterReserved4, EConverterReserved5, EConverterReserved6, EConverterReserved7, EConverterReserved8, EConverterReserved9, ECustomFilter1, ECustomFilter2, ECustomFilter3, ECustomFilter4, EDbConnectionClosedForRestore, EDbConnectionFailed, EDbConnectionNeedToCloseForRestore, EDbConnectionNotReady, EDbConnectionOpen, EDbConnectionRecoverRequired, EDbConnectionWriteLockedForBackup, EDecreaseAccessCount, EDefault, EDesc, EExcludeUid, EFaxable, EHome, EIMAddress, EImportSingleContact, EIncludeX, EIncreaseAccessCount, ELandLine, ELocalTime, EMailable, EMultiThread, ENullTemplateId, EPhonable, ERingTone, ESingleThread, ESmsable, ETTFormat, EUnfiltered, EVoiceDial, EWirelessVillage, EWork, ExportSelectedContactsL(), ExportSelectedContactsL(), FileSize(), FileUid(), FilterDatabaseL(), FindAsyncL(), FindInTextDefAsyncL(), FindInTextDefAsyncL(), FindInTextDefLC(), FindInTextDefLC(), FindLC(), GetCardTemplateIdListL(), GetCurrentDatabase(), GetCurrentItem(), GetDbViewContactType(), GetDefaultNameL(), GetGroupIdListL(), GetLastSyncDateL(), GetSpeedDialFieldL(), GroupCount(), HandleDatabaseEventL(), HandleDiskSpaceEvent(), ICCTemplateIdL(), ICCTemplateIdL(), ImportContactsL(), IsDamaged(), ListDatabasesL(), ListDatabasesL(), MachineId(), MatchPhoneNumberL(), NullUidValue(), Open(), Open(), OpenContactL(), OpenContactL(), OpenContactLX(), OpenContactLX(), OpenL(), OpenL(), OpenTablesL(), OwnCardId(), PhonebookGroupIdL(), PrefTemplateId(), ReadContactAndAgentL(), ReadContactL(), ReadContactL(), ReadContactLC(), ReadContactLC(), ReadContactTextDefL(), ReadContactTextDefL(), ReadContactTextDefL(), ReadContactTextDefL(), ReadMinimalContactL(), ReadMinimalContactLC(), RecoverL(), RemoveContactFromGroupL(), RemoveContactFromGroupL(), RemoveSpeedDialFieldL(), ReplaceL(), ReplaceL(), RestoreSortOrderL(), SetCurrentDatabase(), SetCurrentItem(), SetDatabaseDriveL(), SetDateFormatTextL(), SetDbViewContactType(), SetFieldAsSpeedDialL(), SetLastSyncDateL(), SetLastSyncDateL(), SetOwnCardL(), SetPrefTemplateL(), SetSortedItemsList(), SetTextDefinitionL(), SetViewDefinitionL(), SortArrayL(), SortArrayLC(), SortAsyncL(), SortAsyncL(), SortByTypeL(), SortL(), SortOrder(), SortedItemsL(), StoreSortOrderL(), TContactViewFilter, TDbConnState, TDirection, TOptions, TSortPref, TTextFieldMinimal, TThreadAccess, TemplateContentType(), TemplateCount(), TemplateId(), TextDefinition(), Version(), WastedSpaceInBytes(), doAddNewContactL(), ~CContactDatabase()

Inherited from CBase:
Delete(), Extension_(), operator new()


Construction and destruction


~CContactDatabase()

IMPORT_C ~CContactDatabase();

Description

Frees all resources owned by the contact database, prior to its destruction.

[Top]


Member functions


OpenL()

Capability: ReadUserData

static IMPORT_C CContactDatabase *OpenL(TThreadAccess aAccess=ESingleThread);

Description

Opens the default contact database.

Note: clients should not assume any knowledge of the default database name or location because they may be changed in future releases.

Parameters

TThreadAccess aAccess

The default (ESingleThread) allows access to the session with the database server from a single client thread only (as in v5 and v5.1). EMultiThread allows multiple client threads to share the same session with the server. As multi-threaded programs are uncommon in Symbian OS, this argument can be ignored by most C++ developers

Return value

CContactDatabase *

Pointer to the open contact database.

Leave codes

KErrNotFound

The database file was not found or it did not have the correct UIDs.

KErrLocked

Another client is writing to the database.

KErrDiskFull

The disk does not have enough free space to perform the operation.


OpenL()

Capability: ReadUserData

static IMPORT_C CContactDatabase *OpenL(const TDesC &aFileName, TThreadAccess aAccess=ESingleThread);

Description

Opens a named contact database.

From v9.0 onwards, contact databases can only be located in the correct data caged subdirectory. The filenames must have no path, for example c:contacts.cdb. The maximum length for the drive, filename and extension is 220 characters.

Parameters

const TDesC &aFileName

The filename of the database to open.

TThreadAccess aAccess

The default (ESingleThread) allows access to the session with the database server from a single client thread only (as in v5 and v5.1). EMultiThread allows multiple client threads to share the same session with the server. As multi-threaded programs are uncommon in Symbian OS, this argument can be ignored by most C++ developers

Return value

CContactDatabase *

A pointer to the open contact database.

Leave codes

KErrNotFound

The database file was not found or it did not have the correct UIDs.

KErrLocked

Another client is writing to the database.

KErrBadName

The filename is invalid; for example it contains wildcard characters or the drive is missing.

KErrDiskFull

The disk does not have enough free space to perform the operation.


CreateL()

Capability: WriteUserData

static IMPORT_C CContactDatabase *CreateL(TThreadAccess aAccess=ESingleThread);

Description

Creates and opens an empty contact database using the default database name.

Parameters

TThreadAccess aAccess

The default (ESingleThread) allows access to the session with the database server from a single client thread only (as in v5 and v5.1). EMultiThread allows multiple client threads to share the same session with the server. As multi-threaded programs are uncommon in Symbian OS, this argument can be ignored by most C++ developers

Return value

CContactDatabase *

A pointer to the new contact database.

Leave codes

KErrAlreadyExists

The database already exists.

KErrDiskFull

The disk does not have enough free space to perform the operation.


CreateL()

Capability: WriteUserData

static IMPORT_C CContactDatabase *CreateL(const TDesC &aFileName, TThreadAccess aAccess=ESingleThread);

Description

Creates and opens a named contact database.

From v9.0 onwards, contact databases can only be located in the correct data caged subdirectory. The filenames must have no path, for example c:contacts.cdb. The maximum length for the drive, filename and extension is 220 characters.

Parameters

const TDesC &aFileName

The filename of the database to create.

TThreadAccess aAccess

The default (ESingleThread) allows access to the session with the database server from a single client thread only (as in v5 and v5.1). EMultiThread allows multiple client threads to share the same session with the server. As multi-threaded programs are uncommon in Symbian OS, this argument can be ignored by most C++ developers

Return value

CContactDatabase *

A pointer to the new contact database.

Leave codes

KErrAlreadyExists

The database already exists.

KErrBadName

The filename is invalid; for example it contains wildcard characters or the drive letter is missing.

KErrDiskFull

The disk does not have enough free space to perform the operation.


ReplaceL()

Capability: WriteUserData

static IMPORT_C CContactDatabase *ReplaceL(TThreadAccess aAccess=ESingleThread);

Description

Creates and opens an empty contact database, replacing the existing default database.

Parameters

TThreadAccess aAccess

The default (ESingleThread) allows access to the session with the database server from a single client thread only (as in v5 and v5.1). EMultiThread allows multiple client threads to share the same session with the server. As multi-threaded programs are uncommon in Symbian OS, this argument can be ignored by most C++ developers

Return value

CContactDatabase *

Pointer to the new contact database.

Leave codes

KErrInUse

Another client has an open connection to the database.

KErrDiskFull

The disk does not have enough free space to perform the operation.


ReplaceL()

Capability: WriteUserData

static IMPORT_C CContactDatabase *ReplaceL(const TDesC &aFileName, TThreadAccess aAccess=ESingleThread);

Description

Creates and opens an empty contact database, replacing any existing file with the same name.

From v9.0 onwards, contact databases can only be located in the correct data caged subdirectory. The filenames must have no path, for example c:contacts.cdb. The maximum length for the drive, filename and extension is 220 characters.

Parameters

const TDesC &aFileName

The filename of the database to replace.

TThreadAccess aAccess

The default (ESingleThread) allows access to the session with the database server from a single client thread only (as in v5 and v5.1). EMultiThread allows multiple client threads to share the same session with the server. As multi-threaded programs are uncommon in Symbian OS, this argument can be ignored by most C++ developers

Return value

CContactDatabase *

A pointer to the new contact database.

Leave codes

KErrBadName

The filename is invalid; for example it contains wildcard characters or the drive letter is missing.

KErrInUse

Another client has an open connection to the database.

KErrDiskFull

The disk does not have enough free space to perform the operation.


Open()

Capability: ReadUserData

static IMPORT_C CContactOpenOperation *Open(TRequestStatus &aStatus, TThreadAccess aAccess=ESingleThread);

Description

Opens the default contact database asynchronously.

The Contacts server is asked to prepare the database to be opened. This may include cleaning up incomplete writes from when the device was last switched off, or updating the database format.

If an error is encountered starting the asynchronous open the return value is NULL and the error is returned in the TRequestStatus parameter.

Errors from the asynchronous open include: KErrNotFound The database file was not found or it did not have the correct UIDs. KErrLocked The file is in use by another client. Other system wide error codes.

If the return value is not NULL the ownership of the CContactOpenOperation object is passed to the client. This may be deleted before the asynchronous open completes.

When the client supplied TRequestStatus is completed with KErrNone the TakeDatabase() method of CContactOpenOperation is called to pass ownership of the open database to the client.

Parameters

TRequestStatus &aStatus

On return, the request status for the asynchronous phase request. The Open() action can fail with one of the system wide error codes. In this case, the CContactDatabase object cannot access the database and must be deleted.

TThreadAccess aAccess

This argument should be ignored by developers.

Return value

CContactOpenOperation *

NULL if there is an error starting the asynhchronous open, otherwise a pointer to an active object that manages the open operation.

See also:


Open()

Capability: ReadUserData

static IMPORT_C CContactOpenOperation *Open(const TDesC &aFileName, TRequestStatus &aStatus, TThreadAccess aAccess=ESingleThread);

Description

Opens a named contact database asynchronously.

The Contacts server is asked to prepare the database to be opened. This may include cleaning up incomplete writes from when the device was last switched off, or updating the database format.

In v8.1, contact databases can be located in any directory on any writeable drive, and the format of the filename must include an absolute directory path such as c:\system\data\contacts.cdb.

From v9.0 onwards, contact databases can only be located in the correct data caged subdirectory. The filenames must have no path, for example c:contacts.cdb. The maximum length for the drive, filename and extension is 220 characters.

If an error is encountered starting the asynchronous open the return value is NULL and the error is returned in the TRequestStatus parameter.

Errors from the asynchronous open include: KErrNotFound The database file was not found or it did not have the correct UIDs. KErrLocked The file is in use by another client. KErrBadName The filename is invalid; for example it includes wildcard characters or the drive is missing. Other system wide error codes.

If the return value is not NULL the ownership of the CContactOpenOperation object is passed to the client. This may be deleted before the asynchronous open completes.

When the client supplied TRequestStatus is completed with KErrNone the TakeDatabase() method of CContactOpenOperation is called to pass ownership of the open database to the client.

Parameters

const TDesC &aFileName

The filename of the database to open.

TRequestStatus &aStatus

On return, the request status for the asynchronous phase request. The Open() action can fail with one of the system wide error codes. In this case the CContactDatabase object cannot access the database and must be deleted.

TThreadAccess aAccess

This argument should be ignored by developers.

Return value

CContactOpenOperation *

NULL if there is an error starting the asynhchronous open, otherwise a pointer to an active object that manages the open operation.

See also:


DatabaseDrive()

Capability: Illegal

static IMPORT_C TBool DatabaseDrive(TDriveUnit &aDriveUnit);

Description

Gets the current database drive. The database drive is the drive on which the default contact database is located. Note: this function can leave.

Parameters

TDriveUnit &aDriveUnit

On return, contains the database drive.

Return value

TBool

ETrue if the database drive has been set using SetDatabaseDriveL(). Otherwise EFalse and in this case, the function returns drive c: in aDriveUnit as the current drive.

See also:


NullUidValue()

static inline TInt NullUidValue();

Description

Gets the NULL contact ID value.

Return value

TInt

KNullContactId.


SetDatabaseDriveL()

Capability: WriteUserData

static IMPORT_C void SetDatabaseDriveL(TDriveUnit aDriveUnit, TBool aCopy=ETrue);

Description

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.

In v8.1 when copying the file is moved to \system\data on the specified drive, and if the destination file already exists it is replaced.

From v9.0 onwards the file copying goes to the correct data caged directory on the destination drive. If the destination file already exists the copy fails.

Parameters

TDriveUnit aDriveUnit

The drive to which to move the database.

TBool aCopy

ETrue 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.

Leave codes

KErrNotReady

There is no media present in the drive.

KErrInUse

The destination file for the copy is already open.

KErrNotFound

The source file for the copy was not found.

KErrAlreadyExists

The destination file for the copy already exists, (v9.0).

See also:


GetDefaultNameL()

Capability: Illegal

static IMPORT_C void GetDefaultNameL(TDes &aDes);

Description

Gets the file name of the default contact database.

By default it is on drive C: but this can be changed using SetDatabaseDriveL().

Parameters

TDes &aDes

On return, contains the drive and filename of the default contact database. From v9.0 onwards, this has the form driveletter:filename, in other words, it does not include a path.

See also:


DeleteDefaultFileL()

Capability: WriteUserData

static IMPORT_C void DeleteDefaultFileL();

Description

Deletes the default contact database.

Leave codes

KErrInUse

Another client has the database open.

KErrNotFound

The database file was not found or it did not have the correct UIDs.

See also:


DeleteDatabaseL()

Capability: WriteUserData

static IMPORT_C void DeleteDatabaseL(const TDesC &aFileName);

Description

A static method to delete a named contact database.

If the file is found, it is tested for the correct UIDs.

In v8.1, contact databases can be located in any directory on any writeable drive, and the format of the filename must include an absolute directory path such as c:\system\data\contacts.cdb.

From v9.0 onwards, contact databases can only be located in the correct data caged subdirectory. The filenames must have no path, for example c:contacts.cdb. The maximum length for the drive, filename and extension is 220 characters.

Parameters

const TDesC &aFileName

The contact database file to delete.

Leave codes

KErrBadName

The filename is invalid; for example it contains wildcard characters or the drive is missing.

KErrInUse

Another client has the database open.

KErrNotFound

The database file was not found or it did not have the correct UIDs.

See also:


ListDatabasesL()

Capability: ReadUserData

static IMPORT_C CDesCArray *ListDatabasesL();

Description

A static method to list the contact databases on all drives.

In v8.1, this function finds contact databases located anywhere on the drives, and the format of the returned filenames is c:\system\data\contacts.cdb.

From v9.0 onwards, this function finds contact databases only in the correct data caged subdirectory. The returned filenames have no path, for example c:contacts.cdb. The maximum length for the drive, filename and extension is 220 characters.

In either case, the filenames returned are in the correct format for Open(), OpenL(), CreateL(), ReplaceL() and DeleteDatabaseL().

Return value

CDesCArray *

An array containing zero or more contact database names.

Leave codes

KErrNoMemory

Out of memory.


ListDatabasesL()

Capability: ReadUserData

static IMPORT_C CDesCArray *ListDatabasesL(TDriveUnit aDriveUnit);

Description

A static method to list the contact databases on a specified drive.

In v8.1, this function finds contact databases located anywhere on the drive, and the format of the returned filenames is c:\system\data\contacts.cdb.

From v9.0 onwards, this function finds contact databases only in the correct data caged subdirectory. The returned filenames have no path, for example c:contacts.cdb. The maximum length for the drive, filename and extension is 220 characters.

In either case, the filenames returned are in the correct format for Open(), OpenL(), CreateL(), ReplaceL() and DeleteDatabaseL().

Parameters

TDriveUnit aDriveUnit

The drive unit to search for contact databases.

Return value

CDesCArray *

An array containing zero or more contact database names.

Leave codes

KErrNoMemory

Out of memory.


DefaultContactDatabaseExistsL()

Capability: Illegal

static IMPORT_C TBool DefaultContactDatabaseExistsL();

Description

A static method to determine if the default contact database exists.

It searches the drive set by SetDatabaseDriveL(), or if no drive has been set, it searches drive c:.

If the file is found, it is tested for the correct UIDs.

Return value

TBool

ETrue if the file is found, EFalse otherwise.

Leave codes

KErrNotReady

There is no media present in the drive.

KErrNotFound

The database file was not found or it did not have the correct UIDs.

KErrCorrupt

The file is not a valid database

See also:


ContactDatabaseExistsL()

Capability: Illegal

static IMPORT_C TBool ContactDatabaseExistsL(const TDesC &aFileName);

Description

A method to determine if a named contact database exists.

If the file is found, it is tested for the correct UIDs.

In v8.1, contact databases can be located in any directory on any writeable drive, and the format of the filename must include an absolute directory path such as c:\system\data\contacts.cdb.

From v9.0 onwards, contact databases can only be located in the correct data caged subdirectory. The filenames must have no path, for example c:contacts.cdb. The maximum length for the drive, filename and extension is 220 characters.

Parameters

const TDesC &aFileName

The contact database to search for.

Return value

TBool

ETrue if the file is found, EFalse otherwise.

Leave codes

KErrNotReady

There is no media present in the drive.

KErrBadName

The filename is invalid; for example it contains wildcard characters or the drive is missing.

KErrNotFound

The database file was not found or it did not have the correct UIDs.

KErrCorrupt

The file is not a valid database

See also:


SetViewDefinitionL()

Capability: WriteUserData

IMPORT_C void SetViewDefinitionL(CContactViewDef *aView);

Description

Sets the default view definition. The contact database takes ownership of the view definition specified. The default view definition is used in calls to ReadContactL(), ReadContactLC() and ReadContactAndAgentL() when no view definition is explicitly specified.

Parameters

CContactViewDef *aView

The view definition. This method does nothing if this is null.


SetTextDefinitionL()

IMPORT_C void SetTextDefinitionL(CContactTextDef *aView);

Description

Sets the text definition. The contact database takes ownership of the text definition specified.

Parameters

CContactTextDef *aView

The new text definition.


TextDefinition()

IMPORT_C const CContactTextDef *TextDefinition() const;

Description

Gets a pointer to the text definition.

Return value

const CContactTextDef *

A pointer to the text definition.


CountL()

Capability: Illegal

IMPORT_C TInt CountL();

Description

Gets the number of CContactItems in the database. The count includes non-system template items. It does not include items marked as deleted.

Return value

TInt

The number of contact items in the database.


SetDbViewContactType()

Capability: Illegal

IMPORT_C void SetDbViewContactType(const TUid aUid);

Description

Sets the type of contact items to be included in sorted views of the database.

See also SortL() and SortByTypeL().

This value is initialised to KUidContactItem when the database is opened. This means that all CContactItem-derived types (cards, non-system templates, groups, own cards) are included in database views.

Parameters

const TUid aUid

Specifies a contact type. One of the following: KUidContactCard (contact cards), KUidContactGroup (contact item groups), KUidContactOwnCard (own cards), KUidContactCardTemplate (templates which are not system templates, in other words, which have been added to the database), KUidContactItem (all of the above)


GetDbViewContactType()

IMPORT_C TUid GetDbViewContactType() const;

Description

Gets the type of contact items which are included in sorted views of the database, as set by SetDbViewContactType().

Return value

TUid

Specifies a contact type. One of the following: KUidContactCard (contact cards), KUidContactGroup (contact item groups), KUidContactOwnCard (own cards), KUidContactCardTemplate (templates which are not system, in other words, which have been added to the database), KUidContactItem (all of the above)


AddNewContactL()

Capability: WriteUserData

IMPORT_C TContactItemId AddNewContactL(CContactItem &aContact);

Description

Adds a new contact item to the database and returns its ID.

Parameters

CContactItem &aContact

The contact item to add to the database.

Return value

TContactItemId

The ID of the new contact item.

Leave codes

KErrDiskFull

The disk does not have enough free space to perform the operation.


CreateContactGroupL()

Capability: WriteUserData

IMPORT_C CContactItem *CreateContactGroupL(TBool aInTransaction=EFalse);

Description

Creates a new contact group with a default label of 'Group Label' and adds it to the database.

The caller takes ownership of the returned object.

Parameters

TBool aInTransaction

This argument should be ignored by developers.

Return value

CContactItem *

Pointer to the newly created contact group.


CreateContactGroupLC()

Capability: WriteUserData

IMPORT_C CContactItem *CreateContactGroupLC(TBool aInTransaction=EFalse);

Description

Creates a new contact group with a default label of 'Group Label' and adds it to the database.

The caller takes ownership of the returned object.

Parameters

TBool aInTransaction

This argument should be ignored by developers.

Return value

CContactItem *

Pointer to the newly created contact group.


CreateContactGroupL()

Capability: WriteUserData

IMPORT_C CContactItem *CreateContactGroupL(const TDesC &aGroupLabel, TBool aInTransaction=EFalse);

Description

Creates a new contact group with a specified label and adds it to the database.

The caller takes ownership of the returned object.

Parameters

const TDesC &aGroupLabel

The string to set as the group label.

TBool aInTransaction

This argument should be ignored by developers.

Return value

CContactItem *

Pointer to the newly created contact group.


CreateContactGroupLC()

Capability: WriteUserData

IMPORT_C CContactItem *CreateContactGroupLC(const TDesC &aGroupLabel, TBool aInTransaction=EFalse);

Description

Creates a new contact group with a specified label and adds it to the database.

The pointer to the group is left on the cleanup stack. The caller takes ownership of the returned object.

Parameters

const TDesC &aGroupLabel

The string to set as the group label.

TBool aInTransaction

This argument should be ignored by developers.

Return value

CContactItem *

Pointer to the newly created contact group.

Leave codes

KErrDiskFull

The disk does not have enough free space to perform the operation.


CreateContactCardTemplateL()

Capability: WriteUserData

IMPORT_C CContactItem *CreateContactCardTemplateL(const TDesC &aTemplateLabel, TBool aInTransaction=EFalse);

Description

Creates a contact card template based on the system template and adds it to the database.

A template label must be specifed. This can be changed later using CContactCardTemplate::SetTemplateLabelL().

The caller takes ownership of the returned object.

Parameters

const TDesC &aTemplateLabel

The string to set as the template label.

TBool aInTransaction

This argument should be ignored by developers.

Return value

CContactItem *

Pointer to the contact card template.


CreateContactCardTemplateLC()

Capability: WriteUserData

IMPORT_C CContactItem *CreateContactCardTemplateLC(const TDesC &aTemplateLabel, TBool aInTransaction=EFalse);

Description

Creates a contact card template based on the system template and adds it to the database.

A template label must be specifed. This can be changed later using CContactCardTemplate::SetTemplateLabelL().

The pointer to the template is left on the cleanup stack. The caller takes ownership of the returned object.

Parameters

const TDesC &aTemplateLabel

The string to set as the template label.

TBool aInTransaction

This argument should be ignored by developers.

Return value

CContactItem *

Pointer to the contact card template.

Leave codes

KErrDiskFull

The disk does not have enough free space to perform the operation.


CreateContactCardTemplateL()

Capability: WriteUserData

IMPORT_C CContactItem *CreateContactCardTemplateL(const CContactItem *aTemplate, const TDesC &aTemplateLabel, TBool aInTransaction=EFalse);

Description

Creates a contact card template and adds it to the database.

The new template's field set is based on the specified contact item. This could be a contact card, an own card, another template or even a group. Note that no field data is copied into the new template. All of the new template's fields are marked as template fields.

A template label must be specifed. This can be changed later using CContactCardTemplate::SetTemplateLabelL().

The caller takes ownership of the returned object.

Parameters

const CContactItem *aTemplate

Pointer to an instance of a CContactItem-derived class. This is used to initialise the new template's field set.

const TDesC &aTemplateLabel

The string to set as the template label.

TBool aInTransaction

This argument should be ignored by developers.

Return value

CContactItem *

Pointer to the contact card template.


CreateContactCardTemplateLC()

Capability: WriteUserData

IMPORT_C CContactItem *CreateContactCardTemplateLC(const CContactItem *aTemplate, const TDesC &aTemplateLabel, TBool aInTransaction=EFalse);

Description

Creates a contact card template and adds it to the database.

The new template's field set is based on the specified contact item. This could be a contact card, an own card, another template or even a group. Note that no field data is copied into the new template. All of the new template's fields are marked as template fields.

A template label must be specifed. This can be changed later using CContactCardTemplate::SetTemplateLabelL().

The pointer to the object is left on the cleanup stack. The caller takes ownership of it.

Parameters

const CContactItem *aTemplate

Pointer to an instance of a CContactItem-derived class. This is used to initialise the new template's field set.

const TDesC &aTemplateLabel

The string to set as the template label.

TBool aInTransaction

This argument should be ignored by developers.

Return value

CContactItem *

Pointer to the contact card template.

Leave codes

KErrDiskFull

The disk does not have enough free space to perform the operation.


GetCardTemplateIdListL()

IMPORT_C CContactIdArray *GetCardTemplateIdListL() const;

Description

Gets a copy of the database's template ID list. This is a list of the IDs of all contact card templates which have been added to the database. The caller takes ownership of the returned object.

Return value

CContactIdArray *

Pointer to a copy of the database's template ID list. This does not include the system template. NULL if there are no templates in the database.


GetGroupIdListL()

IMPORT_C CContactIdArray *GetGroupIdListL() const;

Description

Returns a copy of the database's group ID list. This is a list which contains the contact item IDs for each group in the database. The caller takes ownership of the returned object.

Return value

CContactIdArray *

Pointer to an array containing the contact item IDs for each group in the database. NULL if there are no groups in the database.


AddContactToGroupL()

Capability: WriteUserData

IMPORT_C void AddContactToGroupL(TContactItemId aItemId, TContactItemId aGroupId);

Description

Sets a contact item in the database to be a member of a contact group.

The item and group are identified by their IDs.

Parameters

TContactItemId aItemId

The ID of the item to add to the group.

TContactItemId aGroupId

The ID of the group to which the item should be added.

Leave codes

KErrNotFound

Either the group or the item does not exist.

KErrNotSupported

The group is not of type KUidContactGroup.

KErrDiskFull

The disk does not have enough free space to perform the operation.


AddContactToGroupL()

Capability: WriteUserData

IMPORT_C void AddContactToGroupL(CContactItem &aItem, CContactItem &aGroup);

Description

Sets a contact item in the database to be a member of a contact group.

Parameters

CContactItem &aItem

The item to add to the group.

CContactItem &aGroup

The group to which the item should be added.

Leave codes

KErrNotFound

Either the group or the item does not exist in the database.

KErrNotSupported

The group is not of type KUidContactGroup.

KErrDiskFull

The disk does not have enough free space to perform the operation.


AddContactToGroupL()

Capability: WriteUserData

IMPORT_C void AddContactToGroupL(TContactItemId aItemId, TContactItemId aGroupId, TBool aInTransaction);

Description

Sets a contact item in the database to be a member of a contact group.

The item and group are identified by their IDs.

Parameters

TContactItemId aItemId

The ID of the item to add to the group.

TContactItemId aGroupId

The ID of the group to which the item should be added.

TBool aInTransaction

This argument should be ignored by developers.

Leave codes

KErrNotFound

Either the group or the item does not exist.

KErrNotSupported

The group is not of type KUidContactGroup.

KErrDiskFull

The disk does not have enough free space to perform the operation.


RemoveContactFromGroupL()

Capability: WriteUserData

IMPORT_C void RemoveContactFromGroupL(CContactItem &aItem, CContactItem &aGroup);

Description

Removes the association between a contact item and a group.

Parameters

CContactItem &aItem

The item to remove.

CContactItem &aGroup

The group from which the item should be removed.

Leave codes

KErrDiskFull

The disk does not have enough free space to perform the operation.


RemoveContactFromGroupL()

Capability: WriteUserData

IMPORT_C void RemoveContactFromGroupL(TContactItemId aItemId, TContactItemId aGroupId);

Description

Removes the association between a contact item and a group.

The item and group are identified by their IDs.

Parameters

TContactItemId aItemId

The ID of the item to remove.

TContactItemId aGroupId

The ID of the group from which the item should be removed.

Leave codes

KErrDiskFull

The disk does not have enough free space to perform the operation.


GroupCount()

inline TInt GroupCount() const;

Description

Gets the number of groups that exist in the database.

Return value

TInt

The number of groups that exist in the database.


TemplateCount()

inline TInt TemplateCount() const;

Description

Gets the number of contact card templates that exist in the database. This does not include the system template.

Return value

TInt

The number of contact card templates that exist in the database.


SetFieldAsSpeedDialL()

Capability: ReadUserData
Capability: WriteUserData

IMPORT_C void SetFieldAsSpeedDialL(CContactItem &aItem, TInt aFieldIndex, TInt aSpeedDialPosition);

Description

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 speed dial attribute can be tested for using the CContactItemField::IsSpeedDial() function.

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.

Parameters

CContactItem &aItem

The contact item containing the field to set as a speed dial field.

TInt aFieldIndex

Index of a field in aItem's field set to set as a speed dial field.

TInt aSpeedDialPosition

The speed dial position. This is an integer in the range 1 to 9 inclusive. If outside this range, the function leaves with KErrArgument.

Leave codes

KErrDiskFull

The disk does not have enough free space to perform the operation.


GetSpeedDialFieldL()

Capability: ReadUserData

IMPORT_C TContactItemId GetSpeedDialFieldL(TInt aSpeedDialPosition, TDes &aPhoneNumber);

Description

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.

Parameters

TInt aSpeedDialPosition

The speed dial position. This is an integer in the range 1 to 9 inclusive. If outside this range, the function leaves with KErrArgument.

TDes &aPhoneNumber

On 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.

Return value

TContactItemId

The ID of the contact item for which the speed dial has been set.


RemoveSpeedDialFieldL()

Capability: ReadUserData
Capability: WriteUserData

IMPORT_C void RemoveSpeedDialFieldL(TContactItemId aContactId, TInt aSpeedDialPosition);

Description

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.

Parameters

TContactItemId aContactId

The ID of the contact item containing the speed dial field.

TInt aSpeedDialPosition

The speed dial position. This is an integer in the range 1 to 9 inclusive. If outside this range, the function leaves with KErrArgument.

Leave codes

KErrDiskFull

The disk does not have enough free space to perform the operation.


ReadMinimalContactL()

Capability: ReadUserData

IMPORT_C CContactItem *ReadMinimalContactL(TContactItemId aContactId);

Description

Reads a contact item (contact card, own card, template, or contact group), but does not read the group or template information.

This function is identical to the variant of ReadContactL() which uses the database's default view definition, except that this function does not read:

Notes:

This function is faster than the standard reading function (ReadContactL()), which needs to match the template fields and groups etc.

The caller takes ownership of the returned object.

Parameters

TContactItemId aContactId

The ID of the contact to read.

Return value

CContactItem *

Pointer to the contact whose ID is aContactId.

Leave codes

KErrNotFound

The specified contact item cannot be found in the database.


ReadMinimalContactLC()

Capability: ReadUserData

IMPORT_C CContactItem *ReadMinimalContactLC(TContactItemId aContactId);

Description

Reads a contact item (contact card, own card, template, or contact group), but does not read the group or template information.

This function is identical to the variant of ReadContactLC() which uses the server's default view definition, except that this function does not read:

Notes:

This function is faster than the standard reading function (ReadContactLC()), which needs to match the template fields and groups etc.

The caller takes ownership of the returned object.

Parameters

TContactItemId aContactId

The ID of the contact to read.

Return value

CContactItem *

Pointer to the contact whose ID is aContactId. The contact is left on the cleanup stack.

Leave codes

KErrNotFound

The specified contact item cannot be found in the database.


ReadContactL()

Capability: ReadUserData

IMPORT_C CContactItem *ReadContactL(TContactItemId aContactId);

Description

Reads a contact item without locking it.

This function uses the default view definition (as set by SetViewDefinitionL()). The caller takes ownership of the returned object.

Parameters

TContactItemId aContactId

The ID of the contact item to read.

Return value

CContactItem *

Pointer to the contact item.

Leave codes

KErrNotFound

The specified contact item does not exist in the database.


ReadContactAndAgentL()

Capability: ReadUserData

IMPORT_C CArrayPtr< CContactItem > *ReadContactAndAgentL(TContactItemId aContactId);

Description

Reads a contact item and an agent if the item has an agent field. The item and agent (if present) are returned in an array. The function uses the database's default view definition (as set by SetViewDefinitionL()). The caller takes ownership of the returned object.

Parameters

TContactItemId aContactId

The ID of the contact item to read.

Return value

CArrayPtr< CContactItem > *

Pointer to an array containing the contact item and agent, if present.

Leave codes

KErrNotFound

The specified contact item cannot be found in the database.


ReadContactL()

Capability: ReadUserData

IMPORT_C CContactItem *ReadContactL(TContactItemId aContactId, const CContactItemViewDef &aViewDef);

Description

Reads a contact item without locking it.

This function uses the view definition specified. The caller takes ownership of the returned object.

Parameters

TContactItemId aContactId

The ID of the contact item to read.

const CContactItemViewDef &aViewDef

The view definition to use.

Return value

CContactItem *

Pointer to the contact item.

Leave codes

KErrNotFound

The specified contact item does not exist in the database.


ReadContactLC()

Capability: ReadUserData

IMPORT_C CContactItem *ReadContactLC(TContactItemId aContactId);

Description

Reads a contact item without locking it.

This function uses the default view definition (as set by SetViewDefinitionL()). The caller takes ownership of the returned object.

Parameters

TContactItemId aContactId

The ID of the contact item to read.

Return value

CContactItem *

Pointer to the contact item. This is left on the cleanup stack.

Leave codes

KErrNotFound

The specified contact item does not exist in the database.


ReadContactLC()

Capability: ReadUserData

IMPORT_C CContactItem *ReadContactLC(TContactItemId aContactId, const CContactItemViewDef &aViewDef);

Description

Reads a contact item without locking it.

This function uses the view definition specified. The caller takes ownership of the returned object.

Parameters

TContactItemId aContactId

The ID of the contact item to read.

const CContactItemViewDef &aViewDef

The view definition to use.

Return value

CContactItem *

Pointer to the contact item. This is left on the cleanup stack.

Leave codes

KErrNotFound

The specified contact item does not exist in the database.


ReadContactTextDefL()

Capability: ReadUserData

IMPORT_C void ReadContactTextDefL(const CContactItem &aItem, TDes &aResult);

Description

Reads text into a descriptor from a pre-loaded contact item.

This function uses the database's current text definition (as set using CContactDatabase::SetTextDefinitionL()).

Parameters

const CContactItem &aItem

The contact item to read.

TDes &aResult

On return, contains the text read from the contact item aItem, using the database's current text definition.


ReadContactTextDefL()

Capability: ReadUserData

IMPORT_C void ReadContactTextDefL(const CContactItem &aItem, TDes &aResult, CContactTextDef *aTextDef);

Description

Reads text into a descriptor from a pre-loaded contact item, using the specified text definition.

Parameters

const CContactItem &aItem

The contact item to read.

TDes &aResult

On return, contains the text read from the contact item aItem, using the text definition specified in aTextDef.

CContactTextDef *aTextDef

The text definition to use.


ReadContactTextDefL()

Capability: ReadUserData

IMPORT_C void ReadContactTextDefL(TContactItemId aContactId, TDes &aResult);

Description

Reads text from a contact item stored in the database into a descriptor.

This function uses the database's currently set text definition (as set using CContactDatabase::SetTextDefinitionL()).

Parameters

TContactItemId aContactId

The ID of the contact to read.

TDes &aResult

On return, contains the text read from the contact item identified by aContactId, using the database's current text definition.

Leave codes

KErrNotFound

The specified contact item cannot be found in the database.


ReadContactTextDefL()

Capability: ReadUserData

IMPORT_C void ReadContactTextDefL(TContactItemId aContactId, TDes &aResult, CContactTextDef *aTextDef);

Description

Reads text from a contact item stored in the database into a descriptor using the specified text definition.

Parameters

TContactItemId aContactId

The ID of the contact to read.

TDes &aResult

On return, contains the text read from the contact item identified by aContactId, using the text definition specified in aTextDef.

CContactTextDef *aTextDef

The text definition to use.

Leave codes

KErrNotFound

The specified contact item cannot be found in the database.


OpenContactL()

Capability: WriteUserData

IMPORT_C CContactItem *OpenContactL(TContactItemId aContactId);

Description

Opens a contact item for editing.

The returned contact item is locked and left open until either CommitContactL() or CloseContactL() is called.

This function uses a view definition that loads every field. If you need to specify your own view definition use the other overload of this function.

The caller takes ownership of the returned object.

Parameters

TContactItemId aContactId

The ID of the contact item to open.

Return value

CContactItem *

The open, locked contact.

Leave codes

KErrInUse

The contact item is already open.

KErrNotFound

The contact item is not present in the database.


OpenContactL()

Capability: WriteUserData

IMPORT_C CContactItem *OpenContactL(TContactItemId aContactId, const CContactItemViewDef &aViewDef);

Description

Opens a contact item for editing, leaving the lock record on the cleanup stack.

The returned item is locked and left open until either CommitContactL() or CloseContactL() is called.

This function uses the specified view definition. Note: Care should be taken when specifying a view definition because when committing the contact item any fields not loaded by the view definition are deleted from the item.

The caller takes ownership of the returned object.

Parameters

TContactItemId aContactId

The ID of the contact item to open.

const CContactItemViewDef &aViewDef

The view definition.

Return value

CContactItem *

The open, locked contact item.

Leave codes

KErrInUse

The contact item is already open

KErrNotFound

The contact item is not present in the database.


OpenContactLX()

Capability: WriteUserData

IMPORT_C CContactItem *OpenContactLX(TContactItemId aContactId);

Description

Opens a contact item for editing using a specified view definition.

The returned contact item is locked and left open until either CommitContactL() or CloseContactL() is called.

Note: care should be taken when specifying a view definition because when committing the contact item, any fields not loaded by the view definition are deleted from the item.

The caller takes ownership of the returned object.

Parameters

TContactItemId aContactId

The ID of the contact item to open.

Return value

CContactItem *

The open, locked contact.

Leave codes

KErrInUse

The contact item is already open.

KErrNotFound

The contact item is not present in the database.


OpenContactLX()

Capability: WriteUserData

IMPORT_C CContactItem *OpenContactLX(TContactItemId aContactId, const CContactItemViewDef &aViewDef);

Description

Opens a contact item for editing, leaving the lock record on the cleanup stack.

The returned item is locked and left open until either CommitContactL() or CloseContactL() is called.

This function uses the specified view definition. Note: Care should be taken when specifying a view definition because when committing the contact item any fields not loaded by the view definition are deleted from the item.

The caller takes ownership of the returned object.

Parameters

TContactItemId aContactId

The ID of the contact item to open.

const CContactItemViewDef &aViewDef

The view definition.

Return value

CContactItem *

The open, locked contact item.

Leave codes

KErrInUse

The contact item is already open

KErrNotFound

The contact item is not present in the database.


CloseContactL()

Capability: Illegal

IMPORT_C void CloseContactL(TContactItemId aContactId);

Description

Closes the contact item, allowing other applications to access it. Specifying a contact item that is not open, or cannot be found, is harmless. This function does not commit any changes made to the item. Despite the trailing L in the function's name, this function cannot leave.

Parameters

TContactItemId aContactId

The ID of the contact to close.


CommitContactL()

Capability: ReadUserData
Capability: WriteUserData

IMPORT_C void CommitContactL(const CContactItem &aContact);

Description

Overwrites a contact item with the values contained in aContact. The contact item is also closed by this call.

Parameters

const CContactItem &aContact

Contains the new values for the contact item.

Leave codes

KErrAccessDenied

The contact item is not locked by the caller.

KErrNotFound

The contact item's ID is not present in the database.

KErrDiskFull

The disk does not have enough free space to perform the operation.

KErrNotSupported

The contact item cannot be committed because it contains invalid data.


DeleteContactL()

Capability: ReadUserData
Capability: WriteUserData

IMPORT_C void DeleteContactL(TContactItemId aContactId);

Description

Deletes a contact item.

Note: if the contact's access count is greater than zero, the contact is not fully deleted from the database. A 'skeleton' of the contact is left, containing only basic information, and no field data. The skeleton contact can still be accessed if a record of its contact ID has been retained (or call DeletedContactsLC()). The skeleton is removed when the access count is zero.

Parameters

TContactItemId aContactId

The contact item ID of the contact to delete.

Leave codes

KErrNotFound

aContactId is not present in the database.

KErrInUse

The contact item is open.

KErrDiskFull

The disk does not have enough free space to perform the operation.


DeleteContactsL()

Capability: ReadUserData
Capability: WriteUserData

IMPORT_C void DeleteContactsL(const CContactIdArray &aContactIds);

Description

Deletes an array of contacts.

The function commits the changes for every 16 contacts deleted, and compresses the database as required. A changed message is not sent for every contact deleted, instead a single unknown change event message (EContactDbObserverEventUnknownChanges) is sent after all the contacts have been deleted and the changes committed.

Parameters

const CContactIdArray &aContactIds

An array of contacts to delete.

Leave codes

KErrNotFound

A contact item ID contained in the array is not present in the database.

KErrInUse

One or more of the contact items is open.

KErrDiskFull

The disk does not have enough free space to perform the operation.


ImportContactsL()

Capability: WriteUserData

IMPORT_C CArrayPtr< CContactItem > *ImportContactsL(const TUid &aFormat, RReadStream &aReadStream, TBool &aImportSuccessful, TInt aOption);

Description

Imports one or more vCards from a read stream. The vCards are converted into contact items, and added to the database. If at least one contact item was successfully imported, aImportSuccessful is set to ETrue. If EImportSingleContact is specified in aOption, the read stream marker is left at the next position, ready to read the next contact item. The caller takes ownership of the returned object.

Parameters

const TUid &aFormat

Indicates the format for imported and exported contacts. Its value must be KUidVCardConvDefaultImpl.

RReadStream &aReadStream

The stream to read from.

TBool &aImportSuccessful

On return, ETrue if at least one contact was successfully imported. EFalse if not.

TInt aOption

Indicates the options for import and export. See the TOptions enum.

Return value

CArrayPtr< CContactItem > *

The array of contact items imported.

Leave codes

KErrNotSupported

aFormat.iUid is not KUidVCardConvDefaultImpl.


ExportSelectedContactsL()

Capability: ReadUserData

IMPORT_C void ExportSelectedContactsL(const TUid &aFormat, const CContactIdArray &aSelectedContactIds, RWriteStream &aWriteStream, TInt aOption, TBool aExportPrivateFields=ETrue);

Description

Converts an array of contact items to vCards and exports them to a write stream.

The default character set CVersitParser::EUTF8CharSet is used to convert into. If you need a different character set, use the other overload of this function.

Parameters

const TUid &aFormat

Indicates the format for imported and exported contacts. Must have a value of KUidVCardConvDefaultImpl.

const CContactIdArray &aSelectedContactIds

Array of contact IDs to export.

RWriteStream &aWriteStream

The stream to write to.

TInt aOption

Indicates the options for import and export. See the TOptions enum.

TBool aExportPrivateFields

ETrue exports fields marked as private. EFalse does not export fields marked as private. See CContactItemField::SetPrivate().

Leave codes

KErrNotSupported

aFormat.iUid is not KUidVCardConvDefaultImpl.

KErrNotFound

One or more of the contact items does not exist in the database.


ExportSelectedContactsL()

Capability: ReadUserData

IMPORT_C void ExportSelectedContactsL(const TUid &aFormat, const CContactIdArray &aSelectedContactIds, RWriteStream &aWriteStream, TInt aOption, const Versit::TVersitCharSet aCharSet, TBool aExportPrivateFields=ETrue);

Description

Converts an array of contact items to vCards and exports them to a write stream using the specified character set.

Parameters

const TUid &aFormat

Indicates the format for imported and exported contacts. Must have a value of KUidVCardConvDefaultImpl.

const CContactIdArray &aSelectedContactIds

Array of contact IDs to export.

RWriteStream &aWriteStream

The stream to write to.

TInt aOption

Indicates the options for import and export. See the TOptions enum.

const Versit::TVersitCharSet aCharSet

The character set to convert into.

TBool aExportPrivateFields

ETrue exports fields marked as private. EFalse does not export fields marked as private. See CContactItemField::SetPrivate().

Leave codes

KErrNotSupported

aFormat.iUid is not KUidVCardConvDefaultImpl.

KErrNotFound

One or more of the contact items does not exist in the database.


CompactL()

Capability: WriteUserData

IMPORT_C void CompactL();

Description

Compacts the database to its minimum size synchronously.


FindLC()

IMPORT_C CContactIdArray *FindLC(const TDesC &aText, const CContactItemFieldDef *aFieldDef);

Description

Searches the database for a text string. The function searches the fields contained in the field definition. The caller takes ownership of the returned object. There is a limit of 255 characters on the search string length, due to the implementation of the DBMS API, which also has a search string length restriction of 255 chars. If the search string passed in is over 255 characters this method will leave with KErrArgument.

Parameters

const TDesC &aText

The text to search for.

const CContactItemFieldDef *aFieldDef

Specifies the fields to search.

Return value

CContactIdArray *

Array of contact IDs identifying the contact items which contain the specified text.


FindAsyncL()

IMPORT_C CIdleFinder *FindAsyncL(const TDesC &aText, const CContactItemFieldDef *aFieldDef, MIdleFindObserver *aObserver);

Description

Searches the database asynchronously for a text string. The function searches the fields contained in the field definition asynchronously using the MIdleFindObserver and CIdleFinder classes. The caller takes ownership of the returned object.

Parameters

const TDesC &aText

The text to search for.

const CContactItemFieldDef *aFieldDef

Specifies the fields to search.

MIdleFindObserver *aObserver

Implements the callback function IdleFindCallback(). NULL if no observer is needed.

Return value

CIdleFinder *

A CIdle-derived object which provides information about the progress of the operation, and which can be used to retrieve an array of contact IDs.


FindInTextDefLC()

IMPORT_C CContactIdArray *FindInTextDefLC(const MDesC16Array &aFindWords, const TCallBack &aWordParserCallback);

Description

Enables the user to search the database for a string containing text that is stored in one or more fields.

The string is specified as an array of words.

For example, a user might want to search for the string "John Smith". To the user the string is a single item, but the text which makes up the string is stored in two separate fields in the database.

The caller of this function needs to provide an array of words to find (aFindWords), and a function to break down the text in the contact item into a list of words (aWordParserCallback).

The array of words to find would typically not contain punctuation. For example if the user searches for 'Smith, John' this would be passed to this function as an array of two words: 'Smith' and 'John', with the separator being discarded.

For a match to succeed, all words in the aFindWords array must match words in the array generated from the contact item by the aWordParserCallback function. To match, the word generated from the contact item must begin with the search word, i.e. a search for "Sm" would find any word beginning in "Sm". If a word is specified twice in the aFindWords array, then it must exist in two separate places in the contact item.

The function only searches the fields contained in the currently set text definition.

The caller takes ownership of the returned object.

Parameters

const MDesC16Array &aFindWords

An array of words to find.

const TCallBack &aWordParserCallback

A function supplied by the caller to break the text in the contact down into a list of words.

Return value

CContactIdArray *

Array of contact IDs.


FindInTextDefLC()

IMPORT_C CContactIdArray *FindInTextDefLC(const MDesC16Array &aFindWords, CContactTextDef *aTextDef, const TCallBack &aWordParserCallback);

Description

Enables the user to search the database for a string containing text that is stored in one or more fields.

The string is specified as an array of words.

For example, a user might want to search for the string "John Smith". To the user the string is a single item, but the text which makes up the string is stored in two separate fields in the database.

The caller of this function needs to provide an array of words to find (aFindWords), and a function to break down the text in the contact item into a list of words (aWordParserCallback).

The array of words to find would typically not contain punctuation. For example if the user searches for 'Smith, John' this would be passed to this function as an array of two words: 'Smith' and 'John', with the separator being discarded.

For a match to succeed, all words in the aFindWords array must match words in the array generated from the contact item by the aWordParserCallback function. To match, the word generated from the contact item must begin with the search word, i.e. a search for "Sm" would find any word beginning in "Sm". If a word is specified twice in the aFindWords array, then it must exist in two separate places in the contact item.

The function only searches the fields contained in the text definition aTextDef.

The caller takes ownership of the returned object.

Parameters

const MDesC16Array &aFindWords

An array of words to find.

CContactTextDef *aTextDef

The text definition.

const TCallBack &aWordParserCallback

A function supplied by the caller to break the text in the contact down into a list of words.

Return value

CContactIdArray *

Array of contact IDs.


FindInTextDefAsyncL()

IMPORT_C CIdleFinder *FindInTextDefAsyncL(const MDesC16Array &aFindWords, MIdleFindObserver *aObserver, const TCallBack &aWordParserCallback);

Description

Asynchronously searches the database for an array of words.

This function works in the same way as its corresponding variant in FindInTextDefLC(), except that it operates asynchronously using the MIdleFindObserver and CIdleFinder classes. The caller takes ownership of the returned object.

Parameters

const MDesC16Array &aFindWords

An array of words to find.

MIdleFindObserver *aObserver

Implements the callback function IdleFindCallback(). May be NULL if no observer is needed.

const TCallBack &aWordParserCallback

A function to break the text in the contact down into a list of words.

Return value

CIdleFinder *

A CIdle-derived object which provides information about the progress of the operation, and which can be used to retrieve an array of contact IDs.


FindInTextDefAsyncL()

IMPORT_C CIdleFinder *FindInTextDefAsyncL(const MDesC16Array &aFindWords, const CContactTextDef *aTextDef, MIdleFindObserver *aObserver, const TCallBack &aWordParserCallback);

Description

Asynchronously searches the database for an array of words.

This function works in the same way as its corresponding variant in FindInTextDefLC(), except that it operates asynchronously using the MIdleFindObserver and CIdleFinder classes. The caller takes ownership of the returned object.

Parameters

const MDesC16Array &aFindWords

An array of words to find.

const CContactTextDef *aTextDef

The text definition.

MIdleFindObserver *aObserver

Implements the callback function IdleFindCallback(). May be NULL if no observer is needed.

const TCallBack &aWordParserCallback

A function to break the text in the contact down into a list of words.

Return value

CIdleFinder *

A CIdle-derived object which provides information about the progress of the operation, and which can be used to retrieve an array of contact IDs.


SortArrayL()

Capability: Illegal

IMPORT_C CContactIdArray *SortArrayL(const CContactIdArray *aIdArray, const CArrayFix< TSortPref > *aSortOrder);

Description

Sorts an array of contact IDs. The sort uses the same logic as SortL(). The caller takes ownership of the returned object.

Parameters

const CContactIdArray *aIdArray

Pointer to array of contact IDs to sort.

const CArrayFix< TSortPref > *aSortOrder

Sort order array.

Return value

CContactIdArray *

Pointer to sorted array of contact IDs.


SortArrayLC()

Capability: Illegal

IMPORT_C CContactIdArray *SortArrayLC(const CContactIdArray *aIdArray, const CArrayFix< TSortPref > *aSortOrder);

Description

Sorts an array of contact IDs. The sort uses the same logic as SortL(). The returned array is left on the cleanup stack. The caller takes ownership of the returned object.

Parameters

const CContactIdArray *aIdArray

Pointer to array of contact IDs to sort.

const CArrayFix< TSortPref > *aSortOrder

Sort order array.

Return value

CContactIdArray *

Pointer to sorted array of contact IDs.


SortByTypeL()

Capability: Illegal

IMPORT_C void SortByTypeL(CArrayFix< TSortPref > *aSortOrder);

Description

Sorts the database using the view type value set by SetDbViewContactType(). The database takes ownership of the sort order array passed in.

The sort uses the same logic as SortL(). The two functions have the same effect.

After calling this function, use CContactDatabase::SortedItemsL() to retrieve the sorted array of contact IDs.

Parameters

CArrayFix< TSortPref > *aSortOrder

Sort order array.


SortL()

Capability: Illegal

IMPORT_C void SortL(CArrayFix< TSortPref > *aSortOrder);

Description

Sorts the database. The sort only includes items of the type set by SetDbViewContactType(). The database takes ownership of the sort order array passed in. Contacts are sorted using the first TSortPref in the array. Any identical matches are then sorted using the next TSortPref and so on. When there are no more TSortPrefs to use, any remaining unsorted contacts are left in the original database order.

Note: after calling this function, use CContactDatabase::SortedItemsL() to retrieve the sorted array of contact IDs.

Parameters

CArrayFix< TSortPref > *aSortOrder

Sort order array. If the array's count is zero, no sorting takes place.


SortAsyncL()

IMPORT_C void SortAsyncL(CArrayFix< TSortPref > *aSortOrder, TRequestStatus &aStatus);

Description

aSortOrder is owned by the idle sorter.

Parameters

CArrayFix< TSortPref > *aSortOrder

Specifies the sort order

TRequestStatus &aStatus

The request status for the asynchronous phase request.


CancelAsyncSort()

IMPORT_C void CancelAsyncSort();

Description

Cancel the CCntIdleSorter object and clean up resources.


SortAsyncL()

IMPORT_C void SortAsyncL(CArrayFix< TSortPref > *aSortOrder, TRequestStatus &aStatus, MContactSortObserver &aObserver);

Description

aSortOrder is owned by the idle sorter.

Parameters

CArrayFix< TSortPref > *aSortOrder

Specifies the sort order

TRequestStatus &aStatus

The request status for the asynchronous phase request.

MContactSortObserver &aObserver


FileUid()

Capability: Illegal

IMPORT_C TPtrC FileUid();

Description

Gets the database's UID. This value is used to identify a particular contact database. The database UID is generated when the database is first created.

Return value

TPtrC

Descriptor containing the database UID.


CreateCompressorLC()

Capability: WriteUserData

IMPORT_C CContactActiveCompress *CreateCompressorLC();

Description

Creates an active compressor to compress the database with an active object.

An observer set up on the active compressor can be used to provide progress information. The caller takes ownership of the returned object.

Return value

CContactActiveCompress *

Pointer to an active compressor.


CreateRecoverLC()

Capability: WriteUserData

IMPORT_C CContactActiveRecover *CreateRecoverLC();

Description

Creates an active recoverer object to recover the database using an active object. The caller takes ownership of the returned object.

Return value

CContactActiveRecover *

Pointer to an active recoverer.


RecoverL()

Capability: WriteUserData

IMPORT_C void RecoverL();

Description

Recovers the database from a rollback. It first closes all tables and then reopens them after the recover.


IsDamaged()

Capability: Illegal

IMPORT_C TBool IsDamaged() const;

Description

Tests whether the database is damaged and needs to be recovered.

Return value

TBool

ETrue if the database is damaged and needs recovery, EFalse otherwise.


CompressRequired()

Capability: Illegal

IMPORT_C TBool CompressRequired();

Description

Tests whether a compress is recommended. This function provides an easy way of testing whether the database is being used efficiently.

ETrue is returned if:

Return value

TBool

ETrue if a compress is recommended, EFalse if not or if an error occurred.


CloseTables()

Capability: Illegal

IMPORT_C void CloseTables();

Description

Closes all database tables. After a rollback and recover all tables need to be closed and re-opened before the database can be accessed again.


OpenTablesL()

Capability: ReadUserData

IMPORT_C void OpenTablesL();

Description

Opens all database tables. After a rollback and recover all tables need to be closed and re-opened before the database can be accessed again.


MatchPhoneNumberL()

Capability: ReadUserData

IMPORT_C CContactIdArray *MatchPhoneNumberL(const TDesC &aNumber, TInt aMatchLengthFromRight);

Description

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.

The comparison method used is not exact. The number is compared starting from the right side of the number and the method returns an array of candidate matches. Punctuation (eg. spaces) and other alphabetic characters are ignored when comparing.

Additionally, if the contacts model phone parser (CNTPHONE.DLL) is available, then any DTMF digits are also excluded from the comparision.

Notes: Due to the way numbers are stored in the database, it is recommended that at least 7 match digits are specified even when matching a number containing fewer digits. Failure to follow this guideline may (depending on the database contents) mean that the function will not return the expected Contacts Id set.

Parameters

const TDesC &aNumber

Phone number string. If the length of phone number string is greater than KCntMaxTextFieldLength then only the first KCntMaxTextFieldLength characters are used in the match.

TInt aMatchLengthFromRight

Number 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.

Return value

CContactIdArray *

CContactIdArray of candidate matches


SortedItemsL()

Capability: Illegal

IMPORT_C const CContactIdArray *SortedItemsL();

Description

Returns a pointer to the array of contact items which have been sorted by either SortByTypeL() or SortL(). This pointer is valid until a change is made to the database or until the database's active object is allowed to run. If the array is required after one of the above two events has occurred, a copy of the array must first be made.

Return value

const CContactIdArray *

A pointer to the array of sorted items. The caller does not take ownership of this object.


TemplateId()

IMPORT_C TContactItemId TemplateId() const;

Description

Gets the ID of the system template. This can then be read, opened and committed like any other contact item.

Return value

TContactItemId

ID of the system template.


CreateOwnCardLC()

Capability: WriteUserData

IMPORT_C CContactItem *CreateOwnCardLC();

Description

Creates a default own card based on the system template and adds it to the database. This is set as the database's current own card, replacing any existing current own card. The caller takes ownership of the returned object.

Return value

CContactItem *

Pointer to the new default own card. The pointer is left on the cleanup stack.


CreateOwnCardL()

Capability: WriteUserData

IMPORT_C CContactItem *CreateOwnCardL();

Description

Creates a default own card based on the system template and adds it to the database. This is set as the database's current own card, replacing any existing current own card. The caller takes ownership of the returned object.

Return value

CContactItem *

Pointer to the new default own card.


OwnCardId()

Capability: Illegal

IMPORT_C TContactItemId OwnCardId() const;

Description

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

Return value

TContactItemId

The ID of the database's current own card. KNullContactId if the own card has been deleted or has not yet been set.


SetOwnCardL()

Capability: WriteUserData

IMPORT_C void SetOwnCardL(const CContactItem &aContact);

Description

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

Parameters

const CContactItem &aContact

The 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.

Leave codes

KErrNotFound

aContact does not exist in the database.

KErrDiskFull

The disk does not have enough free space to perform the operation.


PrefTemplateId()

Capability: Illegal

IMPORT_C TContactItemId PrefTemplateId() const;

Description

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

Return value

TContactItemId

The ID of the database's current preferred template.


SetPrefTemplateL()

Capability: WriteUserData

IMPORT_C void SetPrefTemplateL(const CContactItem &aContact);

Description

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.

Parameters

const CContactItem &aContact

The contact card template to set as the database's preferred template.

Leave codes

KErrNotSupported

The item is not a template (of type KUidContactCardTemplate).

KErrDiskFull

The disk does not have enough free space to perform the operation.


SetCurrentItem()

Capability: WriteUserData

IMPORT_C void SetCurrentItem(const TContactItemId aContactId);

Description

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.

Parameters

const TContactItemId aContactId

The ID of the current item.


GetCurrentItem()

Capability: Illegal

IMPORT_C TContactItemId GetCurrentItem() const;

Description

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

Return value

TContactItemId

The ID of the current item.


SetDateFormatTextL()

IMPORT_C void SetDateFormatTextL(const TDesC &aFormat);

Description

This function is not currently supported.

Parameters

const TDesC &aFormat

This parameter should be ignored.


FilterDatabaseL()

Capability: ReadUserData

IMPORT_C void FilterDatabaseL(CCntFilter &aFilter);

Description

Filters the database. On return, aFilter contains an array of filtered contact item IDs.

Parameters

CCntFilter &aFilter

The filter to use. On return, contains a filtered array of contact item IDs.


ContactsChangedSinceL()

Capability: ReadUserData

IMPORT_C CContactIdArray *ContactsChangedSinceL(const TTime &aTime);

Description

Gets an array of contacts modified since the specified date/time. The array includes those contacts that have changed since the beginning of the specified micro-second. The caller takes ownership of the returned object.

Parameters

const TTime &aTime

The date/time of interest.

Return value

CContactIdArray *

Pointer to the array of contacts modified since the specified time.


SetLastSyncDateL()

IMPORT_C TContactSyncId SetLastSyncDateL(const TTime &aSyncDate);

Description

Sets the date/time the database was last synchronised.

This overload sets the last synchronised date/time where the sync ID is not known, and returns the sync ID that was created (a sync ID identifies a machine with which the database has been synchronised).

Parameters

const TTime &aSyncDate

The database's new last synchronised date/time.

Return value

TContactSyncId

The sync ID created by the function.


SetLastSyncDateL()

IMPORT_C void SetLastSyncDateL(TContactSyncId aSyncId, const TTime &aSyncDate);

Description

Sets the date/time the database was last synchronised.

This overload is for a known sync ID and updates the database's last synchronised date/time for that ID.

Parameters

TContactSyncId aSyncId

This argument should be ignored by developers.

const TTime &aSyncDate

The database's new last synchronised date/time.

Leave codes

KErrNotFound

The specified sync ID is not found.


GetLastSyncDateL()

IMPORT_C void GetLastSyncDateL(TContactSyncId aSyncId, TTime &aSyncDate);

Description

Gets the date/time the database was last synchronised with a particular sync ID, as set by SetLastSyncDateL().

Parameters

TContactSyncId aSyncId

This argument should be ignored by developers.

TTime &aSyncDate

On return contains the date/time the database was last synchronised with the sync ID specified.

Leave codes

KErrNotFound

The ID cannot be found in the database.


FileSize()

Capability: Illegal

IMPORT_C TInt FileSize() const;

Description

Gets the size of the database file in bytes.

Return value

TInt

The size of the contact database.


WastedSpaceInBytes()

Capability: Illegal

IMPORT_C TInt WastedSpaceInBytes() const;

Description

Gets the amount of wasted space in the database in bytes. This is the database's size minus the amount of data in it.

Return value

TInt

The wasted space in the contacts database.


ConnectionId()

Capability: Illegal

IMPORT_C TUint ConnectionId() const;

Description

Gets the ID of the connection to the Contacts server.

This can be compared with the connection IDs of incoming messages to identify which connection generated the message.

Return value

TUint

The ID of the connection to the Contacts server.


TemplateContentType()

IMPORT_C const CContentType &TemplateContentType(const CContactItemField &aField) const;

Description

Gets the content type of the template field which a specified field maps onto. If the field does not map onto a field in a template, then its own content type is returned.

Note: this function can leave.

Parameters

const CContactItemField &aField

The field of interest.

Return value

const CContentType &

The content type of the field.


Version()

IMPORT_C TVersion Version() const;

Description

Gets the contact model's version number.

Return value

TVersion

The version number of the contacts model.


MachineId()

Capability: Illegal

IMPORT_C TInt64 MachineId() const;

Description

Returns a number unique to the contacts database. This value may be passed to CContactItem::UidStringL().

Return value

TInt64

The database's unique ID.


ICCTemplateIdL()

Capability: Illegal

IMPORT_C TContactItemId ICCTemplateIdL();

Description

Returns the ID of the template that should be used with CContactICCEntry items.

Return value

TContactItemId

A template ID.


ICCTemplateIdL()

Capability: Illegal

IMPORT_C TContactItemId ICCTemplateIdL(TUid aPhonebookUid);

Description

Returns the ID of the template that should be used with CContactICCEntry items belonging to the phonebook with TUid aPhonebookUid.

Parameters

TUid aPhonebookUid

The phonebook ID.

Return value

TContactItemId

A template ID.


PhonebookGroupIdL()

Capability: Illegal

IMPORT_C TContactItemId PhonebookGroupIdL();

Description

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

Return value

TContactItemId

Group ID.


HandleDatabaseEventL()

virtual inline void HandleDatabaseEventL(RDbNotifier::TEvent);

Description

Parameters

RDbNotifier::TEvent


GetCurrentDatabase()

Capability: Illegal

IMPORT_C TInt GetCurrentDatabase(TDes &aDatabase) const;

Description

Where there are multiple contact databases on a device, this function 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.

Parameters

TDes &aDatabase

The path and filename of the current database. KNullDesC if no current database has been set.

Return value

TInt

KErrNone if the function completed successfully, otherwise one of the standard error codes.


SetCurrentDatabase()

Capability: WriteUserData

IMPORT_C TInt SetCurrentDatabase(const TDesC &aDatabase) const;

Description

Where there are multiple contact databases on a device, this function 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.

Parameters

const TDesC &aDatabase

The path and filename of the current database.

Return value

TInt

KErrNone if the function completed successfully, otherwise one of the standard error codes.


StoreSortOrderL()

IMPORT_C void StoreSortOrderL();

Description

This function is not currently supported.


RestoreSortOrderL()

IMPORT_C void RestoreSortOrderL();

Description

This function is not currently supported.


SortOrder()

Capability: Illegal

IMPORT_C const CArrayFix< TSortPref > *SortOrder() const;

Description

Gets the array of sort preferences.

Return value

const CArrayFix< TSortPref > *

A pointer to an array of sort preferences of the contact database.


doAddNewContactL()

Capability: WriteUserData

IMPORT_C TContactItemId doAddNewContactL(CContactItem &aContact, TBool aIsTemplate, TBool aIsInTransaction);

Description

Adds a new contact item to the database and returns its ID.

Parameters

CContactItem &aContact

The contact item to add to the database.

TBool aIsTemplate

This argument should be ignored by developers.

TBool aIsInTransaction

This argument should be ignored by developers.

Return value

TContactItemId

The ID of the new contact item.

Leave codes

KErrDiskFull

The disk does not have enough free space to perform the operation.


SetSortedItemsList()

Capability: Illegal

IMPORT_C void SetSortedItemsList(CContactIdArray *aSortedItems, CArrayFix< TSortPref > *aSortOrder);

Description

This method allows clients of contacts model to set the sorted item list and sort order from a default sort order server as proposed for Crystal 6.0

Parameters

CContactIdArray *aSortedItems

Specifies an array sorted items

CArrayFix< TSortPref > *aSortOrder

Specifies the sort order


HandleDiskSpaceEvent()

virtual void HandleDiskSpaceEvent(TInt aDrive);

Description

Default behaviour for handling a low disk event - This function is unimplemented.

Parameters

TInt aDrive

[Top]


Member classes


Class TSortPref

class TSortPref;

Description

Specifies the field type and order preferences used for sorting items in the contacts database.

The contents of the first field in a contact item matching the field type is used as the data to sort on. The order can either be ascending or descending.

Members

Defined in CContactDatabase::TSortPref:
EAsc, EDesc, ExternalizeL(), InternalizeL(), TOrder, TSortPref(), TSortPref(), iFieldType, iOrder

See also:

Construction and destruction


TSortPref()

inline TSortPref();

Description

Constructs a TSortPref object. The order is initialised to EAsc and the field type to KNullUid.


TSortPref()

inline TSortPref(TFieldType aFieldType, TOrder aOrder=EAsc);

Description

Constructs the TSortPref object with a field type and an order.

Parameters

TFieldType aFieldType

Specifies the field type to sort on.

TOrder aOrder

Specifies the sort order.

Member functions


ExternalizeL()

IMPORT_C void ExternalizeL(RWriteStream &aStream) const;

Description

Store this TSortPref object in the given stream.

Parameters

RWriteStream &aStream

Stream to write TSortPref object state to.


InternalizeL()

IMPORT_C void InternalizeL(RReadStream &aStream);

Description

Initialise this TSortPref object from the given stream.

Parameters

RReadStream &aStream

Stream to read TSortPref object state from.

Member enumerations


Enum TOrder

TOrder

Description

The sort order.

EAsc

Ascending sort order.

EDesc

Descending sort order.

Member data


iOrder

TOrder iOrder;

Description

Specifies whether the sort should be ascending or descending.


iFieldType

TFieldType iFieldType;

Description

The first field matching this field type is used for the text to sort on.

[Top]


Member enumerations


Enum TOptions

TOptions

Description

Import and export format flags. Contacts can be imported into or exported from the contact database as vCards.

The following options are available during import and export.

EDefault

EIncludeX

Handle Symbian's extended vCard format options.

ETTFormat

Support non-standard extensions requried by Symbian PC connectivity software and Microsoft, amongst others.

EExcludeUid

Don't export the contact ID (for exporting only).

EDecreaseAccessCount

Decrease the contact's access count when importing and exporting.

EImportSingleContact

Only import the first contact in the read stream (for importing only).

EIncreaseAccessCount

Increase the contact's access count when importing and exporting.

ELocalTime

Sets a contact item to the local time when importing.

ENullTemplateId

Allows you to set a template to a contact item that does not exist.

EConverterDefined1

For use by implementor of converter plug-in.

EConverterDefined2

For use by implementor of converter plug-in.

EConverterDefined3

For use by implementor of converter plug-in.

EConverterDefined4

For use by implementor of converter plug-in.

EConverterDefined5

For use by implementor of converter plug-in.

EConverterDefined6

For use by implementor of converter plug-in.

EConverterDefined7

For use by implementor of converter plug-in.

EConverterDefined8

For use by implementor of converter plug-in.

EConverterReserved1

Reserved for use by Symbian.

EConverterReserved2

Reserved for use by Symbian.

EConverterReserved3

Reserved for use by Symbian.

EConverterReserved4

Reserved for use by Symbian.

EConverterReserved5

Reserved for use by Symbian.

EConverterReserved6

Reserved for use by Symbian.

EConverterReserved7

Reserved for use by Symbian.

EConverterReserved8

Reserved for use by Symbian.

EConverterReserved9

Reserved for use by Symbian.

EConverterReserved10

Reserved for use by Symbian.

EConverterReserved11

Reserved for use by Symbian.

EConverterReserved12

Reserved for use by Symbian.

EConverterReserved13

Reserved for use by Symbian.

EConverterReserved14

Reserved for use by Symbian.

EConverterReserved15

Reserved for use by Symbian.

EConverterReserved16

Reserved for use by Symbian.


Enum TThreadAccess

TThreadAccess

Description

Specifies whether the database can be accessed from single or multiple threads.

ESingleThread

Allows access to the contacts database from a single thread only.

EMultiThread

Allows for a multi-threaded program to access the contact database from multiple threads but note that the contacts model provides no synchronisation support for such use.


Enum TContactViewFilter

TContactViewFilter

Description

Contact view filter flags.

These flags define the bits that can be set in filtered views (CContactFilteredView) and in the filter passed to CContactDatabase::ContactMatchesHintFieldL() for comparing against contact view items (CViewContact).

If the item's bit field and the view's filter have the same settings for the CContactDatabase::EHome and CContactDatabase::EWork flags and any of the other flags are set in both, a match occurs and the item is included in the view.

Filters only apply to non-hidden contact fields with content.

EUnfiltered

The view is unfiltered; it includes all contact items.

EMailable

The filter includes items that have an email address.

ESmsable

The filter includes items that have a mobile telephone number.

ELandLine

The filter includes items that have a landline telephone number.

EFaxable

The filter includes items that have a fax number.

EPhonable

The filter includes items that are phonable. (All items with any of the above three flags set also have this flag set).

EWork

The filter excludes items without a work telephone number or email address.

EHome

The filter excludes items without a home telephone number or email address.

ERingTone

The filter includes items that have a non-empty ring tone field (a ring tone that is associated with the item).

EVoiceDial

The filter includes items that have a non-empty voice dial field (a voice recording associated with a telephone number field in the item).

EIMAddress

The filter includes items that have any non empty instant messaging address field.

EWirelessVillage

The filter includes items that have a non empty Wireless Village ID field. An item with this flag set will also have the EIMAddress flag set.

ECustomFilter1

Reserved filters for future use.

ECustomFilter2

Reserved filters for future use.

ECustomFilter3

Reserved filters for future use.

ECustomFilter4

Reserved filters for future use.


Enum TDbConnState

TDbConnState

Description

State of database connection

EDbConnectionOpen

Database is open, connection is available for use.

EDbConnectionNotReady

Initial state.

EDbConnectionFailed

Asynchronous Open failed.

EDbConnectionRecoverRequired

A Rollback has occurred and a Recover is required now.

EDbConnectionWriteLockedForBackup

Write access is locked during backup.

EDbConnectionClosedForRestore

The database has been closed whilst a Restore is in progress.

EDbConnectionNeedToCloseForRestore

Restore is in progress need to close after current transaction.


Enum TDirection

TDirection

Description

Currently unused

EAsc

EDesc

[Top]


Member type definitions


Typedef TTextFieldMinimal

typedef TBuf<KTextFieldMinimalLength> CContactDatabase::TTextFieldMinimal;

Description

A text buffer of KTextFieldMinimalLength used during sorting and searching of contacts