Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: commdb.lib
Link against: cdbpreftable.h

Class CCommsDbConnectionPrefTableView

CCommsDbConnectionPrefTableView

Support

Supported from 6.1

Description

Provides access to the Connection preferences table, to allow clients to set the preferred order in which connections are attempted.

The class is similiar to CCommsDbTableView, but only allows access to connection preferences as a set and not to individual fields in the table. This prevents inappropriate updates of the records. Like CCommsDbTableView, the class has a group of functions for navigating through the records in the view, and another group for setting fields in the current record.

Clients do not create this type of object, but get an instance through CCommsDatabase::OpenConnectionPrefTableLC(), CCommsDatabase::OpenConnectionPrefTableInRankOrderLC(), or CCommsDatabase::OpenConnectionPrefTableViewOnRankLC().

In addition to the leave codes documented, all leaving functions can leave with any error returned by DBMS during database manipulation.

Derivation

CBaseBase class for all classes to be instantiated on the heap
CCommsDbConnectionPrefTableViewProvides access to the Connection preferences table, to allow clients to set the preferred order in which connections are attempted

Defined in CCommsDbConnectionPrefTableView:
ChangeConnectionPreferenceRankL(), DeleteConnectionPreferenceL(), GotoFirstRecord(), GotoNextRecord(), GotoPreviousRecord(), InsertConnectionPreferenceL(), ReadConnectionPreferenceL(), SwapConnectionPreferencesL(), TCommDbIapBearer, TCommDbIapConnectionPref, UpdateBearerL(), UpdateDialogPrefL(), ~CCommsDbConnectionPrefTableView()

Inherited from CBase:
operator new()

See also:


Destructor


~CCommsDbConnectionPrefTableView()

~CCommsDbConnectionPrefTableView();

Description

Destructor.

[Top]


Navigating records in the view


GotoFirstRecord()

TInt GotoFirstRecord();

Description

Sets the first record in the view as the current record.

Return value

TInt

KErrNotFound if the view has no records. Error codes from DBMS can also be returned.


GotoNextRecord()

TInt GotoNextRecord();

Description

Sets the next record in the view as the current record.

Return value

TInt

KErrNotFound if the current record is the last in the view. Error codes from DBMS can also be returned.


GotoPreviousRecord()

TInt GotoPreviousRecord();

Description

Sets the previous record in the view as the current record.

Return value

TInt

KErrNotFound if the current record is the first in the view. Error codes from DBMS can also be returned.

[Top]


Connection preference record operations


ChangeConnectionPreferenceRankL()

void ChangeConnectionPreferenceRankL(TUint32 aNewRank);

Description

Sets the rank field (CONNECT_PREF_RANKING) in the current record in the view.

Note that if the new rank is not zero, and there is already a record with this rank and the same direction, then the existing record's rank is set to zero. This means that record is not used when the system finds the preferred connections.

Parameters

TUint32 aNewRank

The new rank for the record.

Leave codes

KErrAccessDenied

The record cannot be updated as it is read-only

KErrNotFound

There is no current record in the view

KErrOverflow

aNewRank is greater than the maximum allowed


DeleteConnectionPreferenceL()

void DeleteConnectionPreferenceL();

Description

Deletes the current record in the view.


InsertConnectionPreferenceL()

void InsertConnectionPreferenceL(const TCommDbIapConnectionPref& aPref, TBool aReadOnly = EFalse);

Description

Sets a new connection preference.

Note that connection preference records cannot be marked as hidden.

Parameters

const TCommDbIapConnectionPref& aPref

Settings for the new connection preference

TBool aReadOnly = EFalse

If true, the record is set to be read-only

Leave codes

KErrAlreadyExists

A record with the same ranking already exists

KErrArgument

The specified IAP (aPref.iBearer.iIapId) cannot be used, as it does not fall in the bearer defined by aPref.iBearer.iBearerSet and have the same direction as aPref.iDirection

KErrOverflow

The ranking is greater than the maximum allowed (currently 2)


ReadConnectionPreferenceL()

void ReadConnectionPreferenceL(TCommDbIapConnectionPref& aPref);

Description

Gets the connection preferences from the current record in the view.

Parameters

TCommDbIapConnectionPref& aPref

On return, the connection preferences

Leave codes

KErrNotFound

There is no current record in the view

KErrUnknown

A field in the connection preference record is null


SwapConnectionPreferencesL()

void SwapConnectionPreferencesL(TCommDbConnectionDirection aDirection, TUint32 aFirstRank, TUint32 aSecondRank);

Description

Swaps the bearer (CONNECT_PREF_BEARER_SET) and the IAP (CONNECT_PREF_IAP) fields between two connection preferences records.

The records to use are specified by their rank (CONNECT_PREF_RANKING) and direction (CONNECTION_PREF_DIRECTION).

Parameters

TCommDbConnectionDirection aDirection

Direction of the connection preferences records

TUint32 aFirstRank

Rank of the first record to swap

TUint32 aSecondRank

Rank of the second record to swap

Leave codes

KErrAccessDenied

The record cannot be updated as it is read-only

KErrArgument

There is more than one record with the same ranking as one of the rankings

KErrNotFound

A record with one of the rankings does not exist

KErrOverflow

One of the rankings is greater than the maximum allowed


UpdateBearerL()

void UpdateBearerL(const TCommDbIapBearer& aUpdate, TBool aReadOnly = EFalse);

Description

Updates the connection preference record that is current in the view.

The function sets the bearer set (CONNECT_PREF_BEARER_SET) and IAP (CONNECT_PREF_IAP) fields. The direction field (CONNECTION_PREF_DIRECTION) cannot be altered after it has been written to the record.

Parameters

const TCommDbIapBearer& aUpdate

Updated settings for the connection preference. Note that all fields need to be set, including any unchanged fields.

TBool aReadOnly = EFalse

If true, the record is set to be read-only

Leave codes

KErrAccessDenied

The record cannot be updated as it is read-only

KErrArgument

The specified IAP (aPref.iBearer.iIapId) cannot be used, as it does not fall in the bearer set defined by aPref.iBearer.iBearerSet and have the same direction as aPref.iDirection

KErrNotFound

There is no current record in the view


UpdateDialogPrefL()

void UpdateDialogPrefL(const TCommDbDialogPref& aUpdate);

Description

Updates the dialog preference field (CONNECT_PREF_DIALOG_PREF) in the current record in the view.

Parameters

const TCommDbDialogPref& aUpdate

New value for the dialog preference field

Leave codes

KErrAccessDenied

The record cannot be updated as it is read-only

KErrNotFound

There is no current record in the view

[Top]


Class TCommDbIapBearer

TCommDbIapBearer

Description

Encapsulates the bearer set (CONNECT_PREF_BEARER_SET) and IAP (CONNECT_PREF_IAP) fields.

Defined in CCommsDbConnectionPrefTableView::TCommDbIapBearer:
TCommDbIapBearer(), iBearerSet, iIapId

See also:


TCommDbIapBearer()

TCommDbIapBearer();

Description

Default constructor.

All member data is initialised to zero.


iBearerSet

TUint32 iBearerSet;

Description

Value for the bearer set (CONNECT_PREF_BEARER_SET) field.


iIapId

TUint32 iIapId;

Description

Value for the IAP (CONNECT_PREF_IAP) field.

[Top]


Class TCommDbIapConnectionPref

TCommDbIapConnectionPref

Description

Encapsulates the rank (CONNECT_PREF_RANKING), direction (CONNECTION_PREF_DIRECTION), and dialog preference (CONNECT_PREF_DIALOG_PREF) fields, plus a TCommDbIapBearer object.

Defined in CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref:
TCommDbIapConnectionPref(), iBearer, iDialogPref, iDirection, iRanking, operator==()

See also:


TCommDbIapConnectionPref()

TCommDbIapConnectionPref();

Description

Default constructor.

The rank is set to 0, and the direction and dialog preference to unknown.


operator==()

TBool operator==(const TCommDbIapConnectionPref& aPref) const;

Description

Overloaded equality operator.

Parameters

const TCommDbIapConnectionPref& aPref

Object to compare

Return value

TBool

True if all fields in the objects are equal, otherwise false


iRanking

TUint32 iRanking;

Description

Value for the rank (CONNECT_PREF_BEARER_SET) field.


iDirection

TCommDbConnectionDirection iDirection;

Description

Value for the direction (CONNECTION_PREF_DIRECTION) field.


iDialogPref

TCommDbDialogPref iDialogPref;

Description

Value for the dialog preference (CONNECT_PREF_DIALOG_PREF) field.


iBearer

TCommDbIapBearer iBearer;

Description

Values for the bearer (CONNECT_PREF_BEARER_SET) and IAP (CONNECT_PREF_IAP) fields.