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.
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 &) |
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 |
CCommDbOverrideSettings | ( | TParamList | aParamList | ) | [protected] |
Constructor
TParamList aParamList | An enumerator which indicates whether the override settings are partial or full. |
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.
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.
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. |
IMPORT_C TBool | Compare | ( | CCommDbOverrideSettings * | aOverrides | ) | const |
Compares aOverrides with this class.
CCommDbOverrideSettings * aOverrides | Overrides. |
TInt | FindOverride | ( | const TDesC & | aTableName, |
const TDesC & | aColumnName, | |||
TValueType | aType | |||
) | const [protected] |
Checks whether the given table, column are overridden for the given type.
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. |
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
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. |
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.
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. |
IMPORT_C TInt | GetConnectionPreferenceOverride | ( | CCommsDbConnectionPrefTableView::TCommDbIspConnectionPref & | aPref | ) |
v7.0S
Left in place for 6.1 BC purposes.
CCommsDbConnectionPrefTableView::TCommDbIspConnectionPref & aPref | Connection preference settings. |
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
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. |
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
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. |
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
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. |
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.
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. |
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
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. |
TBool | IllegalOverride | ( | const TDesC & | aTableName, |
const TDesC & | aColumnName | |||
) | const [protected] |
Checks whether the overrides are legal or not.
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.
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. |
TBool | MatchIapOverride | ( | const TCommDbIapConnectionPrefOverride & | aFirst, |
const TCommDbIapConnectionPrefOverride & | aSecond | |||
) | [protected, static] |
Checks if the dialog preference fields in the passed objects of TCommDbIapConnectionPrefOverride are equal.
const TCommDbIapConnectionPrefOverride & aFirst | A reference to TCommDbIapConnectionPrefOverride class |
const TCommDbIapConnectionPrefOverride & aSecond | A reference to TCommDbIapConnectionPrefOverride class |
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.
TParamList aParamList | Unused except when comparing two sets. |
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
TParamList aParamList | Parameter list. |
TCommDbDatabaseType aDbType | Whether Database is IAP or ISP version. All Db's are IAP type now. |
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
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.
const CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref & aPref | Connection preference settings by which to override. |
IMPORT_C TInt | SetConnectionPreferenceOverride | ( | const CCommsDbConnectionPrefTableView::TCommDbIspConnectionPref & | aPref | ) |
7.0
Framework left in place for 6.1 compatibility purposes.
const CCommsDbConnectionPrefTableView::TCommDbIspConnectionPref & aPref | Not supported. |
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.
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.
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
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. |
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
v7.0
Override setting flags returned by PartialFull() . The only use of TParamList is during the comparison of two override sets.
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 |
The value types that may be stored in as overrides Overrides are deprecated from v9.1 "Could just use TDbColType"
RArray < TCommDbIapConnectionPrefOverride > | iIapOverrides | [protected] |
RPointerArray < CCommDbOverride > | iOverrides | [protected] |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.