Symbian
 Developer Library

DEVELOPER LIBRARY

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



Location: cdbover.h
Link against: commdb.lib

Class CCommDbOverrideSettings

class CCommDbOverrideSettings : public CBase

Support

Supported from 5.0

Description

Repository of override settings for columns in tables.

Derivation

CBaseBase class for all classes to be instantiated on the heap
CCommDbOverrideSettingsRepository of override settings for columns in tables

Defined in CCommDbOverrideSettings:
CCommDbOverrideSettings(), CheckL(), Compare(), ConstructL(), EBoolValue, EDes16Value, EDes8Value, EIntValue, ELongDesValue, EParamListFull, EParamListPartial, EUnknownType, FindOverride(), GetBoolOverride(), GetConnectionPreferenceOverride(), GetDesOverride(), GetDesOverride(), GetIntOverride(), GetLongDesOverride(), GetLongDesOverrideLength(), IllegalOverride(), IsOverridden(), MatchIapOverride(), NewL(), NewL(), PartialFull(), SetBoolOverride(), SetConnectionPreferenceOverride(), SetDesOverride(), SetDesOverride(), SetIntOverride(), SetLongDesOverride(), TParamList, TValueType, Type(), iDb, iIapOverrides, iOverrides, iPartialFull, ~CCommDbOverrideSettings()

Inherited from CBase:
operator new()


Allocation and construction


NewL()

static CCommDbOverrideSettings* NewL(TParamList aParamList);

Support

Withdrawn in 6.0
Supported from 7.0

Description

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.

Parameters

TParamList aParamList

Unused.

Return value

CCommDbOverrideSettings*

A pointer to the new override settings object.

Notes:


NewL()

static CCommDbOverrideSettings* NewL(TParamList aParamList, TCommDbDatabaseType aType);

Support

Supported from 6.0
Withdrawn in 7.0

Description

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.

Parameters

TParamList aParamList

An enumerator that declares whether the new override settings object is to be full or partial.

TCommDbDatabaseType aType

For version 6.1 onwards, this should always be set to EDatabaseTypeIAP. For version 6.0, it is used to set the type of database to an IAP or ISP type.

Return value

CCommDbOverrideSettings*

A pointer to the new override settings object.

[Top]


Destruction


~CCommDbOverrideSettings()

~CCommDbOverrideSettings();

Description

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

[Top]


Database type


Type()

TCommDbDatabaseType Type() const;

Support

Supported from 6.0
Withdrawn in 7.0

Description

Gets the database type.

Return value

TCommDbDatabaseType

For version 6.1 onwards, this is always EDatabaseTypeIAP. For version 6.0, it indicates if the database is of an IAP or ISP type.

[Top]


Setting override values


SetIntOverride()

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

Description

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:

Parameters

const TDesC& aTableName

A reference to a descriptor containing the name of a table in the communications database.

const TDesC& aColumn

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.

Return value

KErrNone

Success

KErrNotSupported

The specified table does not have a default (when overriding the default), or the table does not support overrides

KErrNotFound

The specified table and/or column does not exist

KErrAlreadyExists

The specified column is already overridden


SetBoolOverride()

TInt SetBoolOverride(const TDesC& aTableName, const TDesC& aColumnName, TBool aValue);

Description

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

For the function to succeed:

Parameters

const TDesC& aTableName

A reference to a descriptor containing the name of a table in the communications database.

const TDesC& aColumn

A reference to a descriptor containing the name of a column in table aTableName.

TBool aValue

The override value.

Return value

KErrNone

Success

KErrNotSupported

The specified table does not have a default (when overriding the default), or the table does not support overrides

KErrNotFound

The specified table and/or column does not exist

KErrAlreadyExists

The specified column is already overridden


SetDesOverride()

TInt SetDesOverride(const TDesC& aTableName, const TDesC& aColumnName, const TDesC8& aValue);

Description

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:

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& aColumn

A reference to a descriptor containing the name of a column in table aTableName.

const TDesC8& aValue

The override value.

Return value

KErrNone

Success

KErrNotSupported

The specified table does not have a default (when overriding the default), or the table does not support overrides

KErrNotFound

The specified table and/or column does not exist

KErrAlreadyExists

The specified column is already overridden


SetDesOverride()

TInt SetDesOverride(const TDesC& aTableName, const TDesC& aColumnName, const TDesC16& aValue);

Description

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:

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& aColumn

A reference to a descriptor containing the name of a column in tableaTableName.

const TDesC16& aValue

The override value.

Return value

KErrNone

Success

KErrNotSupported

The specified table does not have a default (when overriding the default), or the table does not support overrides

KErrNotFound

The specified table and/or column does not exist

KErrAlreadyExists

The specified column is already overridden


SetLongDesOverride()

TInt SetLongDesOverride(const TDesC& aTableName, const TDesC& aColumnName, const TDesC& aValue);

Description

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

For the function to succeed:

Parameters

const TDesC& aTableName

A reference to a descriptor containing the name of a table in the communications database.

const TDesC& aColumn

A reference to a descriptor containing the name of a column in tableaTableName.

const TDesC& aValue

The override value.

Return value

KErrNone

Success

KErrNotSupported

The specified table does not have a default (when overriding the default), or the table does not support overrides

KErrNotFound

The specified table and/or column does not exist

KErrAlreadyExists

The specified column is already overridden

[Top]


Getting override values


GetIntOverride()

TInt GetIntOverride(const TDesC& aTableName, const TDesC& aColumnName, TUint32& aValue);

Description

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:

Parameters

const TDesC& aTableName

A reference to a descriptor containing the name of a table in the communications database.

const TDesC& aColumn

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.

Return value

KErrNone

Success

KErrNotFound

The specified table and/or column has not been overridden or does not exist


GetBoolOverride()

TInt GetBoolOverride(const TDesC& aTableName, const TDesC& aColumnName, TBool& aValue);

Description

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

For this function to succeed:

Parameters

const TDesC& aTableName

A reference to a descriptor containing the name of a table in the communications database.

const TDesC& aColumn

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.

Return value

KErrNone

Success

KErrNotFound

The specified table and/or column has not been overridden or does not exist


GetDesOverride()

TInt GetDesOverride(const TDesC& aTableName, const TDesC& aColumnName, TDes8& aValue);

Description

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:

Parameters

const TDesC& aTableName

A reference to a descriptor containing the name of a table in the communications database.

const TDesC& aColumn

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.

Return value

KErrNone

Success

KErrNotFound

The specified table and/or column has not been overridden or does not exist

KErrOverflow

The aValue parameter was too smal.


GetDesOverride()

TInt GetDesOverride(const TDesC& aTableName, const TDesC& aColumnName, TDes16& aValue);

Description

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:

Parameters

const TDesC& aTableName

A reference to a descriptor containing the name of a table in the communications database.

const TDesC& aColumn

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.

Return value

KErrNone

Success

KErrNotFound

The specified table and/or column has not been overridden or does not exist.

KErrOverflow

The aValue parameter was too smal.


GetLongDesOverrideLength()

TInt GetLongDesOverrideLength(const TDesC& aTableName, const TDesC& aColumnName, TInt& aLength);

Description

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:

Parameters

const TDesC& aTableName

A reference to a descriptor containing the name of a table in the communications database.

const TDesC& aColumn

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.

Return value

KErrNone

Success

KErrNotFound

The specified table and/or column has not been overridden or does not exist.

KErrOverflow

The aValue parameter was too smal.


GetLongDesOverride()

TInt GetLongDesOverride(const TDesC& aTableName, const TDesC& aColumnName, TDes& aValue);

Description

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

For this function to succeed:

Parameters

const TDesC& aTableName

A reference to a descriptor containing the name of a table in the communications database.

const TDesC& aColumn

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.

Return value

KErrNone

Success

KErrNotFound

The specified table and/or column has not been overridden or does not exist

Notes:

[Top]


Information


IsOverridden()

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

Description

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.

Return value

TBool

ETrue if the value is overridden, EFalse otherwise.


PartialFull()

TParamList PartialFull() const;

Description

Returns the value set in the constructor.

Return value

TParamList

An enumeration which determines whether this set of override values is full or partial.


Compare()

TBool Compare(CCommDbOverrideSettings* aOverrides) const;

Description

Compares aOverrides with this class.

Parameters

CCommDbOverrideSettings* aOverrides

Return value

TBool

ETrue if aOverrides has the same as this class, EFalse if not.

[Top]


Connection preferences table

Description

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:


SetConnectionPreferenceOverride()

TInt SetConnectionPreferenceOverride(const CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref& aPref);

Support

Supported from 6.1

Description

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:

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

Parameters

const CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref& aPref

Connection preference settings by which to override

Return value

TInt

An error code from an override setting function, e.g. SetIntOverride(), as documented above.

See also:


GetConnectionPreferenceOverride()

TInt GetConnectionPreferenceOverride(CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref& aPref);

Support

Supported from 6.1

Description

Gets the overrides for a record in the Connection preferences table. 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.

Return value

TInt

KErrArgument if all the members of aPref are zero; KErrNotFound if no matching override is found.

[Top]


Enumerations


Enum TParamList

TParamList

Description

This enumeration has been deprecated in 7.0

Override setting flags returned by PartialFull().

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

enum TValueType

Description

The value types that may be stored in as overrides

EIntValue

a TUint32.

EBoolValue

a TBool.

EDes8Value

a TDes8.

EDes16Value

a TDes16.

ELongDesValue

a TDes.

EUnknownType

Unkown type.

[Top]


Internal members


CCommDbOverrideSettings()

protected: CCommDbOverrideSettings(TParamList aParamList);

Description

This member is internal and not intended for use.


ConstructL()

protected: virtual void ConstructL();

Description

This member is internal and not intended for use.


FindOverride()

protected: TInt FindOverride(const TDesC& aTableName, const TDesC& aColumnName, TValueType aType) const;

Description

This member is internal and not intended for use.


IllegalOverride()

protected: TBool IllegalOverride(const TDesC& aTableName, const TDesC& aColumnName) const;

Description

This member is internal and not intended for use.


CheckL()

protected: void CheckL(const TDesC& aTableName, const TDesC& aColumnName, TValueType aType) const;

Description

This member is internal and not intended for use.


MatchIapOverride()

protected: static TBool MatchIapOverride(const TCommDbIapConnectionPrefOverride& aFirst, const TCommDbIapConnectionPrefOverride& aSecond);

Description

This member is internal and not intended for use.


iPartialFull

protected: TParamList iPartialFull;

Description

This member is internal and not intended for use.


iOverrides

protected: RPointerArray<CCommDbOverride> iOverrides;

Description

This member is internal and not intended for use.


iIapOverrides

protected: RArray<TCommDbIapConnectionPrefOverride> iIapOverrides;

Description

This member is internal and not intended for use.


iDb

protected: CCommsDatabase* iDb;

Description

This member is internal and not intended for use.