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

Public Member Functions
~CCommDbOverrideSettings ()
IMPORT_C TBool Compare ( CCommDbOverrideSettings *)
IMPORT_C TInt GetBoolOverride (const TDesC &, const TDesC &, TBool &)
IMPORT_C TInt GetConnectionPreferenceOverride ( CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref &)
IMPORT_C TInt GetConnectionPreferenceOverride ( CCommsDbConnectionPrefTableView::TCommDbIspConnectionPref &)
IMPORT_C TInt GetDesOverride (const TDesC &, const TDesC &, TDes8 &)
IMPORT_C TInt GetDesOverride (const TDesC &, const TDesC &, TDes16 &)
IMPORT_C TInt GetIntOverride (const TDesC &, const TDesC &, TUint32 &)
IMPORT_C TInt GetLongDesOverride (const TDesC &, const TDesC &, TDes &)
IMPORT_C TInt GetLongDesOverrideLength (const TDesC &, const TDesC &, TInt &)
IMPORT_C TBool IsOverridden (const TDesC &, const TDesC &, TValueType )
IMPORT_C CCommDbOverrideSettings * NewL ( TParamList )
IMPORT_C CCommDbOverrideSettings * NewL ( TParamList , TCommDbDatabaseType )
TParamList PartialFull ()
IMPORT_C TInt SetBoolOverride (const TDesC &, const TDesC &, TBool )
IMPORT_C TInt SetConnectionPreferenceOverride (const CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref &)
IMPORT_C TInt SetConnectionPreferenceOverride (const CCommsDbConnectionPrefTableView::TCommDbIspConnectionPref &)
IMPORT_C TInt SetDesOverride (const TDesC &, const TDesC &, const TDesC8 &)
IMPORT_C TInt SetDesOverride (const TDesC &, const TDesC &, const TDesC16 &)
IMPORT_C TInt SetIntOverride (const TDesC &, const TDesC &, TUint32 )
IMPORT_C TInt SetLongDesOverride (const TDesC &, const TDesC &, const TDesC &)
Protected Member Functions
CCommDbOverrideSettings ( TParamList )
void CheckL (const TDesC &, const TDesC &, TValueType )
void ConstructL ()
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
enum TParamList { EParamListPartial , EParamListFull }
enum TValueType {
EIntValue , EBoolValue , EDes8Value , EDes16Value , ELongDesValue , EUnknownType
}
Protected Attributes
CCommsDatabase * iDb
RArray < TCommDbIapConnectionPrefOverride > iIapOverrides
RPointerArray < CCommDbOverride > iOverrides
TParamList iPartialFull

Constructor & Destructor Documentation

CCommDbOverrideSettings(TParamList)

CCommDbOverrideSettings ( TParamList aParamList ) [protected]

Constructor

Parameters

TParamList aParamList An 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)

void CheckL ( const TDesC & aTableName,
const TDesC & aColumnName,
TValueType aType
) 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 & aTableName A reference to a descriptor containing the name of a table in the communications database.
const TDesC & aColumnName
TValueType aType The override type.

Compare(CCommDbOverrideSettings *)

IMPORT_C TBool Compare ( CCommDbOverrideSettings * aOverrides ) const

Compares aOverrides with this class.

Parameters

CCommDbOverrideSettings * aOverrides Overrides.

ConstructL()

void ConstructL ( ) [protected, virtual]

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

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

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

Parameters

const TDesC & aTableName A reference to a descriptor containing the name of a table in the communications database.
const TDesC & aColumnName A reference to a descriptor containing the name of a column in table aTableName.
TValueType aType The override type.

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

IMPORT_C TInt GetBoolOverride ( 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 & aTableName A reference to a descriptor containing the name of a table in the communications database.
const TDesC & aColumnName A reference to a descriptor containing the name of a column in table aTableName.
TBool & aValue A boolean type passed by the caller. On successful return from this function, it contains the override value.

GetConnectionPreferenceOverride(CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref &)

IMPORT_C TInt GetConnectionPreferenceOverride ( 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 & aPref Initially 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 TInt GetConnectionPreferenceOverride ( CCommsDbConnectionPrefTableView::TCommDbIspConnectionPref & aPref )

v7.0S

Left in place for 6.1 BC purposes.

Parameters

CCommsDbConnectionPrefTableView::TCommDbIspConnectionPref & aPref Connection preference settings.

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

IMPORT_C TInt GetDesOverride ( 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 & aTableName A reference to a descriptor containing the name of a table in the communications database.
const TDesC & aColumnName A reference to a descriptor containing the name of a column in table aTableName.
TDes8 & aValue An 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 TInt GetDesOverride ( 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 & aTableName A reference to a descriptor containing the name of a table in the communications database.
const TDesC & aColumnName A reference to a descriptor containing the name of a column in table aTableName.
TDes16 & aValue A 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 TInt GetIntOverride ( 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 & aTableName A reference to a descriptor containing the name of a table in the communications database.
const TDesC & aColumnName A reference to a descriptor containing the name of a column in table aTableName.
TUint32 & aValue An 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 TInt GetLongDesOverride ( 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 & aTableName A reference to a descriptor containing the name of a table in the communications database.
const TDesC & aColumnName A reference to a descriptor containing the name of a column in table aTableName.
TDes & aValue A descriptor passed by the caller. On successful return from this function, it contains the override value.

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

IMPORT_C TInt GetLongDesOverrideLength ( 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 & aTableName A reference to a descriptor containing the name of a table in the communications database.
const TDesC & aColumnName A reference to a descriptor containing the name of a column in table aTableName.
TInt & aLength A 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 & aTableName A reference to a descriptor containing the name of a table in the communications database.
const TDesC & aColumnName A reference to a descriptor containing the name of a column in table aTableName.

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

IMPORT_C TBool IsOverridden ( const TDesC & aTableName,
const TDesC & aColumnName,
TValueType aType
)

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

Parameters

const TDesC & aTableName A reference to a descriptor containing the name of a table in the communications database.
const TDesC & aColumnName A reference to a descriptor containing the name of a column in table aTableName which is to be overridden.
TValueType aType An 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 & aFirst A reference to TCommDbIapConnectionPrefOverride class
const TCommDbIapConnectionPrefOverride & aSecond A reference to TCommDbIapConnectionPrefOverride class

NewL(TParamList)

IMPORT_C CCommDbOverrideSettings * NewL ( TParamList aParamList ) [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 aParamList Unused except when comparing two sets.

NewL(TParamList, TCommDbDatabaseType)

IMPORT_C CCommDbOverrideSettings * NewL ( TParamList aParamList,
TCommDbDatabaseType aDbType
) [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 aParamList Parameter list.
TCommDbDatabaseType aDbType Whether 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 TInt SetBoolOverride ( const TDesC & aTableName,
const TDesC & aColumnName,
TBool aValue
)

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 & aTableName A reference to a descriptor containing the name of a table in the communications database.
const TDesC & aColumnName A reference to a descriptor containing the name of a column in table aTableName.
TBool aValue The override value.

SetConnectionPreferenceOverride(const CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref &)

IMPORT_C TInt SetConnectionPreferenceOverride ( 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 & aPref Connection preference settings by which to override.

SetConnectionPreferenceOverride(const CCommsDbConnectionPrefTableView::TCommDbIspConnectionPref &)

IMPORT_C TInt SetConnectionPreferenceOverride ( const CCommsDbConnectionPrefTableView::TCommDbIspConnectionPref & aPref )

7.0

Framework left in place for 6.1 compatibility purposes.

Parameters

const CCommsDbConnectionPrefTableView::TCommDbIspConnectionPref & aPref Not supported.

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

IMPORT_C TInt SetDesOverride ( 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 & aTableName A reference to a descriptor containing the name of a table in the communications database.
const TDesC & aColumnName A reference to a descriptor containing the name of a column in table aTableName.
const TDesC8 & aValue The override value.

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

IMPORT_C TInt SetDesOverride ( 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 & aTableName A reference to a descriptor containing the name of a table in the communications database.
const TDesC & aColumnName A reference to a descriptor containing the name of a column in table aTableName.
const TDesC16 & aValue The override value.

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

IMPORT_C TInt SetIntOverride ( const TDesC & aTableName,
const TDesC & aColumnName,
TUint32 aValue
)

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 & aTableName A reference to a descriptor containing the name of a table in the communications database.
const TDesC & aColumnName A 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 aValue The override value.

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

IMPORT_C TInt SetLongDesOverride ( 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 & aTableName A reference to a descriptor containing the name of a table in the communications database.
const TDesC & aColumnName A reference to a descriptor containing the name of a column in table aTableName.
const TDesC & aValue The 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]