Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

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



Location: cdbover.h
Link against: commdb.lib

Class CCommDbOverrideSettings

CCommDbOverrideSettings

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:
EParamListFull, EParamListPartial, GetBoolOverride(), GetConnectionPreferenceOverride(), GetDesOverride(), GetIntOverride(), GetLongDesOverride(), GetLongDesOverrideLength(), IsOverridden(), NewL(), PartialFull(), SetBoolOverride(), SetConnectionPreferenceOverride(), SetDesOverride(), SetIntOverride(), SetLongDesOverride(), TParamList, Type(), ~CCommDbOverrideSettings()

Inherited from CBase:
operator new()


Allocation and construction


NewL()

static CCommDbOverrideSettings* NewL(TParamList aParamList);

Support

Withdrawn in 6.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 which declares whether the new override settings object is to be full or partial.

Return value

CCommDbOverrideSettings*

A pointer to the new override settings object.


NewL()

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

Support

Supported from 6.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

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 defined in cdblen.h. 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 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 defined in cdblen.h. 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 descriptoraColumnName is zero, then the override value is assumed to be the overriding Id for the default record for tableaTableName.

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

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

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

TDes8& aValue

An 8 bit type 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


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

TDes16& aValue

A 16 bit type 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


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

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


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:

Note:

The maximum length of the descriptor aValue must be large enough to contain the override text. Use theGetLongDesOverrideLength() 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& aColumn

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

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

[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 tableaTableName which is to be overridden.

TValueType aType

An enumeration which indicates the type of data in columnaType which is to be overridden.

Return value

TBool

true if the value is overridden, false otherwise.


PartialFull()

TParamList PartialFull() const;

Description

Determines whether the override list is full or partial.

Return value

TParamList

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

[Top]


Connection preferences table


GetConnectionPreferenceOverride()

TInt GetConnectionPreferenceOverride(CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref& aPref);

Support

Supported from 6.1

Description

Gets the overrides for a record in the Connection preferences table.

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.


SetConnectionPreferenceOverride()

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

Support

Supported from 6.1

Description

Sets overrides for a record in the Connection preferences table.

The record to override is specified by the combination of rank (CONNECT_PREF_RANKING) and direction (CONNECTION_PREF_DIRECTION) fields, which therefore must be specified in aPref and cannot be overriden.

You can use the other fields in aPref to override the dialog preference (CONNECT_PREF_DIALOG_PREF) and/or bearer set (CONNECT_PREF_BEARER_SET) fields. Set a field to zero if you do not want to override it.

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:

[Top]


Enumerations


Enum TParamList

TParamList

Description

Override setting flags returned by PartialFull().

EParamListPartial

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

EParamListFull

The override settings are full; theCCommDbOverrideSettingsobject maintains override values for all columns