CCommDbOverrideSettings Class Reference

class CCommDbOverrideSettings : public CBase

Repository of override settings for columns in tables. Overrides are deprecated from v9.1

Holds all information about CommDb overrides. Allows the client to store, retrieve and test the existence of overrides.

Inherits from

  • CCommDbOverrideSettings
Public Member Functions
~CCommDbOverrideSettings()
IMPORT_C TBoolCompare(CCommDbOverrideSettings *)
IMPORT_C TIntGetBoolOverride(const TDesC &, const TDesC &, TBool &)
IMPORT_C TIntGetConnectionPreferenceOverride(CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref &)
IMPORT_C TIntGetConnectionPreferenceOverride(CCommsDbConnectionPrefTableView::TCommDbIspConnectionPref &)
IMPORT_C TIntGetDesOverride(const TDesC &, const TDesC &, TDes8 &)
IMPORT_C TIntGetDesOverride(const TDesC &, const TDesC &, TDes16 &)
IMPORT_C TIntGetIntOverride(const TDesC &, const TDesC &, TUint32 &)
IMPORT_C TIntGetLongDesOverride(const TDesC &, const TDesC &, TDes &)
IMPORT_C TIntGetLongDesOverrideLength(const TDesC &, const TDesC &, TInt &)
IMPORT_C TBoolIsOverridden(const TDesC &, const TDesC &, TValueType)
IMPORT_C CCommDbOverrideSettings *NewL(TParamList)
IMPORT_C CCommDbOverrideSettings *NewL(TParamList, TCommDbDatabaseType)
TParamList PartialFull()
IMPORT_C TIntSetBoolOverride(const TDesC &, const TDesC &, TBool)
IMPORT_C TIntSetConnectionPreferenceOverride(const CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref &)
IMPORT_C TIntSetConnectionPreferenceOverride(const CCommsDbConnectionPrefTableView::TCommDbIspConnectionPref &)
IMPORT_C TIntSetDesOverride(const TDesC &, const TDesC &, const TDesC8 &)
IMPORT_C TIntSetDesOverride(const TDesC &, const TDesC &, const TDesC16 &)
IMPORT_C TIntSetIntOverride(const TDesC &, const TDesC &, TUint32)
IMPORT_C TIntSetLongDesOverride(const TDesC &, const TDesC &, const TDesC &)
Protected Member Functions
CCommDbOverrideSettings(TParamList)
voidCheckL(const TDesC &, const TDesC &, TValueType)
voidConstructL()
TInt FindOverride(const TDesC &, const TDesC &, TValueType)
TBool IllegalOverride(const TDesC &, const TDesC &)
TBool MatchIapOverride(const TCommDbIapConnectionPrefOverride &, const TCommDbIapConnectionPrefOverride &)
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()
Public Member Enumerations
enumTParamList { EParamListPartial, EParamListFull }
enumTValueType {
EIntValue, EBoolValue, EDes8Value, EDes16Value, ELongDesValue, EUnknownType
}
Protected Attributes
CCommsDatabase *iDb
RArray< TCommDbIapConnectionPrefOverride >iIapOverrides
RPointerArray< CCommDbOverride >iOverrides
TParamList iPartialFull

Constructor & Destructor Documentation

CCommDbOverrideSettings(TParamList)

CCommDbOverrideSettings(TParamListaParamList)[protected]

Constructor

Parameters

TParamList aParamListAn enumerator which indicates whether the override settings are partial or full.

~CCommDbOverrideSettings()

IMPORT_C~CCommDbOverrideSettings()[virtual]

Frees all resources owned by this object, prior to its destruction. Specifically, it closes the communications database and severs the connection with the DBMS.

Member Functions Documentation

CheckL(const TDesC &, const TDesC &, TValueType)

voidCheckL(const TDesC &aTableName,
const TDesC &aColumnName,
TValueTypeaType
)const [protected]

Checks whether the column aColumnName of type aType in the table aTableName exists. Panic if the column doesn't exist in the table, otherwise leave with KErrNotFound.

Parameters

const TDesC & aTableNameA reference to a descriptor containing the name of a table in the communications database.
const TDesC & aColumnName
TValueType aTypeThe override type.

Compare(CCommDbOverrideSettings *)

IMPORT_C TBoolCompare(CCommDbOverrideSettings *aOverrides)const

Compares aOverrides with this class.

Parameters

CCommDbOverrideSettings * aOverridesOverrides.

ConstructL()

voidConstructL()[protected, virtual]

FindOverride(const TDesC &, const TDesC &, TValueType)

TInt FindOverride(const TDesC &aTableName,
const TDesC &aColumnName,
TValueTypeaType
)const [protected]

Checks whether the given table, column are overridden for the given type.

Parameters

const TDesC & aTableNameA reference to a descriptor containing the name of a table in the communications database.
const TDesC & aColumnNameA reference to a descriptor containing the name of a column in table aTableName.
TValueType aTypeThe override type.

GetBoolOverride(const TDesC &, const TDesC &, TBool &)

IMPORT_C TIntGetBoolOverride(const TDesC &aTableName,
const TDesC &aColumnName,
TBool &aValue
)

Gets an override value for a boolean type column in the specified table in the communications database.

For this function to succeed: An override for this column for this table must exist The table must be one which supports override settings

Parameters

const TDesC & aTableNameA reference to a descriptor containing the name of a table in the communications database.
const TDesC & aColumnNameA reference to a descriptor containing the name of a column in table aTableName.
TBool & aValueA boolean type passed by the caller. On successful return from this function, it contains the override value.

GetConnectionPreferenceOverride(CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref &)

IMPORT_C TIntGetConnectionPreferenceOverride(CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref &aPref)

Gets the overrides for a record in the Connection preferences table filtered by the contents of `aPref`. Any field in `aPref` may be ignored in the filter by initialising with the following values: aPref.iRanking == 0, aPref.iDirection == ECommDbConnectionDirectionUnknown, aPref.iDialogPref == ECommDbDialogPrefUnknown, aPref.iBearer.iBearerSet == 0, aPref.iBearer.iIapId == 0 The client should set the ranking and the direction of the aPref parameter to the values to be matched when getting the override, e.g. set the iRanking member to 1 and iDirection to ECommDbConnectionDirectionOutgoing to retrieve the overrides for the outgoing connection preference with ranking 1.

Parameters

CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref & aPrefInitially specifies the record for which to get the overrides (the record is matched against the settings in aPref). On return, the override settings for that record.

GetConnectionPreferenceOverride(CCommsDbConnectionPrefTableView::TCommDbIspConnectionPref &)

IMPORT_C TIntGetConnectionPreferenceOverride(CCommsDbConnectionPrefTableView::TCommDbIspConnectionPref &aPref)

v7.0S

Left in place for 6.1 BC purposes.

Parameters

CCommsDbConnectionPrefTableView::TCommDbIspConnectionPref & aPrefConnection preference settings.

GetDesOverride(const TDesC &, const TDesC &, TDes8 &)

IMPORT_C TIntGetDesOverride(const TDesC &aTableName,
const TDesC &aColumnName,
TDes8 &aValue
)

Gets an override value for an 8 bit descriptor text type column in the specified table in the communications database.

For this function to succeed: An override for this column for this table must exist The table must be one which supports override settings

Parameters

const TDesC & aTableNameA reference to a descriptor containing the name of a table in the communications database.
const TDesC & aColumnNameA reference to a descriptor containing the name of a column in table aTableName.
TDes8 & aValueAn 8 bit type descriptor passed by the caller. On successful return from this function, it contains the override value. This parameter must be as long as KCommsDbSvrMaxFieldLength or the function will fail.

GetDesOverride(const TDesC &, const TDesC &, TDes16 &)

IMPORT_C TIntGetDesOverride(const TDesC &aTableName,
const TDesC &aColumnName,
TDes16 &aValue
)

Gets an override value for a 16 bit descriptor text type column in the specified table in the communications database.

For this function to succeed: An override for this column for this table must exist The table must be one which supports override settings

Parameters

const TDesC & aTableNameA reference to a descriptor containing the name of a table in the communications database.
const TDesC & aColumnNameA reference to a descriptor containing the name of a column in table aTableName.
TDes16 & aValueA 16 bit type descriptor passed by the caller. On successful return from this function, it contains the override value. This parameter must be as long as KCommsDbSvrMaxFieldLength or the function will fail.

GetIntOverride(const TDesC &, const TDesC &, TUint32 &)

IMPORT_C TIntGetIntOverride(const TDesC &aTableName,
const TDesC &aColumnName,
TUint32 &aValue
)

Gets an override value for an unsigned integer type column in the specified table in the communications database.

If the column name is empty, i.e. the length of the descriptor aColumnName is zero, then the override value is assumed to be the overriding Id for the default record for table aTableName.

For this function to succeed: An override for this column (or the the overriding default record Id) for this table must exist The table must be one which supports override settings

Parameters

const TDesC & aTableNameA reference to a descriptor containing the name of a table in the communications database.
const TDesC & aColumnNameA reference to a descriptor containing the name of a column in table aTableName.
TUint32 & aValueAn unsigned integer type passed by the caller. On successful return from this function, it contains the override value.

GetLongDesOverride(const TDesC &, const TDesC &, TDes &)

IMPORT_C TIntGetLongDesOverride(const TDesC &aTableName,
const TDesC &aColumnName,
TDes &aValue
)

Gets the override value for a column in the specified table in the communications database.

For this function to succeed: An override for this column for this table must exist The table must be one which supports override settings Notes: The maximum length of the descriptor aValue must be large enough to contain the override text. Use the GetLongDesOverrideLength() function to find the length of this text.

Parameters

const TDesC & aTableNameA reference to a descriptor containing the name of a table in the communications database.
const TDesC & aColumnNameA reference to a descriptor containing the name of a column in table aTableName.
TDes & aValueA descriptor passed by the caller. On successful return from this function, it contains the override value.

GetLongDesOverrideLength(const TDesC &, const TDesC &, TInt &)

IMPORT_C TIntGetLongDesOverrideLength(const TDesC &aTableName,
const TDesC &aColumnName,
TInt &aLength
)

Gets the length of the long text override value for a column in the specified table in the communications database.

For this function to succeed: An override for this column for this table must exist The table must be one which supports override settings

Parameters

const TDesC & aTableNameA reference to a descriptor containing the name of a table in the communications database.
const TDesC & aColumnNameA reference to a descriptor containing the name of a column in table aTableName.
TInt & aLengthA signed integer type passed by the caller. On successful return from this function, it contains the override value.

IllegalOverride(const TDesC &, const TDesC &)

TBool IllegalOverride(const TDesC &aTableName,
const TDesC &aColumnName
)const [protected]

Checks whether the overrides are legal or not.

Parameters

const TDesC & aTableNameA reference to a descriptor containing the name of a table in the communications database.
const TDesC & aColumnNameA reference to a descriptor containing the name of a column in table aTableName.

IsOverridden(const TDesC &, const TDesC &, TValueType)

IMPORT_C TBoolIsOverridden(const TDesC &aTableName,
const TDesC &aColumnName,
TValueTypeaType
)

Tests whether an override value of a specified type exists in the communications database.

Parameters

const TDesC & aTableNameA reference to a descriptor containing the name of a table in the communications database.
const TDesC & aColumnNameA reference to a descriptor containing the name of a column in table aTableName which is to be overridden.
TValueType aTypeAn enumeration which indicates the type of data in column aType which is to be overridden.

MatchIapOverride(const TCommDbIapConnectionPrefOverride &, const TCommDbIapConnectionPrefOverride &)

TBool MatchIapOverride(const TCommDbIapConnectionPrefOverride &aFirst,
const TCommDbIapConnectionPrefOverride &aSecond
)[protected, static]

Checks if the dialog preference fields in the passed objects of TCommDbIapConnectionPrefOverride are equal.

Parameters

const TCommDbIapConnectionPrefOverride & aFirstA reference to TCommDbIapConnectionPrefOverride class
const TCommDbIapConnectionPrefOverride & aSecondA reference to TCommDbIapConnectionPrefOverride class

NewL(TParamList)

IMPORT_C CCommDbOverrideSettings *NewL(TParamListaParamList)[static]

Allocates and constructs an override settings object.

The construction process automatically opens the communications database and connects to the DBMS. The database is closed and the connection to the DBMS is severed when this override object is destroyed.

This function was withdrawn in 6.0, but reintroduced in 7.0.

Parameters

TParamList aParamListUnused except when comparing two sets.

NewL(TParamList, TCommDbDatabaseType)

IMPORT_C CCommDbOverrideSettings *NewL(TParamListaParamList,
TCommDbDatabaseTypeaDbType
)[static]

7.0

Allocates and constructs an override settings object. The construction process automatically opens the communications database and connects to the DBMS. The database is closed and the connection to the DBMS is severed when this override object is destroyed. Re-instated override variant of NewL function in order to maintain BC with 6.1

Parameters

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

PartialFull()

TParamList PartialFull()const [inline]

Returns the value set in the constructor.

SetBoolOverride(const TDesC &, const TDesC &, TBool)

IMPORT_C TIntSetBoolOverride(const TDesC &aTableName,
const TDesC &aColumnName,
TBoolaValue
)

Sets an override value for a boolean type column in the specified table in the communications database. For the function to succeed: The column must exist The column type must be boolean An override for this column for this table must not already exist The table must be one which supports override settings

Parameters

const TDesC & aTableNameA reference to a descriptor containing the name of a table in the communications database.
const TDesC & aColumnNameA reference to a descriptor containing the name of a column in table aTableName.
TBool aValueThe override value.

SetConnectionPreferenceOverride(const CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref &)

IMPORT_C TIntSetConnectionPreferenceOverride(const CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref &aPref)

Sets overrides for a record in the Connection preferences table.

The rank (CONNECT_PREF_RANKING and the direction (CONNECTION_PREF_DIRECTION part of the aPref parameter must be filled in to indicate which connection preference is to be overridden. It is therefore not possible to override the rank or direction of a connection preference.

The other fields should be filled in one of the following ways to override the other settings:

Only dialog preference (CONNECT_PREF_DIALOG_PREF) is filled in to override this field (all others should have zero value).

Only bearer set and IAP ID (CONNECT_PREF_BEARER_SET) are filled in to override these fields (all other fields should have zero value).

The bearer set, IAP ID and the dialog preference are filled in to override these fields.

CommDb treats zero values as fields that the client does not wish to override.

A note on overriding connection preferences. This is clearly a desirable thing to be able to do, so that the application may choose its own particular first and second preference for a connection. However, at the moment it is only possible to override one row of settings per table, i.e. it would only be possible to override the first ranked connection preferences or the second ranked connection preferences, but not both. To solve this problem, two API functions are added to the CCommDbOverrideSettings class specifically for overriding connection preferences.

Parameters

const CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref & aPrefConnection preference settings by which to override.

SetConnectionPreferenceOverride(const CCommsDbConnectionPrefTableView::TCommDbIspConnectionPref &)

IMPORT_C TIntSetConnectionPreferenceOverride(const CCommsDbConnectionPrefTableView::TCommDbIspConnectionPref &aPref)

7.0

Framework left in place for 6.1 compatibility purposes.

Parameters

const CCommsDbConnectionPrefTableView::TCommDbIspConnectionPref & aPrefNot supported.

SetDesOverride(const TDesC &, const TDesC &, const TDesC8 &)

IMPORT_C TIntSetDesOverride(const TDesC &aTableName,
const TDesC &aColumnName,
const TDesC8 &aValue
)

Sets an override value for an 8 bit descriptor text type column in the specified table in the communications database.

For the function to succeed: The column must exist The column type must be narrow (ASCII) text An override for this column for this table must not already exist. The table must be one which supports override settings

In addition, the maximum length of text expected by this function is the value of the constant KCommsDbSvrMaxFieldLength. The length of aValue supplied by the caller cannot be greater than this value.

Parameters

const TDesC & aTableNameA reference to a descriptor containing the name of a table in the communications database.
const TDesC & aColumnNameA reference to a descriptor containing the name of a column in table aTableName.
const TDesC8 & aValueThe override value.

SetDesOverride(const TDesC &, const TDesC &, const TDesC16 &)

IMPORT_C TIntSetDesOverride(const TDesC &aTableName,
const TDesC &aColumnName,
const TDesC16 &aValue
)

Sets an override value for a 16 bit descriptor text type column in the specified table in the communications database.

For the function to succeed: The column must exist The column type must be wide (UNICODE) text An override for this column for this table must not already exist The table must be one which supports override settings

In addition, the maximum length of text expected by this function is the value of the constant KCommsDbSvrMaxFieldLength. The length of aValue supplied by the caller cannot be greater than this value.

Parameters

const TDesC & aTableNameA reference to a descriptor containing the name of a table in the communications database.
const TDesC & aColumnNameA reference to a descriptor containing the name of a column in table aTableName.
const TDesC16 & aValueThe override value.

SetIntOverride(const TDesC &, const TDesC &, TUint32)

IMPORT_C TIntSetIntOverride(const TDesC &aTableName,
const TDesC &aColumnName,
TUint32aValue
)

Sets an override value for the specified unsigned integer type column in the specified table in the communications database. If the column name is empty, i.e. the length of the descriptor aColumnName is zero, then the override value is assumed to be the overriding ID for the default record for table aTableName. This means that the table must be one which supports default records.

For the function to succeed: The column must exist The column type must be an unsigned integer An override for this column (or the overriding default record ID) for this table must not already exist The table must be one which supports override settings

Parameters

const TDesC & aTableNameA reference to a descriptor containing the name of a table in the communications database.
const TDesC & aColumnNameA reference to a descriptor containing the name of a column in table aTableName. If this descriptor is empty, i.e. its length is zero, then aValue is assumed to be the overriding ID for the default record.
TUint32 aValueThe override value.

SetLongDesOverride(const TDesC &, const TDesC &, const TDesC &)

IMPORT_C TIntSetLongDesOverride(const TDesC &aTableName,
const TDesC &aColumnName,
const TDesC &aValue
)

Sets an override value for a long text type column in a specified table in the communications database.

For the function to succeed: The column must exist The column type is assumed to be arbitrarily long text (within the limits defined by descriptors) An override for this column for this table must not already exist The table must be one which supports override settings

Parameters

const TDesC & aTableNameA reference to a descriptor containing the name of a table in the communications database.
const TDesC & aColumnNameA reference to a descriptor containing the name of a column in table aTableName.
const TDesC & aValueThe override value.

Member Enumerations Documentation

Enum TParamList

v7.0

Override setting flags returned by PartialFull(). The only use of TParamList is during the comparison of two override sets.

Enumerators

EParamListPartial

The override settings are partial; the CCommDbOverrideSettings object maintains override values for only some of the columns.

EParamListFull

The override settings are full; the CCommDbOverrideSettings object maintains override values for all columns

Enum TValueType

The value types that may be stored in as overrides Overrides are deprecated from v9.1 "Could just use TDbColType"

Enumerators

EIntValue

a TUint32.

EBoolValue

a TBool.

EDes8Value

a TDes8.

EDes16Value

a TDes16.

ELongDesValue

a TDes.

EUnknownType

Unkown type.

Member Data Documentation

CCommsDatabase * iDb

CCommsDatabase *iDb[protected]

RArray< TCommDbIapConnectionPrefOverride > iIapOverrides

RArray< TCommDbIapConnectionPrefOverride >iIapOverrides[protected]

RPointerArray< CCommDbOverride > iOverrides

RPointerArray< CCommDbOverride >iOverrides[protected]

TParamList iPartialFull

TParamList iPartialFull[protected]