CCommsDatabase Class Reference

#include <commdb.h>

Link against: commdb.lib

class CCommsDatabase : public CCommsDatabaseBase

Inherits from

Public Member Functions
virtual ~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)
Inherited Attributes
CCommsDatabaseBase::iDatabase
CCommsDatabaseBase::iImpl
CCommsDatabaseBase::iImplNotCreated
CCommsDatabaseBase::iInInternalTransaction
CCommsDatabaseBase::iNotifications
CCommsDatabaseBase::iNotifier
CCommsDatabaseBase::iNotifierOpenError
CCommsDatabaseBase::iShowHiddenRecords
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::CCommsDbConnectionPrefTableView
CCommsDatabaseBase::CCommsDbProtectConnectPrefTableView
CCommsDatabaseBase::CCommsDbProtectTableView
CCommsDatabaseBase::CCommsDbTableView
CCommsDatabaseBase::CCommsDbTemplateRecord
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()

Detailed Description

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.

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 Function Documentation

ClearAgentAndExtL ( const TDesC & )

IMPORT_C voidClearAgentAndExtL(const TDesC &aService)

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

Deprecated

ParameterDescription
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.
ParameterDescription
aSettingSetting to clear.

DoOpenL ( TCommDbOpeningMethod &, TBool )

voidDoOpenL(TCommDbOpeningMethod &aOpeningMethod,
TBoolaUseDefaultDb
)[protected]

Connects to the Commsdat and set version number

GetAgentClientTimeoutL ( const TDesC & )

IMPORT_C TIntGetAgentClientTimeoutL(const TDesC &aService)
DeprecatedThis 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.

ParameterDescription
aServiceThe service that the timeout is associated with. This is one of DIAL OUT ISP TABLE, DIAL IN ISP TABLE, OUTGOING WCDMA TABLE.

Returns: The agent timeout setting.

GetAgentExtL ( const TDesC &, TDes & )

IMPORT_C voidGetAgentExtL(const TDesC &aService,
TDes &aAgentExt
)
DeprecatedThis 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.

ParameterDescription
aServiceThe service that will use the agent. This is one of DIAL OUT ISP TABLE, DIAL IN ISP TABLE, OUTGOING WCDMA TABLE.
aAgentExtOn return, the agent extension.

GetAgentL ( const TDesC &, TDes & )

IMPORT_C voidGetAgentL(const TDesC &aService,
TDes &aAgent
)
DeprecatedThis 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.

ParameterDescription
aServiceThe service that will use the agent. This is one of DIAL OUT ISP TABLE, DIAL IN ISP TABLE, OUTGOING WCDMA TABLE.
aAgentOn return, the agent.

GetAgentRouteTimeoutL ( const TDesC & )

IMPORT_C TIntGetAgentRouteTimeoutL(const TDesC &aService)
DeprecatedThis 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.

ParameterDescription
aServiceThe service that the route timeout is associated with. This is one of DIAL OUT ISP TABLE, DIAL IN ISP TABLE, OUTGOING WCDMA TABLE.

Returns: The route timeout.

GetCurrentDialInSettingL ( const TDesC &, TUint32 & )

IMPORT_C voidGetCurrentDialInSettingL(const TDesC &aSetting,
TUint32 &aValue
)

DeprecatedThis 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.
ParameterDescription
aSettingSetting to get.
aValueOn return, setting value.

GetCurrentDialOutSettingL ( const TDesC &, TUint32 & )

IMPORT_C voidGetCurrentDialOutSettingL(const TDesC &aSetting,
TUint32 &aValue
)

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

leave
KErrNotSupported No longer supported.
ParameterDescription
aSettingSetting to get.
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.

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.
ParameterDescription
aSettingSetting to get.
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.
ParameterDescription
aSettingSetting to get.
aValueOn return, the setting value

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.

Returns: A pointer to a communications database 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.
ParameterDescription
aUseDefaultDbUse the default database.

Returns: A pointer to a communications database object.

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.

ParameterDescription
aOpeningMethodOn return, the opening method. 0

Returns: A pointer to a communications database object.

NewL ( TCommDbDatabaseType )

IMPORT_C CCommsDatabase *NewL(TCommDbDatabaseTypeaDbType)[static]

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

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

Returns: CCommDbOverrideSettings* the calling function takes ownership of the returned object

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

ParameterDescription
aDbTypeWhether Database is IAP or ISP version. All Db's are IAP type now.
aOpeningMethodOn return, the method of opening.

Returns: CCommDbOverrideSettings* the calling function takes ownership of the returned object.

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

Returns: The opened 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.

Returns: The opened view

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

Returns: The opened 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.
ParameterDescription
aDirectionDirection of the records to include in the view
aRankRanking of the records to include in the view

Returns: The opened view

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

Returns: The opened view.

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.

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.
ParameterDescription
aServiceIdID of the service to match
aServiceTypeService type to match

Returns: The opened view

SetAgentClientTimeoutL ( const TDesC &, TInt )

IMPORT_C voidSetAgentClientTimeoutL(const TDesC &aService,
TIntaClientTimeout
)
DeprecatedThis 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.

ParameterDescription
aServiceThe service that the client timeout is associated with. This is one of DIAL OUT ISP TABLE, DIAL IN ISP TABLE, OUTGOING WCDMA TABLE.
aClientTimeoutThe client timeout.

SetAgentExtL ( const TDesC &, const TDesC & )

IMPORT_C voidSetAgentExtL(const TDesC &aService,
const TDesC &aAgentExt
)
DeprecatedThis 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.

ParameterDescription
aServiceThe service that will use the agent. This is one of DIAL OUT ISP TABLE, DIAL IN ISP TABLE, OUTGOING WCDMA TABLE.
aAgentExtThe agent extention to use.

SetAgentL ( const TDesC &, const TDesC & )

IMPORT_C voidSetAgentL(const TDesC &aService,
const TDesC &aAgent
)

DeprecatedThis 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.
ParameterDescription
aServiceThe service that will use the agent. This is one of DIAL OUT ISP TABLE, DIAL IN ISP TABLE, OUTGOING WCDMA TABLE.
aAgentThe agent to use.

SetAgentRouteTimeoutL ( const TDesC &, TInt )

IMPORT_C voidSetAgentRouteTimeoutL(const TDesC &aService,
TIntaRouteTimeout
)
DeprecatedThis 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.

ParameterDescription
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.
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.
ParameterDescription
aSettingSetting to get.
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.
ParameterDescription
aSettingSetting to get.
aValueOn return, the setting value.