Symbian
Symbian OS Library

SYMBIAN OS V9.3

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



Location: COMMDB.H
Link against: commdb.lib

Class CCommsDatabase

class CCommsDatabase : public CCommsDatabaseBase;

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.

Derivation

Members

Defined in CCommsDatabase:
ClearAgentAndExtL(), ClearGlobalSettingL(), CreateDatabaseL(), GetAgentClientTimeoutL(), GetAgentExtL(), GetAgentL(), GetAgentRouteTimeoutL(), GetCurrentDialInSettingL(), GetCurrentDialOutSettingL(), GetDefaultTsyL(), GetGlobalSettingL(), GetGlobalSettingL(), NewL(), NewL(), NewL(), NewL(), NewL(), OpenConnectionPrefTableInRankOrderLC(), OpenConnectionPrefTableLC(), OpenConnectionPrefTableLC(), OpenConnectionPrefTableViewOnRankLC(), OpenIAPTableViewMatchingBearerSetLC(), OpenIAPTableViewMatchingNetworkLC(), OpenViewOnProxyRecordLC(), SetAgentClientTimeoutL(), SetAgentExtL(), SetAgentL(), SetAgentRouteTimeoutL(), SetGlobalSettingL(), SetGlobalSettingL(), ~CCommsDatabase()

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

Inherited from CCommsDatabaseBase:
BeginTransaction(), CancelRequestNotification(), CheckReadCapability(), CheckWriteCapability(), CommitTransaction(), Database(), InTransaction(), IsDatabaseWriteLockedL(), OpenTableLC(), OpenViewLC(), OpenViewMatchingBoolLC(), OpenViewMatchingTextLC(), OpenViewMatchingUintLC(), RequestNotification(), ResolvePhoneNumberFromDatabaseL(), ResolvePhoneNumberL(), RollbackTransaction(), ShowHiddenRecords(), Version(), iDatabase, iImpl, iImplNotCreated, iInInternalTransaction, iNotifications, iNotifier, iNotifierOpenError, iShowHiddenRecords


Construction and destruction


NewL()

static IMPORT_C CCommsDatabase *NewL();

Description

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.

Return value

CCommsDatabase *

A pointer to a communications database object.


NewL()

static IMPORT_C CCommsDatabase *NewL(TBool aUseDefaultDb);

Description

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.

Parameters

TBool aUseDefaultDb

Use the default database.

Return value

CCommsDatabase *

A pointer to a communications database object.

Leave codes

KErrNotSupported

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


NewL()

static IMPORT_C CCommsDatabase *NewL(TCommDbOpeningMethod &aOpeningMethod);

Description

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

Return value

CCommsDatabase *

A pointer to a communications database object.


~CCommsDatabase()

virtual IMPORT_C ~CCommsDatabase();

Description

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

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


NewL()

static IMPORT_C CCommsDatabase *NewL(TCommDbDatabaseType aDbType);

Description

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.

Return value

CCommsDatabase *

CCommDbOverrideSettings* the calling function takes ownership of the returned object


NewL()

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

Description

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.

Return value

CCommsDatabase *

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

[Top]


Member functions


GetGlobalSettingL()

Capability: Dependent on table, see the guide page referenced below.

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

Description

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.

Parameters

const TDesC &aSetting

Setting to get.

TUint32 &aValue

On return, the setting value.

Leave codes

KErrNotSupported

if aSetting is invalid; KErrNotFound if the global setting has not been set.

See also


GetGlobalSettingL()

Capability: Dependent on table, see the guide page referenced below.

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

Description

Gets a global settings table string field.

Parameters

const TDesC &aSetting

Setting to get.

TDes &aValue

On return, the setting value

Leave codes

KErrNotSupported

if aSetting is invalid; KErrNotFound if the global setting has not been set

See also


SetGlobalSettingL()

Capability: Dependent on table, see the guide page referenced below.

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

Description

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.

Parameters

const TDesC &aSetting

Setting to get.

TUint32 aValue

Setting value.

Leave codes

KErrNotSupported

aSetting is invalid.

See also


SetGlobalSettingL()

Capability: Dependent on table, see the guide page referenced below.

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

Description

Sets a global settings table string field.

Parameters

const TDesC &aSetting

Setting to get.

const TDesC &aValue

On return, the setting value.

Leave codes

KErrNotSupported

aSetting is invalid.

See also


ClearGlobalSettingL()

Capability: Dependent on table, see the guide page referenced below.

IMPORT_C void ClearGlobalSettingL(const TDesC &aSetting);

Description

Clears a global settings table field.

Parameters

const TDesC &aSetting

Setting to clear.

Leave codes

KErrNotSupported

aSetting is invalid

See also


GetDefaultTsyL()

Capability: Dependent on table, see the guide page referenced below.

IMPORT_C void GetDefaultTsyL(TDes &aValue);

Description

Retrieves the default TSY used for bearer availibility, SMS and data services.

Parameters

TDes &aValue

See also


GetCurrentDialOutSettingL()

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

Description

Parameters

const TDesC &aSetting

Setting to get.

TUint32 &aValue

On return, setting value.

Leave codes

KErrNotSupported

No longer supported.


GetCurrentDialInSettingL()

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

Description

Past use: Retrieve settings for the dial in IAP.

Parameters

const TDesC &aSetting

Setting to get.

TUint32 &aValue

On return, setting value.

Leave codes

KErrNotSupported

No longer supported.


OpenConnectionPrefTableLC()

Capability: Dependent on table, see the guide page referenced below.

IMPORT_C CCommsDbConnectionPrefTableView *OpenConnectionPrefTableLC();

Description

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.

Return value

CCommsDbConnectionPrefTableView *

The opened view


OpenConnectionPrefTableLC()

Capability: Dependent on table, see the guide page referenced below.

IMPORT_C CCommsDbConnectionPrefTableView *OpenConnectionPrefTableLC(TCommDbConnectionDirection aDirection);

Description

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.

Parameters

TCommDbConnectionDirection aDirection

Direction of the records to include in the view

Return value

CCommsDbConnectionPrefTableView *

The opened view


OpenConnectionPrefTableInRankOrderLC()

Capability: Dependent on table, see the guide page referenced below.

IMPORT_C CCommsDbConnectionPrefTableView *OpenConnectionPrefTableInRankOrderLC(TCommDbConnectionDirection aDirection);

Description

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.

Parameters

TCommDbConnectionDirection aDirection

Direction of the records to include in the view

Return value

CCommsDbConnectionPrefTableView *

The opened view


OpenConnectionPrefTableViewOnRankLC()

Capability: Dependent on table, see the guide page referenced below.

IMPORT_C CCommsDbConnectionPrefTableView *OpenConnectionPrefTableViewOnRankLC(TCommDbConnectionDirection aDirection, TUint32 aRank);

Description

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.

Parameters

TCommDbConnectionDirection aDirection

Direction of the records to include in the view

TUint32 aRank

Ranking of the records to include in the view

Return value

CCommsDbConnectionPrefTableView *

The opened view

See also


SetAgentL()

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

Description

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 or CDMA2000 PACKET SERVICE TABLE.

const TDesC &aAgent

The agent to use.

Leave codes

KErrNotSupported

No longer supported.


SetAgentExtL()

IMPORT_C void SetAgentExtL(const TDesC &aService, const TDesC &aAgentExt);

Description

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 or CDMA2000 PACKET SERVICE TABLE.

const TDesC &aAgentExt

The agent extention to use.

Leave codes

KErrNotSupported

No longer supported.


GetAgentL()

IMPORT_C void GetAgentL(const TDesC &aService, TDes &aAgent);

Description

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 or CDMA2000 PACKET SERVICE TABLE.

TDes &aAgent

On return, the agent.

Leave codes

KErrNotSupported

No longer supported.


GetAgentExtL()

IMPORT_C void GetAgentExtL(const TDesC &aService, TDes &aAgentExt);

Description

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 or CDMA2000 PACKET SERVICE TABLE.

TDes &aAgentExt

On return, the agent extension.

Leave codes

KErrNotSupported

No longer supported.


ClearAgentAndExtL()

IMPORT_C void ClearAgentAndExtL(const TDesC &aService);

Description

Parameters

const TDesC &aService

The service that will be cleared of all the agent settings.


SetAgentClientTimeoutL()

IMPORT_C void SetAgentClientTimeoutL(const TDesC &aService, TInt aClientTimeout);

Description

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 or CDMA2000 PACKET SERVICE TABLE.

TInt aClientTimeout

The client timeout.

Leave codes

KErrNotSupported

No longer supported.


SetAgentRouteTimeoutL()

IMPORT_C void SetAgentRouteTimeoutL(const TDesC &aService, TInt aRouteTimeout);

Description

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 or CDMA2000 PACKET SERVICE TABLE.

TInt aRouteTimeout

The route timeout.

Leave codes

KErrNotSupported

No longer supported.


GetAgentClientTimeoutL()

IMPORT_C TInt GetAgentClientTimeoutL(const TDesC &aService);

Description

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 or CDMA2000 PACKET SERVICE TABLE.

Return value

TInt

The agent timeout setting.

Leave codes

KErrNotSupported

No longer supported.


GetAgentRouteTimeoutL()

IMPORT_C TInt GetAgentRouteTimeoutL(const TDesC &aService);

Description

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 or CDMA2000 PACKET SERVICE TABLE.

Return value

TInt

The route timeout.

Leave codes

KErrNotSupported

No longer supported.


OpenIAPTableViewMatchingBearerSetLC()

IMPORT_C CCommsDbTableView *OpenIAPTableViewMatchingBearerSetLC(TUint32 aBearerSet, TCommDbConnectionDirection aDirection);

Description

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

Parameters

TUint32 aBearerSet

TCommDbConnectionDirection aDirection

Return value

CCommsDbTableView *

See also


OpenIAPTableViewMatchingNetworkLC()

IMPORT_C CCommsDbTableView *OpenIAPTableViewMatchingNetworkLC(TUint32 aNetwork);

Description

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

Parameters

TUint32 aNetwork

Return value

CCommsDbTableView *

See also


OpenViewOnProxyRecordLC()

Capability: Dependent on table, see the guide page referenced below.

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

Description

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.

Parameters

TUint32 aServiceId

ID of the service to match

const TDesC &aServiceType

Service type to match

Return value

CCommsDbTableView *

The opened view

Leave codes

KErrArgument

if either aServiceId or aServiceType is invalid; other DBMS-related error codes.


CreateDatabaseL()

private: virtual void CreateDatabaseL();

Description

CCommsDatabaseBase pure virtuals