CCommsDbConnectionPrefTableView Class Reference

class CCommsDbConnectionPrefTableView : public CBase

Implements actions on records of 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.

CCommDbOverrideSettings::GetConnectionPreferenceOverride() CCommDbOverrideSettings::SetConnectionPreferenceOverride()

Inherits from

  • CCommsDbConnectionPrefTableView
Public Member Functions
~CCommsDbConnectionPrefTableView()
IMPORT_C voidChangeConnectionPreferenceRankL(TUint32)
IMPORT_C voidDeleteConnectionPreferenceL()
IMPORT_C TIntGotoFirstRecord()
IMPORT_C TIntGotoNextRecord()
IMPORT_C TIntGotoPreviousRecord()
IMPORT_C voidInsertConnectionPreferenceL(const TCommDbIapConnectionPref &, TBool)
IMPORT_C voidInsertConnectionPreferenceL(const TCommDbIspConnectionPref &, TBool)
CCommsDbConnectionPrefTableView *NewL(CCommsDatabase &, TCommDbConnectionDirection, TUint32)
CCommsDbConnectionPrefTableView *NewLC(CCommsDatabase &, const TDbQuery &)
CCommsDbConnectionPrefTableView *NewLC(CCommsDatabase &, TCommDbConnectionDirection, TBool)
IMPORT_C voidReadConnectionPreferenceL(TCommDbIapConnectionPref &)
IMPORT_C voidReadConnectionPreferenceL(TCommDbIspConnectionPref &)
IMPORT_C voidSwapConnectionPreferencesL(TCommDbConnectionDirection, TUint32, TUint32)
IMPORT_C voidUpdateBearerL(const TCommDbIapBearer &, TBool)
IMPORT_C voidUpdateBearerL(const TCommDbIspBearer &, TBool)
IMPORT_C voidUpdateDialogPrefL(const TCommDbDialogPref &)
Protected Member Functions
CCommsDbConnectionPrefTableView(CCommsDatabase &)
voidClose()
TDbColNo ColNum(const TDesC &)
voidConstructL(const TDbQuery &)
voidConstructL(TCommDbConnectionDirection, TBool)
voidConstructL(TCommDbConnectionDirection, TUint32)
RDbRowSet::TAccess GetL()
voidGetUint32L(const TDesC &, TUint32 &)
voidOpenL(const TDbQuery &)
Private Member Functions
voidDoSwapConnectionPreferencesL(TCommDbConnectionDirection, TUint32, TUint32)
voidSetRankL(TUint32)
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()
Protected Attributes
CCommsDatabase &iDb
CCommDbTableExtension *iTableExt
RDbView iTableView

Constructor & Destructor Documentation

CCommsDbConnectionPrefTableView(CCommsDatabase &)

CCommsDbConnectionPrefTableView(CCommsDatabase &aDb)[protected]

Constructor

Parameters

CCommsDatabase & aDbreference to the database to use.

~CCommsDbConnectionPrefTableView()

IMPORT_C~CCommsDbConnectionPrefTableView()[virtual]

Destructor.

Member Functions Documentation

ChangeConnectionPreferenceRankL(TUint32)

IMPORT_C voidChangeConnectionPreferenceRankL(TUint32aNewRank)

Sets the rank field (CONNECT_PREF_RANKING) in the currently selected connection preference 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.

leave
KErrAccessDenied The record cannot be updated as it is read-only
leave
KErrNotFound There is no current record in the view
leave
KErrOverflow aNewRank is greater than the maximum allowed
capability
Dependent on table, see the guide page referenced below.

Parameters

TUint32 aNewRankThe new rank for the record.

Close()

voidClose()[protected]

Closes the rowset and releases any owned resources.

ColNum(const TDesC &)

TDbColNo ColNum(const TDesC &aColumn)const [protected, inline]

Returns the column number of the Column aColumn in the table

Coloumn concept doesn't exist in CommsDat depNot supported from v9.1

Parameters

const TDesC & aColumnA reference to a descriptor containing the name of a column in the current record.

ConstructL(const TDbQuery &)

voidConstructL(const TDbQuery &aQuery)[protected]

Prepares and evaluates the table view using the SQL query aQuery

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

Parameters

const TDbQuery & aQueryQuery to perform

ConstructL(TCommDbConnectionDirection, TBool)

voidConstructL(TCommDbConnectionDirectionaDirection,
TBoolaSortRanking
)[protected]

Creates RecordSet Container and loads date to it.

Parameters

TCommDbConnectionDirection aDirection
TBool aSortRanking

ConstructL(TCommDbConnectionDirection, TUint32)

voidConstructL(TCommDbConnectionDirectionaDirection,
TUint32aRank
)[protected]

Prepares and evaluates the table view using params

Parameters

TCommDbConnectionDirection aDirection
TUint32 aRank

DeleteConnectionPreferenceL()

IMPORT_C voidDeleteConnectionPreferenceL()
Deletes the currently selected connection preference record in the view.
capability
Dependent on table, see the guide page referenced below.

DoSwapConnectionPreferencesL(TCommDbConnectionDirection, TUint32, TUint32)

voidDoSwapConnectionPreferencesL(TCommDbConnectionDirectionaDirection,
TUint32aFirstRank,
TUint32aSecondRank
)[private]

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

Note that the dialogue option is not altered.

leave
KErrAccessDenied The record cannot be updated as it is read-only
leave
KErrArgument There is more than one record with the same ranking as one of the rankings
leave
KErrNotFound A record with one of the rankings does not exist
leave
KErrOverflow One of the rankings is greater than the maximum allowed
capability
Dependent on table, see the guide page referenced below.

Parameters

TCommDbConnectionDirection aDirectionDirection of the connection preferences records
TUint32 aFirstRankRank of the first record to swap
TUint32 aSecondRankRank of the second record to swap

GetL()

RDbRowSet::TAccess GetL()[protected]

Gets the operations that can be performed on the current connection preference record If there isn't an access table at all, then treat the table as updatable.

GetUint32L(const TDesC &, TUint32 &)

voidGetUint32L(const TDesC &aColumnName,
TUint32 &aValue
)[protected]

Parameters

const TDesC & aColumnName
TUint32 & aValue

GotoFirstRecord()

IMPORT_C TIntGotoFirstRecord()

Sets the first connection preference record in this view as the current record.

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

GotoNextRecord()

IMPORT_C TIntGotoNextRecord()

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

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

GotoPreviousRecord()

IMPORT_C TIntGotoPreviousRecord()

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

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

InsertConnectionPreferenceL(const TCommDbIapConnectionPref &, TBool)

IMPORT_C voidInsertConnectionPreferenceL(const TCommDbIapConnectionPref &aPref,
TBoolaReadOnly = EFalse
)

Inserts a new IAP connection preference into the connetion preference table. The supplied `aPref` is checked to ensure that the rank and direction do not conflict with existing records. The dialog option, bearer set and IAP are checked for consistancy. Deprecated in 7.0 but re-instated to accommodate 6.1 BC

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

Parameters

const TCommDbIapConnectionPref & aPrefSettings for the new connection preference.
TBool aReadOnly = EFalseIf ETrue the record is set to be read-only. If left unspecified the default is EFalse.

InsertConnectionPreferenceL(const TCommDbIspConnectionPref &, TBool)

IMPORT_C voidInsertConnectionPreferenceL(const TCommDbIspConnectionPref &aPref,
TBoolaReadOnly = EFalse
)

Override version of InsertConnectionPreferenceL for BC purposes. This method is deprecated from 9.1 and always returns/leaves with KErrNotSupported instead of describing past operation/parameters.

Parameters

const TCommDbIspConnectionPref & aPrefPreferences.
TBool aReadOnly = EFalseRead only?

NewL(CCommsDatabase &, TCommDbConnectionDirection, TUint32)

CCommsDbConnectionPrefTableView *NewL(CCommsDatabase &aDb,
TCommDbConnectionDirectionaDirection,
TUint32aRank
)[static]

Create a view. Usually, however, views are created by calling one of the CCommsDatabase::OpenConnectionPrefTable*LC() functions.

Parameters

CCommsDatabase & aDbreference to the database to use.
TCommDbConnectionDirection aDirection
TUint32 aRank

NewLC(CCommsDatabase &, const TDbQuery &)

CCommsDbConnectionPrefTableView *NewLC(CCommsDatabase &aDb,
const TDbQuery &aQuery
)[static]

CCommsDbConnectionPrefTableView definitions Create a view. Usually, however, views are created by calling one of the CCommsDatabase::OpenConnectionPrefTable*LC() functions.

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

Parameters

CCommsDatabase & aDbreference to the database to use.
const TDbQuery & aQueryQuery to preform

NewLC(CCommsDatabase &, TCommDbConnectionDirection, TBool)

CCommsDbConnectionPrefTableView *NewLC(CCommsDatabase &aDb,
TCommDbConnectionDirectionaDirection,
TBoolaSortRanking = EFalse
)[static]

Create a view. Usually, however, views are created by calling one of the CCommsDatabase::OpenConnectionPrefTable*LC() functions.

Parameters

CCommsDatabase & aDbreference to the database to use.
TCommDbConnectionDirection aDirection
TBool aSortRanking = EFalse-> ETrue Sort by ranking, EFalse not sorted

OpenL(const TDbQuery &)

voidOpenL(const TDbQuery &aQuery)[protected]

Parameters

const TDbQuery & aQuery

ReadConnectionPreferenceL(TCommDbIapConnectionPref &)

IMPORT_C voidReadConnectionPreferenceL(TCommDbIapConnectionPref &aPref)

Gets the IAP connection preferences record currently selected in the view.

leave
KErrNotFound There is no current record in the view
leave
KErrUnknown A field in the connection preference record is null
capability
Dependent on table, see the guide page referenced below.

Parameters

TCommDbIapConnectionPref & aPrefOn return, the connection preferences

ReadConnectionPreferenceL(TCommDbIspConnectionPref &)

IMPORT_C voidReadConnectionPreferenceL(TCommDbIspConnectionPref &aPref)

in v7.0

Framework left to support BC with v6.1
leave
KErrNotSupported

Parameters

TCommDbIspConnectionPref & aPref

SetRankL(TUint32)

voidSetRankL(TUint32aNewRank)[private]

Parameters

TUint32 aNewRank

SwapConnectionPreferencesL(TCommDbConnectionDirection, TUint32, TUint32)

IMPORT_C voidSwapConnectionPreferencesL(TCommDbConnectionDirectionaDirection,
TUint32aFirstRank,
TUint32aSecondRank
)

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

Note that the dialogue option is not altered.

leave
KErrAccessDenied The record cannot be updated as it is read-only
leave
KErrArgument There is more than one record with the same ranking as one of the rankings
leave
KErrNotFound A record with one of the rankings does not exist
leave
KErrOverflow One of the rankings is greater than the maximum allowed
capability
Dependent on table, see the guide page referenced below.

Parameters

TCommDbConnectionDirection aDirectionDirection of the connection preferences records
TUint32 aFirstRankRank of the first record to swap
TUint32 aSecondRankRank of the second record to swap

UpdateBearerL(const TCommDbIapBearer &, TBool)

IMPORT_C voidUpdateBearerL(const TCommDbIapBearer &aUpdate,
TBoolaReadOnly = EFalse
)
Update the bearer set and IAP for the currently selected IAP connection preference record. The dialog option, bearer set and IAP are checked for consistancy. Deprecated in 7.0 but re-instated to accomodate 6.1 BC. Update the bearer set and iap for the currently selected connection preference. The dialog option, bearer set and IAP are checked for consistancy. 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.
leave
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.
capability
Dependent on table, see the guide page referenced below.

Parameters

const TCommDbIapBearer & aUpdateUpdated settings for the connection preference. Note that all fields need to be set, including any unchanged fields.
TBool aReadOnly = EFalseIf true, the record is set to be read-only. If unspecified, EFalse by default.

UpdateBearerL(const TCommDbIspBearer &, TBool)

IMPORT_C voidUpdateBearerL(const TCommDbIspBearer &aUpdate,
TBoolaReadOnly = EFalse
)

Override version of UpdateBearerL for BC purposes. This method is deprecated from 9.1 and always returns/leaves with KErrNotSupported instead of describing past operation/parameters.

Parameters

const TCommDbIspBearer & aUpdateUpdate.
TBool aReadOnly = EFalseRead only?

UpdateDialogPrefL(const TCommDbDialogPref &)

IMPORT_C voidUpdateDialogPrefL(const TCommDbDialogPref &aUpdate)

Updates the dialog preference field (CONNECT_PREF_DIALOG_PREF) in the currently selected connection preferences IAP record in the view.

leave
KErrAccessDenied The record cannot be updated as it is read-only
leave
KErrNotFound There is no current record in the view
capability
Dependent on table, see the guide page referenced below.

Parameters

const TCommDbDialogPref & aUpdateNew value for the dialog preference field

Member Data Documentation

CCommsDatabase & iDb

CCommsDatabase &iDb[protected]

Comms data base that is being viewed.

CCommDbTableExtension * iTableExt

CCommDbTableExtension *iTableExt[protected]

RDbView iTableView

RDbView iTableView[protected]

DBMS view. Variable not used in shim. Not removed because of BC break