#include <app/phbksync.h>
Link against: phbksyncsvr.lib
class RPhoneBookSession : public RSessionBase, public RSessionBase |
Public Member Type Definitions | |
---|---|
typedef | TPckg< TContactFieldsV1 > TContactFieldsV1Pckg |
typedef | TPckg< TContactFieldsV2 > TContactFieldsV2Pckg |
typedef | TPckg< TContactFieldsV3 > TContactFieldsV3Pckg |
Public Member Enumerations | |
---|---|
enum | TPhonebookSyncMode { EAutoCurrentIcc, EAutoSameIcc, EManual } |
enum | TSyncIdType { ESyncGroupId, ESyncTemplateId } |
enum | TSyncState { EUnsynchronised, ECacheValid, EErrorDuringSync } |
Inherited Attributes | |
---|---|
RHandleBase::iHandle |
Inherited Enumerations | |
---|---|
RHandleBase:TAttributes | |
RSessionBase:TAttachMode |
Provides the CPhoneBookSyncPlugin client access to a session with the Phonebook Synchronizer Server.
A handle to an RPhoneBookSession enables the plug-in class to perform IPC communications with the server.
typedef TPckg< TContactFieldsV1 > | TContactFieldsV1Pckg |
A packaged instance of TContactFieldsV1.
typedef TPckg< TContactFieldsV2 > | TContactFieldsV2Pckg |
A packaged instance of TContactFieldsV2.
typedef TPckg< TContactFieldsV3 > | TContactFieldsV3Pckg |
A packaged instance of TContactFieldsV3.
The synchronisation mode for phonebooks when the server starts.
Enumerator | Value | Description |
---|---|---|
EAutoCurrentIcc |
Automatic synchronisation will be performed. | |
EAutoSameIcc |
Automatic synchronisation will only be performed if the current ICC is the same as the last ICC to be synchonised. | |
EManual |
Manual synchronisation will be performed when requested. |
The phonebook ID type requested from a phonebook. There are two types of IDs (group IDs and template IDs).
See also: RPhoneBookSession::GetPhoneBookId()
Enumerator | Value | Description |
---|---|---|
ESyncGroupId |
Used to allocate a new entry to the right group in the Contacts Database. | |
ESyncTemplateId |
Used to define new ICC entries in the Contacts Database. |
The phonebook cache state.
Enumerator | Value | Description |
---|---|---|
EUnsynchronised |
The server has not yet populated the Contacts Database. | |
ECacheValid |
The server has finished populating the Contacts Database. | |
EErrorDuringSync |
The server encountered an error populating the Contacts Database. |
IMPORT_C void | CancelRequest | ( | TPhonebookSyncRequestCancel | aReqToCancel | ) |
Cancels a previously issued asynchronous request on the Global/GSM ADN phonebook.
Parameters | |
---|---|
aReqToCancel | The request to be cancelled. |
Capability | |
---|---|
None |
IMPORT_C void | CancelRequest | ( | TPhonebookSyncRequestCancel | aReqToCancel, |
TUid | aPhonebookId | |||
) |
Cancels a previously issued asynchronous request. The request to be cancelled is specified by the aReqToCancel parameter and the ICC phonebook for which the request needs to be cancelled is specified by the aPhonebookUid parameter.
Parameters | |
---|---|
aReqToCancel | Request to be cancelled. |
aPhonebookId | UID of the ICC phonebook. |
Capability | |
---|---|
ReadUserData | |
WriteUserData |
IMPORT_C void | Close | ( | ) |
Reimplemented from RHandleBase::Close()
Closes the client's session with the Phonebook Synchroniser Server.
Capability | |
---|---|
None |
IMPORT_C TInt | Connect | ( | ) |
Connects the client to the Phonebook Synchroniser Server.
This must be used before any of the other methods listed in this API section. The first client to call this method will cause the initiation of the Phonebook Synchroniser Server within its own executable process.
Capability | |
---|---|
None |
IMPORT_C void | DeleteContact | ( | TRequestStatus & | aReqStatus, |
TContactItemId | aId | |||
) |
Deletes the contact item from the ICC card.
Parameters | |
---|---|
aReqStatus | On completion, KErrNone if successful, a system-wide error code if not. |
aId | The contact item to delete. |
Capability | |
---|---|
WriteUserData |
IMPORT_C void | DoSynchronisation | ( | TRequestStatus & | aReqStatus | ) |
Executes a manual synchronisation of the Global/GSM ADN phonebook entries.
Parameters | |
---|---|
aReqStatus | On completion, KErrNone if successful, a system-wide error code if not. |
Capability | |
---|---|
ReadUserData | |
WriteUserData |
IMPORT_C void | DoSynchronisation | ( | TRequestStatus & | aReqStatus, |
TUid | aPhonebookUid | |||
) |
Instructs the Phonebook Synchroniser Server to start a manual synchronisation of the ICC phonebook specified by the aPhonebook parameter.
Parameters | |
---|---|
aReqStatus | On completion, KErrNone if successful, a system-wide error code if not. |
aPhonebookUid | TUid of the ICC phonebook to be synchronised. |
Capability | |
---|---|
ReadUserData | |
WriteUserData |
Returns information about the supported fields within an ICC phonebook entry.
The TContactFieldFormat type defines the information available for each field and TContactFieldsV1 is a collection of this information for all supported field types. The client can use the field information to tailor its UI so that user can only enter fields with the maximum number of supported characters.
The only fields supported by GSM ADN phonebook are the name, number and ICC slot number, so these are the only fields included in TContactFieldsV1.
TContactFieldsV2 is used to contain the new USIM phonebook fields.
TContactFieldsV3 is an extension of TContactFieldsV2 and contains additional information on the fields supported by the USIM phonebooks.
Parameters | |
---|---|
aContactFields | On return, the packaged TContactFieldsV1/V2/V3 is filled with the supported field information. |
Capability | |
---|---|
None |
IMPORT_C TInt | GetPhoneBookCacheState | ( | TSyncState & | aState | ) |
Returns the current state of the Phonebook Synchroniser server cache for the Global/GSM ADN phonebook.
Parameters | |
---|---|
aState | On return, the state of the phonebook synchroniser cache. |
Capability | |
---|---|
None |
IMPORT_C TInt | GetPhoneBookCacheState | ( | TSyncState & | aState, |
TUid | aPhonebookId | |||
) |
Return the current phonebook server cache state for the ICC phonebook specified by the aPhonebook parameter.
Parameters | |
---|---|
aState | Current state of the phonebook cache |
aPhonebookId | Type of ICC phonebook |
Capability | |
---|---|
None |
IMPORT_C TInt | GetPhoneBookId | ( | TContactItemId & | aId, |
TSyncIdType | aIdType | |||
) |
Returns the requested UID for the ID type belonging to the Global/GSM ADN phonebook. This is the ID type spedified by aIdType, which can be either the template ID or the group ID for an ICC entry belonging to the Global/GSM ADN phonebook, depending on the type supplied by aIdType.
Parameters | |
---|---|
aId | On return, the contact ID. |
aIdType | The type of ID requested. |
Capability | |
---|---|
None |
IMPORT_C TInt | GetPhoneBookId | ( | TContactItemId & | aId, |
TSyncIdType | aIdType, | |||
TUid | aPhonebookUid | |||
) |
Return either the current group or template ID (depending on the type supplied by aIdType) for the ICC entries belonging to the ICC phonebook specified by the aPhonebookUid parameter.
Parameters | |
---|---|
aId | Contacts UID |
aIdType | Type of Contacts UID |
aPhonebookUid | TUid of the ICC phonebook |
Capability | |
---|---|
None |
IMPORT_C TInt | GetSlotId | ( | TInt | aSlot, |
TContactItemId & | aId | |||
) | const |
Get the Contacts UID of a particular slot in the Global/GSM ADN phonebook.
Parameters | |
---|---|
aSlot | The slot number on which the request is made. |
aId | The contact Id of the slot number. |
Capability | |
---|---|
None |
IMPORT_C TInt | GetSlotId | ( | TInt | aSlot, |
TContactItemId & | aId, | |||
TUid | aPhonebookId | |||
) | const |
Get the Contacts UID of a particular slot in the requested phonebook.
Parameters | |
---|---|
aSlot | The slot number on which the request is made. |
aId | The contact Id of the slot number. |
aPhonebookId | Type of ICC phonebook |
Capability | |
---|---|
None |
IMPORT_C TInt | GetSyncMode | ( | TPhonebookSyncMode & | aSyncMode | ) |
Returns the current setting for the synchronisation mode of the Global/GSM ADN phonebook, used by the Phonebook Synchroniser Server at start-up to determine if the phonebook should be automatically synchronised.
Parameters | |
---|---|
aSyncMode | On return, the synchronisation mode. |
Capability | |
---|---|
None |
IMPORT_C TInt | GetSyncMode | ( | TPhonebookSyncMode & | aSyncMode, |
TUid | aPhonebookId | |||
) |
Returns the current setting for the Synchonisation Mode of the ICC phonebook specified by aPhonebookUid and used by the Phonebook Synchroniser Server at start-up to determine if the phonebook should be automatically synchronised.
Parameters | |
---|---|
aSyncMode | On return Will contain the current synchronisation mode. |
aPhonebookId | TUid of the ICC phonebook |
Capability | |
---|---|
None |
IMPORT_C void | NotifyPhBkCacheStateChange | ( | TRequestStatus & | aStatus | ) |
Registers the notification for a change in the Global/GSM ADN phonebook cache state.
The client should call GetPhoneBookCacheState() in order to get the new state of the synchroniser.
Parameters | |
---|---|
aStatus | On completion, KErrNone if successful, a system-wide error code if not. |
Capability | |
---|---|
None |
IMPORT_C void | NotifyPhBkCacheStateChange | ( | TRequestStatus & | aStatus, |
TUid | aPhonebookId | |||
) |
Registers the notification for a change in the Phone book cache state.
The client should call GetPhoneBookCacheState() in order to get the new state of the synchroniser.
Parameters | |
---|---|
aStatus | On completion, KErrNone if successful, a system-wide error code if not. |
aPhonebookId | UID of the ICC phonebook. |
Capability | |
---|---|
None |
IMPORT_C TInt | SetSyncMode | ( | TPhonebookSyncMode | aSyncMode | ) |
Sets a new value for the synchronisation mode of the Global/GSM ADN phonebook, used by the Phonebook Synchroniser Server at start-up to determine its synchronisation policy.
If the mode is changing to EAutoCurrentIcc and no sync has yet been performed, then an automatic sync will be performed.
Parameters | |
---|---|
aSyncMode | The new synchronisation mode. |
Capability | |
---|---|
None |
IMPORT_C TInt | SetSyncMode | ( | TPhonebookSyncMode | aSyncMode, |
TUid | aPhonebookId | |||
) |
Set a new value for the Synchonisation Mode of the ICC phonebook specified by aPhonebookUid, used by the Phonebook Synchroniser Server at start-up to determine its synchronisation policy.
Parameters | |
---|---|
aSyncMode | Current synchronisation mode |
aPhonebookId | TUid of the ICC phonebook |
Capability | |
---|---|
None |
Requests the shutdown of the server when the last client disconnects. There is no support for immediate shutdown functionality. This API call can only be executed if the server is compiled as a debug release.
Parameters | |
---|---|
aUnconditionally | If true, subsequent connection requests from any client will be honoured delaying shutdown until they disconnect. If untrue, all subsequent connect requests will be denied. |
Capability | |
---|---|
ReadUserData | |
WriteUserData |
IMPORT_C TInt | UpdateLookuptable | ( | TContactItemId | aNewUid, |
TInt | aIccSlot | |||
) |
Updates the Phonebook Synchroniser's look-up table with the new contact ID in the Global/GSM ADN phonebook.
This function should be called when a new entry has been added to the Contacts Database by a client other than the Phonebook Synchroniser Server, so the server can know what the UID of the newly added contact was.
The Phonebook Synchroniser plug-in should extract the appropriate details from the item (e.g. item UID and slot number) and call the Phonebook server to update the look-up tables.
Parameters | |
---|---|
aNewUid | The contact use for the update. |
aIccSlot | The ICC slot number to match the Contacts UID. |
Capability | |
---|---|
None |
IMPORT_C TInt | UpdateLookuptable | ( | TContactItemId | aNewUid, |
TInt | aIccSlot, | |||
TUid | aPhonebookUid | |||
) |
Updates the Phonebook Synchroniser's look-up table with the new contact ID in the ICC phonebook specified by the aPhonebookUid parameter
This function should be called when a new entry has been added to the Contacts Database by a client other than the Phonebook Synchroniser Server, so the server can know what the UID of the newly added contact was.
The Phonebook Synchroniser plug-in should extract the appropriate details from the item (e.g. item UID and slot number) and call the Phonebook server to update the look-up tables.
Parameters | |
---|---|
aNewUid | Contact UID number unique per entry |
aIccSlot | ICC slot value |
aPhonebookUid | Type of ICC phonebook |
Capability | |
---|---|
None |
IMPORT_C TInt | ValidateContact | ( | MContactSynchroniser::TValidateOperation | aOperation, |
TContactItemId | aId | |||
) |
Instructs the Phonebook Synchroniser Server to verify the access to the ICC contact item stored in the Contacts database. The server is responsible for mapping the UID to the phonebook this item belongs to.
Parameters | |
---|---|
aOperation | Holds the type of check, search, edit, read. |
aId | The contact model UID of the record stored in the database. |
Capability | |
---|---|
ReadUserData |
IMPORT_C TVersion | Version | ( | ) | const |
Returns the current version of the Phonebook Synchroniser Server.
Capability | |
---|---|
None |
IMPORT_C void | WriteContact | ( | TRequestStatus & | aReqStatus, |
CContactICCEntry & | aContactItem, | |||
TInt & | aSlotNumber | |||
) |
Writes the contact item to the Global/GSM ADN phonebook. This can be used to edit an existing contact or to create a new contact.
Parameters | |
---|---|
aReqStatus | On completion, KErrNone if successful, a system-wide error code if not. |
aContactItem | The contact item to write to the ICC card. |
aSlotNumber | The slot number to write to contact into. If set to KSyncIndexNotSupplied the Phonebook Synchroniser Server will use the first empty slot and aSlotNumber will contain the slot number used on completion. |
Capability | |
---|---|
WriteUserData |
IMPORT_C void | WriteContact | ( | TRequestStatus & | aReqStatus, |
CContactICCEntry & | aContactItem, | |||
TInt & | aSlotNumber, | |||
TUid & | aPhonebookUid | |||
) |
Write the contact item supplied in the aContactItem parameter to the ICC phonebook specified by aPhonebookUid.
This method is used to edit an existing or write new entry to the ICC phonebook. When editing an existing entry the slot number will be supplied in aContactItem, whereas for new entries the new slot number will be returned in the aSlotNumber parameter. Similarly for new entries the phonebook UID will be returned in the aPhonebookUid parameter.
Parameters | |
---|---|
aReqStatus | On completion, KErrNone if successful, a system-wide error code if not. |
aContactItem | Contacts ICC entry. |
aSlotNumber | Allocated slot number. |
aPhonebookUid | UID of the ICC phonebook. |
Capability | |
---|---|
WriteUserData |
IMPORT_C TInt | __DbgMarkHeap | ( | ) |
Set a heap mark in the Phonebook Sync Server and Background Sync Engine threads.
Capability | |
---|---|
None |