1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
20 @deprecated since v9.1. Functionality is replaced with commsdat.
28 #include <cdbpreftable.h>
30 class CCommDbOverride;
31 class CCommDbLongDesOverride;
32 class TCommDbIapConnectionPrefOverride;
34 class CCommDbOverrideSettings : public CBase
35 /** Repository of override settings for columns in tables.
37 Overrides are deprecated from v9.1
39 Holds all information about CommDb overrides.
40 Allows the client to store, retrieve and test the existence of overrides.
46 Override setting flags returned by PartialFull().
47 The only use of TParamList is during the comparison of two override sets. */
50 /** The override settings are partial; the CCommDbOverrideSettings object maintains
51 override values for only some of the columns. */
53 /** The override settings are full; the CCommDbOverrideSettings object maintains
54 override values for all columns */
58 /** The value types that may be stored in as overrides
60 Overrides are deprecated from v9.1
61 @internalComponent "Could just use TDbColType" */
79 IMPORT_C static CCommDbOverrideSettings* NewL(TParamList aParamList);
80 IMPORT_C virtual ~CCommDbOverrideSettings();
82 // Setting override values in the override set
83 IMPORT_C TInt SetIntOverride(const TDesC& aTableName, const TDesC& aColumnName, TUint32 aValue);
84 IMPORT_C TInt SetBoolOverride(const TDesC& aTableName, const TDesC& aColumnName, TBool aValue);
85 IMPORT_C TInt SetDesOverride(const TDesC& aTableName, const TDesC& aColumnName, const TDesC8& aValue);
86 IMPORT_C TInt SetDesOverride(const TDesC& aTableName, const TDesC& aColumnName, const TDesC16& aValue);
87 IMPORT_C TInt SetLongDesOverride(const TDesC& aTableName, const TDesC& aColumnName, const TDesC& aValue);
89 // Getting override values from the override set. Returns `KErrNotFound` if the
90 // column has not been overriden.
91 IMPORT_C TInt GetIntOverride(const TDesC& aTableName, const TDesC& aColumnName, TUint32& aValue);
92 IMPORT_C TInt GetBoolOverride(const TDesC& aTableName, const TDesC& aColumnName, TBool& aValue);
93 IMPORT_C TInt GetDesOverride(const TDesC& aTableName, const TDesC& aColumnName, TDes8& aValue);
94 IMPORT_C TInt GetDesOverride(const TDesC& aTableName, const TDesC& aColumnName, TDes16& aValue);
95 IMPORT_C TInt GetLongDesOverride(const TDesC& aTableName, const TDesC& aColumnName, TDes& aValue);
96 IMPORT_C TInt GetLongDesOverrideLength(const TDesC& aTableName, const TDesC& aColumnName, TInt& aLength);
98 IMPORT_C TInt SetConnectionPreferenceOverride(const CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref& aPref);
100 IMPORT_C TInt GetConnectionPreferenceOverride(CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref& aPref);
102 IMPORT_C TBool Compare(CCommDbOverrideSettings* aOverrides) const;
104 IMPORT_C TBool IsOverridden(const TDesC& aTableName, const TDesC& aColumnName, TValueType aType);
106 inline TParamList PartialFull() const;
108 IMPORT_C static CCommDbOverrideSettings* NewL(TParamList aParamList, TCommDbDatabaseType aDbType);
110 IMPORT_C TInt GetConnectionPreferenceOverride(CCommsDbConnectionPrefTableView::TCommDbIspConnectionPref& aPref); // will be deprecated in 7.0
112 IMPORT_C TInt SetConnectionPreferenceOverride(const CCommsDbConnectionPrefTableView::TCommDbIspConnectionPref& aPref); // will be deprecated in 7.0
115 CCommDbOverrideSettings(TParamList aParamList);
116 virtual void ConstructL();
117 TInt FindOverride(const TDesC& aTableName, const TDesC& aColumnName, TValueType aType) const;
118 TBool IllegalOverride(const TDesC& aTableName, const TDesC& aColumnName) const;
119 void CheckL(const TDesC& aTableName, const TDesC& aColumnName, TValueType aType) const;
120 static TBool MatchIapOverride(const TCommDbIapConnectionPrefOverride& aFirst,
121 const TCommDbIapConnectionPrefOverride& aSecond);
123 TParamList iPartialFull;
124 RPointerArray<CCommDbOverride> iOverrides;
125 RArray<TCommDbIapConnectionPrefOverride> iIapOverrides;
130 #include <cdbover.inl>