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 voidClearAgentAndExtL(const TDesC &)
IMPORT_C voidClearGlobalSettingL(const TDesC &)
IMPORT_C TIntGetAgentClientTimeoutL(const TDesC &)
IMPORT_C voidGetAgentExtL(const TDesC &, TDes &)
IMPORT_C voidGetAgentL(const TDesC &, TDes &)
IMPORT_C TIntGetAgentRouteTimeoutL(const TDesC &)
IMPORT_C voidGetCurrentDialInSettingL(const TDesC &, TUint32 &)
IMPORT_C voidGetCurrentDialOutSettingL(const TDesC &, TUint32 &)
IMPORT_C voidGetDefaultTsyL(TDes &)
IMPORT_C voidGetGlobalSettingL(const TDesC &, TUint32 &)
IMPORT_C voidGetGlobalSettingL(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 voidSetAgentClientTimeoutL(const TDesC &, TInt)
IMPORT_C voidSetAgentExtL(const TDesC &, const TDesC &)
IMPORT_C voidSetAgentL(const TDesC &, const TDesC &)
IMPORT_C voidSetAgentRouteTimeoutL(const TDesC &, TInt)
IMPORT_C voidSetGlobalSettingL(const TDesC &, TUint32)
IMPORT_C voidSetGlobalSettingL(const TDesC &, const TDesC &)
Protected Member Functions
CCommsDatabase()
voidDoOpenL(TCommDbOpeningMethod &, TBool)
Private Member Functions
voidCreateDatabaseL()
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
enumTGlobalSettingType { 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 voidClearAgentAndExtL(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 & aServiceThe service that will be cleared of all the agent settings.

ClearGlobalSettingL(const TDesC &)

IMPORT_C voidClearGlobalSettingL(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 & aSettingSetting to clear.

CreateDatabaseL()

voidCreateDatabaseL()[private, virtual]

CCommsDatabaseBase pure virtuals

This method is deprecated

Function not supported

DoOpenL(TCommDbOpeningMethod &, TBool)

voidDoOpenL(TCommDbOpeningMethod &aOpeningMethod,
TBoolaUseDefaultDb
)[protected]

Connects to the Commsdat and set version number

Parameters

TCommDbOpeningMethod & aOpeningMethod
TBool aUseDefaultDb

GetAgentClientTimeoutL(const TDesC &)

IMPORT_C TIntGetAgentClientTimeoutL(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 & aServiceThe 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 voidGetAgentExtL(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 & aServiceThe service that will use the agent. This is one of DIAL OUT ISP TABLE, DIAL IN ISP TABLE, OUTGOING WCDMA TABLE.
TDes & aAgentExtOn return, the agent extension.

GetAgentL(const TDesC &, TDes &)

IMPORT_C voidGetAgentL(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 & aServiceThe service that will use the agent. This is one of DIAL OUT ISP TABLE, DIAL IN ISP TABLE, OUTGOING WCDMA TABLE.
TDes & aAgentOn return, the agent.

GetAgentRouteTimeoutL(const TDesC &)

IMPORT_C TIntGetAgentRouteTimeoutL(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 & aServiceThe 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 voidGetCurrentDialInSettingL(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 & aSettingSetting to get.
TUint32 & aValueOn return, setting value.

GetCurrentDialOutSettingL(const TDesC &, TUint32 &)

IMPORT_C voidGetCurrentDialOutSettingL(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 & aSettingSetting to get.
TUint32 & aValueOn return, setting value.

GetDefaultTsyL(TDes &)

IMPORT_C voidGetDefaultTsyL(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 voidGetGlobalSettingL(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 & aSettingSetting to get.
TUint32 & aValueOn return, the setting value.

GetGlobalSettingL(const TDesC &, TDes &)

IMPORT_C voidGetGlobalSettingL(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 & aSettingSetting to get.
TDes & aValueOn 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(TBoolaUseDefaultDb)[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 aUseDefaultDbUse 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 & aOpeningMethodOn return, the opening method. 0

NewL(TCommDbDatabaseType)

IMPORT_C CCommsDatabase *NewL(TCommDbDatabaseTypeaDbType)[static]

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

Parameters

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

NewL(TCommDbDatabaseType, TCommDbOpeningMethod &)

IMPORT_C CCommsDatabase *NewL(TCommDbDatabaseTypeaDbType,
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 aDbTypeWhether Database is IAP or ISP version. All Db's are IAP type now.
TCommDbOpeningMethod & aOpeningMethodOn return, the method of opening.

OpenConnectionPrefTableInRankOrderLC(TCommDbConnectionDirection)

IMPORT_C CCommsDbConnectionPrefTableView *OpenConnectionPrefTableInRankOrderLC(TCommDbConnectionDirectionaDirection)

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 aDirectionDirection 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(TCommDbConnectionDirectionaDirection)

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 aDirectionDirection of the records to include in the view

OpenConnectionPrefTableViewOnRankLC(TCommDbConnectionDirection, TUint32)

IMPORT_C CCommsDbConnectionPrefTableView *OpenConnectionPrefTableViewOnRankLC(TCommDbConnectionDirectionaDirection,
TUint32aRank
)

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 aDirectionDirection of the records to include in the view
TUint32 aRankRanking 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 & aExistsOn return, will have ETrue if Successful else EFalse

OpenIAPTableViewMatchingBearerSetLC(TUint32, TCommDbConnectionDirection)

IMPORT_C CCommsDbTableView *OpenIAPTableViewMatchingBearerSetLC(TUint32aBearerSet,
TCommDbConnectionDirectionaDirection
)

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 aBearerSetBearers to match. For suitable values, see CONNECT_PREF_BEARER_SET in the Connection preferences table. Bitwise mask of the TCommDbBearer.
TCommDbConnectionDirection aDirectionDirection to match.

OpenIAPTableViewMatchingNetworkLC(TUint32)

IMPORT_C CCommsDbTableView *OpenIAPTableViewMatchingNetworkLC(TUint32aNetwork)

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(TUint32aServiceId,
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 aServiceIdID of the service to match
const TDesC & aServiceTypeService type to match

SetAgentClientTimeoutL(const TDesC &, TInt)

IMPORT_C voidSetAgentClientTimeoutL(const TDesC &aService,
TIntaClientTimeout
)
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 & aServiceThe service that the client timeout is associated with. This is one of DIAL OUT ISP TABLE, DIAL IN ISP TABLE, OUTGOING WCDMA TABLE.
TInt aClientTimeoutThe client timeout.

SetAgentExtL(const TDesC &, const TDesC &)

IMPORT_C voidSetAgentExtL(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 & aServiceThe service that will use the agent. This is one of DIAL OUT ISP TABLE, DIAL IN ISP TABLE, OUTGOING WCDMA TABLE.
const TDesC & aAgentExtThe agent extention to use.

SetAgentL(const TDesC &, const TDesC &)

IMPORT_C voidSetAgentL(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 & aServiceThe service that will use the agent. This is one of DIAL OUT ISP TABLE, DIAL IN ISP TABLE, OUTGOING WCDMA TABLE.
const TDesC & aAgentThe agent to use.

SetAgentRouteTimeoutL(const TDesC &, TInt)

IMPORT_C voidSetAgentRouteTimeoutL(const TDesC &aService,
TIntaRouteTimeout
)
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 & aServiceThe 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 aRouteTimeoutThe route timeout.

SetGlobalSettingL(const TDesC &, TUint32)

IMPORT_C voidSetGlobalSettingL(const TDesC &aSetting,
TUint32aValue
)

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 & aSettingSetting to get.
TUint32 aValueSetting value.

SetGlobalSettingL(const TDesC &, const TDesC &)

IMPORT_C voidSetGlobalSettingL(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 & aSettingSetting to get.
const TDesC & aValueOn return, the setting value.

Member Enumerations Documentation

Enum TGlobalSettingType

Enumerators

ENotASetting
EGlobalSetting
ECompatibilitySetting