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.
14 // Comms Database Connection Preference Table header
23 @deprecated since v9.1. Functionality is replaced with commsdat.
26 #ifndef CDBPREFTABLE_H
27 #define CDBPREFTABLE_H
34 class TCommDbCommonBearerInfo;
35 class CCommDbTableExtension;
36 class CCommsDbTableView;
37 //Created via CCommsDatabase::OpenConnectionPrefTableLC() or NewLC().
38 //Uses a CCommsDatabase and has an RDbView for access to the database.
39 class CCommsDbConnectionPrefTableView : public CBase
42 Implements actions on records of the Connection Preferences table, to allow clients to set
43 the preferred order in which connections are attempted.
45 The class is similiar to CCommsDbTableView, but only allows access to connection
46 preferences as a set and not to individual fields in the table. This prevents
47 inappropriate updates of the records. Like CCommsDbTableView, the class has
48 a group of functions for navigating through the records in the view, and another
49 group for setting fields in the current record.
51 Clients do not create this type of object, but get an instance through
52 CCommsDatabase::OpenConnectionPrefTableLC(),
53 CCommsDatabase::OpenConnectionPrefTableInRankOrderLC(), or
54 CCommsDatabase::OpenConnectionPrefTableViewOnRankLC().
56 In addition to the leave codes documented, all leaving functions can leave
57 with any error returned by DBMS during database manipulation.
59 @see CCommDbOverrideSettings::GetConnectionPreferenceOverride()
60 @see CCommDbOverrideSettings::SetConnectionPreferenceOverride()
65 friend class CCommsDatabaseBase;
68 class TCommDbIapBearer
69 /** Encapsulates the bearer set (CONNECT_PREF_BEARER_SET) and IAP (CONNECT_PREF_IAP)
71 Used in calls to UpdateBearerL() and as a public member of TCommDbIapConnectionPref.
76 IMPORT_C TCommDbIapBearer();
78 /** Value for the bearer set (CONNECT_PREF_BEARER_SET) field. */
80 /** Value for the IAP (CONNECT_PREF_IAP) field. */
84 class TCommDbIapConnectionPref
85 /** Encapsulates the rank (CONNECT_PREF_RANKING), direction (CONNECTION_PREF_DIRECTION),
86 and dialog preference (CONNECT_PREF_DIALOG_PREF) fields, plus a TCommDbIapBearer
88 A complete connection preference - containing rank, direction, dialogue option,
89 bearers for the dialogue and the prefered IAP.
90 @see TCommDbConnectionDirection
95 IMPORT_C TCommDbIapConnectionPref();
96 IMPORT_C TBool operator==(const TCommDbIapConnectionPref& aPref) const;
98 /** Value for the rank (CONNECT_PREF_BEARER_SET) field. */
100 /** Value for the direction (CONNECTION_PREF_DIRECTION) field.
102 @see TCommDbConnectionDirection */
103 TCommDbConnectionDirection iDirection;
104 /** Value for the dialog preference (CONNECT_PREF_DIALOG_PREF) field.
106 @see TCommDbDialogPref */
107 TCommDbDialogPref iDialogPref;
108 /** Values for the bearer (CONNECT_PREF_BEARER_SET) and IAP (CONNECT_PREF_IAP) fields.
110 @see TCommDbIapBearer */
111 TCommDbIapBearer iBearer;
114 class TCommDbIspBearer
117 Frame left in place for BC with 6.1
122 IMPORT_C TCommDbIspBearer();
125 class TCommDbIspConnectionPref
132 IMPORT_C TCommDbIspConnectionPref();
133 IMPORT_C TBool operator==(const TCommDbIspConnectionPref& aPref) const;
135 TCommDbIspBearer iBearer;
139 IMPORT_C virtual ~CCommsDbConnectionPrefTableView();
141 static CCommsDbConnectionPrefTableView* NewLC(CCommsDatabase& aDb, const TDbQuery& aQuery);
142 static CCommsDbConnectionPrefTableView* NewLC(CCommsDatabase& aDb, TCommDbConnectionDirection aDirection, TBool aSortRanking = EFalse);
143 static CCommsDbConnectionPrefTableView* NewL(CCommsDatabase& aDb, TCommDbConnectionDirection aDirection, TUint32 aRank);
145 IMPORT_C void InsertConnectionPreferenceL(const TCommDbIapConnectionPref& aPref, TBool aReadOnly = EFalse);
147 IMPORT_C void ReadConnectionPreferenceL(TCommDbIapConnectionPref& aPref);
149 IMPORT_C void UpdateBearerL(const TCommDbIapBearer& aUpdate, TBool aReadOnly = EFalse);
151 IMPORT_C void UpdateDialogPrefL(const TCommDbDialogPref& aUpdate);
153 IMPORT_C void ChangeConnectionPreferenceRankL(TUint32 aNewRank);
155 IMPORT_C void DeleteConnectionPreferenceL();
157 IMPORT_C void SwapConnectionPreferencesL(TCommDbConnectionDirection aDirection, TUint32 aFirstRank, TUint32 aSecondRank);
159 IMPORT_C TInt GotoFirstRecord();
161 IMPORT_C TInt GotoNextRecord();
163 IMPORT_C TInt GotoPreviousRecord();
166 // ISP Connection Preference record operations
167 // All these were deprecated in 7.0 but have now
168 // been re-instated in limited form to accomodate 6.1 BC
170 IMPORT_C void InsertConnectionPreferenceL(const TCommDbIspConnectionPref& aPref, TBool aReadOnly = EFalse);
171 IMPORT_C void UpdateBearerL(const TCommDbIspBearer& aUpdate, TBool aReadOnly = EFalse);
172 IMPORT_C void ReadConnectionPreferenceL(TCommDbIspConnectionPref& aPref);
175 CCommsDbConnectionPrefTableView(CCommsDatabase& aDb);
176 void ConstructL(const TDbQuery& aQuery);
177 void ConstructL(TCommDbConnectionDirection aDirection, TBool aSortRanking);
178 void ConstructL(TCommDbConnectionDirection aDirection, TUint32 aRank);
180 void OpenL(const TDbQuery& aQuery);
181 RDbRowSet::TAccess GetL();
182 inline TDbColNo ColNum(const TDesC& aColumn) const;
183 void GetUint32L(const TDesC& aColumnName, TUint32& aValue);
186 void SetRankL(TUint32 aNewRank);
187 void DoSwapConnectionPreferencesL(TCommDbConnectionDirection aDirection, TUint32 aFirstRank, TUint32 aSecondRank);
190 /** DBMS view. Variable not used in shim. Not removed because of BC break */
192 CCommDbTableExtension* iTableExt;
194 /** Comms data base that is being viewed. */