CCommsDatabase Class Reference

class CCommsDatabase : public CCommsDatabaseBase

Accesses the communications database through the DBMS.

An object of this type must be constructed and opened by a client before any of the tables in the database can be accessed, e.g. to create views and access template records.

Implements the pure virtual functions CreateDatabaseL() and DoOpen(). Responsible for Global settings and Connection Preferences. Has utility functions for accessing Global and Agent tables. No additional state (to CCommsDatabaseBase ) is stored.

Inherits from

Public Member Functions
~CCommsDatabase ()
IMPORT_C void ClearAgentAndExtL (const TDesC &)
IMPORT_C void ClearGlobalSettingL (const TDesC &)
IMPORT_C TInt GetAgentClientTimeoutL (const TDesC &)
IMPORT_C void GetAgentExtL (const TDesC &, TDes &)
IMPORT_C void GetAgentL (const TDesC &, TDes &)
IMPORT_C TInt GetAgentRouteTimeoutL (const TDesC &)
IMPORT_C void GetCurrentDialInSettingL (const TDesC &, TUint32 &)
IMPORT_C void GetCurrentDialOutSettingL (const TDesC &, TUint32 &)
IMPORT_C void GetDefaultTsyL ( TDes &)
IMPORT_C void GetGlobalSettingL (const TDesC &, TUint32 &)
IMPORT_C void GetGlobalSettingL (const TDesC &, TDes &)
IMPORT_C CCommsDatabase * NewL ()
IMPORT_C CCommsDatabase * NewL ( TBool )
IMPORT_C CCommsDatabase * NewL ( TCommDbOpeningMethod &)
IMPORT_C CCommsDatabase * NewL ( TCommDbDatabaseType )
IMPORT_C CCommsDatabase * NewL ( TCommDbDatabaseType , TCommDbOpeningMethod &)
IMPORT_C CCommsDbConnectionPrefTableView * OpenConnectionPrefTableInRankOrderLC ( TCommDbConnectionDirection )
IMPORT_C CCommsDbConnectionPrefTableView * OpenConnectionPrefTableLC ()
IMPORT_C CCommsDbConnectionPrefTableView * OpenConnectionPrefTableLC ( TCommDbConnectionDirection )
IMPORT_C CCommsDbConnectionPrefTableView * OpenConnectionPrefTableViewOnRankLC ( TCommDbConnectionDirection , TUint32 )
IMPORT_C CCommsDbTableView * OpenIAPTableViewMatchingBearerSetLC ( TUint32 , TCommDbConnectionDirection )
IMPORT_C CCommsDbTableView * OpenIAPTableViewMatchingNetworkLC ( TUint32 )
IMPORT_C CCommsDbTableView * OpenViewOnProxyRecordLC ( TUint32 , const TDesC &)
IMPORT_C void SetAgentClientTimeoutL (const TDesC &, TInt )
IMPORT_C void SetAgentExtL (const TDesC &, const TDesC &)
IMPORT_C void SetAgentL (const TDesC &, const TDesC &)
IMPORT_C void SetAgentRouteTimeoutL (const TDesC &, TInt )
IMPORT_C void SetGlobalSettingL (const TDesC &, TUint32 )
IMPORT_C void SetGlobalSettingL (const TDesC &, const TDesC &)
Protected Member Functions
CCommsDatabase ()
void DoOpenL ( TCommDbOpeningMethod &, TBool )
Private Member Functions
void CreateDatabaseL ()
TGlobalSettingType GlobalSettingTypeL (const TDesC &)
CCommsDbTableView * OpenGlobalSettingsTableLC (const TDesC &, TBool &)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
CCommsDatabaseBase::BeginInternalTransactionL()
CCommsDatabaseBase::BeginTransaction()
CCommsDatabaseBase::CCommsDatabaseBase()
CCommsDatabaseBase::CancelRequestNotification()
CCommsDatabaseBase::CheckDBCapability(RDbs::TPolicyType,const TDesC &,const RMessagePtr2 *)
CCommsDatabaseBase::CheckReadCapability(const TDesC &,const RMessagePtr2 *)
CCommsDatabaseBase::CheckWriteCapability(const TDesC &,const RMessagePtr2 *)
CCommsDatabaseBase::CommitInternalTransaction()
CCommsDatabaseBase::CommitTransaction()
CCommsDatabaseBase::ConvertToUid(const TDesC &,TUint32,TCommDbPublishSubscribeNotification &)
CCommsDatabaseBase::Database()
CCommsDatabaseBase::DatabaseUpdateHasOccurred()
CCommsDatabaseBase::DoClose()
CCommsDatabaseBase::DoOpenIAPTableViewL(const TDesC &,const TDesC &)
CCommsDatabaseBase::DoOpenTableViewL(const TDesC &,const TDesC &)
CCommsDatabaseBase::DoOpenViewMatchingTextL(const TDesC &,const TDesC &,const TDesC16 &,TBool)
CCommsDatabaseBase::DoOpenViewMatchingTextL(const TDesC &,const TDesC &,const TDesC8 &,TBool)
CCommsDatabaseBase::DoOpenViewMatchingUintL(const TDesC &,const TDesC &,TUint32,TBool)
CCommsDatabaseBase::GetNewNumber(TUid)
CCommsDatabaseBase::InTransaction()
CCommsDatabaseBase::InitializeFilestore()
CCommsDatabaseBase::IsDatabaseWriteLockedL()
CCommsDatabaseBase::NotifyAllChanges()
CCommsDatabaseBase::NotifyChangeL(const TDesC &,TUint32)
CCommsDatabaseBase::OpenTableLC(const TDesC &)
CCommsDatabaseBase::OpenViewLC(const TDesC &,const TDesC &)
CCommsDatabaseBase::OpenViewMatchingBoolLC(const TDesC &,const TDesC &,TBool)
CCommsDatabaseBase::OpenViewMatchingTextLC(const TDesC &,const TDesC &,const TDesC16 &)
CCommsDatabaseBase::OpenViewMatchingTextLC(const TDesC &,const TDesC &,const TDesC8 &)
CCommsDatabaseBase::OpenViewMatchingUintLC(const TDesC &,const TDesC &,TUint32)
CCommsDatabaseBase::PopulateChargeCardL(TUint32,TChargeCard &)
CCommsDatabaseBase::PopulateDialLocationL(TUint32,TDialLocation &)
CCommsDatabaseBase::RequestNotification(TRequestStatus &)
CCommsDatabaseBase::ResolvePhoneNumberFromDatabaseL(TDesC &,TDes &,TParseMode,TUint32,TUint32)
CCommsDatabaseBase::ResolvePhoneNumberL(TDesC &,TDes &,TParseMode,TUint32,TUint32)
CCommsDatabaseBase::RollbackInternalTransaction()
CCommsDatabaseBase::RollbackTransaction()
CCommsDatabaseBase::ShowHiddenRecords()
CCommsDatabaseBase::Version()const
CCommsDatabaseBase::~CCommsDatabaseBase()
Private Member Enumerations
enum TGlobalSettingType { ENotASetting , EGlobalSetting , ECompatibilitySetting }
Inherited Attributes
CCommsDatabaseBase::iDatabase
CCommsDatabaseBase::iImpl
CCommsDatabaseBase::iImplNotCreated
CCommsDatabaseBase::iInInternalTransaction
CCommsDatabaseBase::iNotifications
CCommsDatabaseBase::iNotifier
CCommsDatabaseBase::iNotifierOpenError
CCommsDatabaseBase::iShowHiddenRecords

Constructor & Destructor Documentation

CCommsDatabase()

CCommsDatabase ( ) [protected]

Default Constructor

~CCommsDatabase()

IMPORT_C ~CCommsDatabase ( ) [virtual]

Frees all resources owned by this object, prior to its destruction.

In particular, the destructor closes the communications database and disconnects from the DBMS.

Member Functions Documentation

ClearAgentAndExtL(const TDesC &)

IMPORT_C void ClearAgentAndExtL ( const TDesC & aService )

This method is deprecated from 9.1 and always returns/leaves with KErrNotSupported instead of describing past operation/parameters.

Parameters

const TDesC & aService The service that will be cleared of all the agent settings.

ClearGlobalSettingL(const TDesC &)

IMPORT_C void ClearGlobalSettingL ( const TDesC & aSetting )

Clears a global settings table field.

leave
KErrNotSupported aSetting is invalid
capability
Dependent on table, see the guide page referenced below.

Parameters

const TDesC & aSetting Setting to clear.

CreateDatabaseL()

void CreateDatabaseL ( ) [private, virtual]

CCommsDatabaseBase pure virtuals

This method is deprecated

Function not supported

DoOpenL(TCommDbOpeningMethod &, TBool)

void DoOpenL ( TCommDbOpeningMethod & aOpeningMethod,
TBool aUseDefaultDb
) [protected]

Connects to the Commsdat and set version number

Parameters

TCommDbOpeningMethod & aOpeningMethod
TBool aUseDefaultDb

GetAgentClientTimeoutL(const TDesC &)

IMPORT_C TInt GetAgentClientTimeoutL ( const TDesC & aService )
This method is deprecated from 9.1 and always returns/leaves with KErrNotSupported instead of describing past operation/parameters. Agent table has been removed.
leave
KErrNotSupported No longer supported.
Past use: Gets the client timeout associated with the specified service.

Parameters

const TDesC & aService The service that the timeout is associated with. This is one of DIAL OUT ISP TABLE, DIAL IN ISP TABLE, OUTGOING WCDMA TABLE.

GetAgentExtL(const TDesC &, TDes &)

IMPORT_C void GetAgentExtL ( const TDesC & aService,
TDes & aAgentExt
)
This method is deprecated from 9.1 and always returns/leaves with KErrNotSupported instead of describing past operation/parameters. Agent table has been removed.
leave
KErrNotSupported No longer supported.
Past use: Gets the agent extension associated with the specified service.

Parameters

const TDesC & aService The service that will use the agent. This is one of DIAL OUT ISP TABLE, DIAL IN ISP TABLE, OUTGOING WCDMA TABLE.
TDes & aAgentExt On return, the agent extension.

GetAgentL(const TDesC &, TDes &)

IMPORT_C void GetAgentL ( const TDesC & aService,
TDes & aAgent
)
This method is deprecated from 9.1 and always returns/leaves with KErrNotSupported instead of describing past operation/parameters. Agent table has been removed.
leave
KErrNotSupported No longer supported.
Past use: Gets the agent associated with the specified service.

Parameters

const TDesC & aService The service that will use the agent. This is one of DIAL OUT ISP TABLE, DIAL IN ISP TABLE, OUTGOING WCDMA TABLE.
TDes & aAgent On return, the agent.

GetAgentRouteTimeoutL(const TDesC &)

IMPORT_C TInt GetAgentRouteTimeoutL ( const TDesC & aService )
This method is deprecated from 9.1 and always returns/leaves with KErrNotSupported instead of describing past operation/parameters. Agent table has been removed.
leave
KErrNotSupported No longer supported.
Past use: Gets the route timeout associated with the specified service.

Parameters

const TDesC & aService The service that the route timeout is associated with. This is one of DIAL OUT ISP TABLE, DIAL IN ISP TABLE, OUTGOING WCDMA TABLE.

GetCurrentDialInSettingL(const TDesC &, TUint32 &)

IMPORT_C void GetCurrentDialInSettingL ( const TDesC & aSetting,
TUint32 & aValue
)

This method is deprecated from 9.1 and always returns/leaves with KErrNotSupported instead of describing past operation/parameters.

Past use: Retrieve settings for the dial in IAP.

leave
KErrNotSupported No longer supported.

Parameters

const TDesC & aSetting Setting to get.
TUint32 & aValue On return, setting value.

GetCurrentDialOutSettingL(const TDesC &, TUint32 &)

IMPORT_C void GetCurrentDialOutSettingL ( const TDesC & aSetting,
TUint32 & aValue
)

This method is deprecated from 9.1 and always returns/leaves with KErrNotSupported instead of describing past operation/parameters.

leave
KErrNotSupported No longer supported.

Parameters

const TDesC & aSetting Setting to get.
TUint32 & aValue On return, setting value.

GetDefaultTsyL(TDes &)

IMPORT_C void GetDefaultTsyL ( TDes & aValue )
Retrieves the default TSY used for bearer availibility, SMS and data services.
capability
Dependent on table, see the guide page referenced below.

Parameters

TDes & aValue

GetGlobalSettingL(const TDesC &, TUint32 &)

IMPORT_C void GetGlobalSettingL ( const TDesC & aSetting,
TUint32 & aValue
)

Gets a global settings table integer field.

If a client attempts to get the default Dial Out IAP with a Version 6.1 database, the function gets the default IAP in the first connection preference for the outgoing direction if it is a dial out ISP-type IAP and returns its ID, otherwise an error is returned.

If a client attempts to get the ASK_USER_BEFORE_DIAL field with a Version 6.1 database, the function returns a true value if CONNECT_PREF_DIALOG_PREF in the first connection preference has been set to produce a prompt, otherwise false.

leave
KErrNotSupported if aSetting is invalid; KErrNotFound if the global setting has not been set.
capability
Dependent on table, see the guide page referenced below.

Parameters

const TDesC & aSetting Setting to get.
TUint32 & aValue On return, the setting value.

GetGlobalSettingL(const TDesC &, TDes &)

IMPORT_C void GetGlobalSettingL ( const TDesC & aSetting,
TDes & aValue
)

Gets a global settings table string field.

leave
KErrNotSupported if aSetting is invalid; KErrNotFound if the global setting has not been set
capability
Dependent on table, see the guide page referenced below.

Parameters

const TDesC & aSetting Setting to get.
TDes & aValue On return, the setting value

GlobalSettingTypeL(const TDesC &)

TGlobalSettingType GlobalSettingTypeL ( const TDesC & aSetting ) const [private]

Returns whether aSetting is a known global setting, a former global setting supported for compatibility reasons or not known. These are rougly in the optimal order.....

Parameters

const TDesC & aSetting

NewL()

IMPORT_C CCommsDatabase * NewL ( ) [static]

Allocates and constructs a new communications database object on the heap. If the database filestore does not exist the default filestore is duplicated. If no default filestore exists an empty database is created.

If there is insufficient memory available to create the object, the function leaves. If allocation is successful, it returns a pointer to the new object.

NewL(TBool)

IMPORT_C CCommsDatabase * NewL ( TBool aUseDefaultDb ) [static]

Creates a CCommsDatabase . If the database filestore exists and aUseDefaultDb is ETrue the default filestore is duplicated. Otherwise an empty database is created. If the commdb doesn't exist and this and aUseDefaultDb is EFalse the this function will leave.

leave
KErrNotSupported when aUseDefaultDb is EFalse and the database filestore does not exists.

Parameters

TBool aUseDefaultDb Use the default database.

NewL(TCommDbOpeningMethod &)

IMPORT_C CCommsDatabase * NewL ( TCommDbOpeningMethod & aOpeningMethod ) [static]

Creates a CCommsDatabase as with NewL() . The method of opening (Created, CopiedDefault or Opened) is returned in aOpeningMethod.

Parameters

TCommDbOpeningMethod & aOpeningMethod On return, the opening method. 0

NewL(TCommDbDatabaseType)

IMPORT_C CCommsDatabase * NewL ( TCommDbDatabaseType aDbType ) [static]

Re-instated override variant of NewL function in order to maintain BC with 6.1

Parameters

TCommDbDatabaseType aDbType Whether Database is IAP or ISP version. All Db's are IAP type now.

NewL(TCommDbDatabaseType, TCommDbOpeningMethod &)

IMPORT_C CCommsDatabase * NewL ( TCommDbDatabaseType aDbType,
TCommDbOpeningMethod & aOpeningMethod
) [static]

Re-instated override variant of NewL function in order to maintain BC with 6.1 Creates a CCommsDatabase and gets the method of opening (Created, CopiedDefault or Opened).

Parameters

TCommDbDatabaseType aDbType Whether Database is IAP or ISP version. All Db's are IAP type now.
TCommDbOpeningMethod & aOpeningMethod On return, the method of opening.

OpenConnectionPrefTableInRankOrderLC(TCommDbConnectionDirection)

IMPORT_C CCommsDbConnectionPrefTableView * OpenConnectionPrefTableInRankOrderLC ( TCommDbConnectionDirection aDirection )

Opens a view on the records in the Connection Preferences table with a specified direction, and with records sorted into ranking order.

Records are sorted in rank order from ranking 1 first. Records with rank 0 are not included.

Shows hidden records only if requested.

When the use of the view object is complete, it should be popped from the cleanup stack, and deleted.

capability
Dependent on table, see the guide page referenced below.

Parameters

TCommDbConnectionDirection aDirection Direction of the records to include in the view

OpenConnectionPrefTableLC()

IMPORT_C CCommsDbConnectionPrefTableView * OpenConnectionPrefTableLC ( )

Opens a view on the whole Connection Preferences table and returns a pointer to it.

Shows hidden records only if requested.

When the use of the view object is complete it should be popped from the cleanup stack, and deleted.

capability
Dependent on table, see the guide page referenced below.

OpenConnectionPrefTableLC(TCommDbConnectionDirection)

IMPORT_C CCommsDbConnectionPrefTableView * OpenConnectionPrefTableLC ( TCommDbConnectionDirection aDirection )

Opens a view on the records in the Connection Preferences table with a specified direction and return a pointer to it.

Shows hidden records only if requested..

When the use of the view object is complete, it should be popped from the cleanup stack, and deleted.

capability
Dependent on table, see the guide page referenced below.

Parameters

TCommDbConnectionDirection aDirection Direction of the records to include in the view

OpenConnectionPrefTableViewOnRankLC(TCommDbConnectionDirection, TUint32)

IMPORT_C CCommsDbConnectionPrefTableView * OpenConnectionPrefTableViewOnRankLC ( TCommDbConnectionDirection aDirection,
TUint32 aRank
)

Opens a view on the records in the Connection Preferences table with a specified direction and ranking.

When the use of the view object is complete, it should be popped from the cleanup stack, and deleted.

capability
Dependent on table, see the guide page referenced below.

Parameters

TCommDbConnectionDirection aDirection Direction of the records to include in the view
TUint32 aRank Ranking of the records to include in the view

OpenGlobalSettingsTableLC(const TDesC &, TBool &)

CCommsDbTableView * OpenGlobalSettingsTableLC ( const TDesC & aSetting,
TBool & aExists
) [private]

Opens a view on the global settings table showing the entry (if it exists) called aSetting. Global settings are hidden therfore require the `aIncludeHiddenRecords` argument set to True.

Parameters

const TDesC & aSetting
TBool & aExists On return, will have ETrue if Successful else EFalse

OpenIAPTableViewMatchingBearerSetLC(TUint32, TCommDbConnectionDirection)

IMPORT_C CCommsDbTableView * OpenIAPTableViewMatchingBearerSetLC ( TUint32 aBearerSet,
TCommDbConnectionDirection aDirection
)

Open a view on the IAP table containing records that match the bearers and direction specified. `aBearerSet` is a bit mask of type `TCommDbBearer`.

Opens a view on records in the IAP table with a specified range of service types.

IAP records are included that have the specified bearers and direction, as read from the Connection preference table.

When the use of the view object is complete, it should be popped from the cleanup stack, and deleted.

leave
KErrArgument if either aBearerSet or aDirection is invalid; other DBMS-related error codes.
capability
Dependent on table, see the guide page referenced below.

Parameters

TUint32 aBearerSet Bearers to match. For suitable values, see CONNECT_PREF_BEARER_SET in the Connection preferences table. Bitwise mask of the TCommDbBearer.
TCommDbConnectionDirection aDirection Direction to match.

OpenIAPTableViewMatchingNetworkLC(TUint32)

IMPORT_C CCommsDbTableView * OpenIAPTableViewMatchingNetworkLC ( TUint32 aNetwork )

Open a viewon the IAP table containing records which match the specified network

Opens a view on the IAP table containing records which match the specified network.
capability
Dependent on table, see the guide page referenced below.

Parameters

TUint32 aNetwork

OpenViewOnProxyRecordLC(TUint32, const TDesC &)

IMPORT_C CCommsDbTableView * OpenViewOnProxyRecordLC ( TUint32 aServiceId,
const TDesC & aServiceType
)

Opens a view on records in the Proxies table containing records that match the service ID and service type specified.

When the use of the view object is complete, it should be popped from the cleanup stack, and deleted.

leave
KErrArgument if either aServiceId or aServiceType is invalid; other DBMS-related error codes.
capability
Dependent on table, see the guide page referenced below.

Parameters

TUint32 aServiceId ID of the service to match
const TDesC & aServiceType Service type to match

SetAgentClientTimeoutL(const TDesC &, TInt)

IMPORT_C void SetAgentClientTimeoutL ( const TDesC & aService,
TInt aClientTimeout
)
This method is deprecated from 9.1 and always returns/leaves with KErrNotSupported instead of describing past operation/parameters. Timeout names have been changed and agent table has been removed.
leave
KErrNotSupported No longer supported.
Past use: Sets the client timeout associated with the specified service.

Parameters

const TDesC & aService The service that the client timeout is associated with. This is one of DIAL OUT ISP TABLE, DIAL IN ISP TABLE, OUTGOING WCDMA TABLE.
TInt aClientTimeout The client timeout.

SetAgentExtL(const TDesC &, const TDesC &)

IMPORT_C void SetAgentExtL ( const TDesC & aService,
const TDesC & aAgentExt
)
This method is deprecated from 9.1 and always returns/leaves with KErrNotSupported instead of describing past operation/parameters. Agent table has been removed.
leave
KErrNotSupported No longer supported.
Past use: Sets the agent extension to be used when accessing the specified service.

Parameters

const TDesC & aService The service that will use the agent. This is one of DIAL OUT ISP TABLE, DIAL IN ISP TABLE, OUTGOING WCDMA TABLE.
const TDesC & aAgentExt The agent extention to use.

SetAgentL(const TDesC &, const TDesC &)

IMPORT_C void SetAgentL ( const TDesC & aService,
const TDesC & aAgent
)

This method is deprecated from 9.1 and always returns/leaves with KErrNotSupported instead of describing past operation/parameters. Agent table has been removed.

leave
KErrNotSupported No longer supported.

Parameters

const TDesC & aService The service that will use the agent. This is one of DIAL OUT ISP TABLE, DIAL IN ISP TABLE, OUTGOING WCDMA TABLE.
const TDesC & aAgent The agent to use.

SetAgentRouteTimeoutL(const TDesC &, TInt)

IMPORT_C void SetAgentRouteTimeoutL ( const TDesC & aService,
TInt aRouteTimeout
)
This method is deprecated from 9.1 and always returns/leaves with KErrNotSupported instead of describing past operation/parameters. Timeout names have been changed and agent table has been removed.
leave
KErrNotSupported No longer supported.
Past use: Sets the route timeout associated with the specified service.

Parameters

const TDesC & aService The service that the client route timeout is associated with. This is one of DIAL OUT ISP TABLE, DIAL IN ISP TABLE, OUTGOING WCDMA TABLE.
TInt aRouteTimeout The route timeout.

SetGlobalSettingL(const TDesC &, TUint32)

IMPORT_C void SetGlobalSettingL ( const TDesC & aSetting,
TUint32 aValue
)

Sets a global settings table integer field.

If a client attempts to set the default Dial Out IAP with a Version 6.1 database, the function sets the default IAP in the first connection preference for the outgoing direction to the specified IAP, and the bearer set to CSD.

If a client attempts to set the ASK_USER_BEFORE_DIAL field with a Version 6.1 database, the function sets CONNECT_PREF_DIALOG_PREF in the first connection preference to produce a prompt if true is specified, or do not prompt if false is specified.

leave
KErrNotSupported aSetting is invalid.
capability
Dependent on table, see the guide page referenced below.

Parameters

const TDesC & aSetting Setting to get.
TUint32 aValue Setting value.

SetGlobalSettingL(const TDesC &, const TDesC &)

IMPORT_C void SetGlobalSettingL ( const TDesC & aSetting,
const TDesC & aValue
)

Sets a global settings table string field.

leave
KErrNotSupported aSetting is invalid.
capability
Dependent on table, see the guide page referenced below.

Parameters

const TDesC & aSetting Setting to get.
const TDesC & aValue On return, the setting value.

Member Enumerations Documentation

Enum TGlobalSettingType

Enumerators

ENotASetting
EGlobalSetting
ECompatibilitySetting