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 "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Comms Database Connection Preference Table header
21 @deprecated since v9.1. Functionality is replaced with commsdat.
24 #ifndef CDBPREFTABLE_H
25 #define CDBPREFTABLE_H
32 class TCommDbCommonBearerInfo;
33 class CCommDbTableExtension;
34 class CCommsDbTableView;
35 //Created via CCommsDatabase::OpenConnectionPrefTableLC() or NewLC().
36 //Uses a CCommsDatabase and has an RDbView for access to the database.
37 class CCommsDbConnectionPrefTableView : public CBase
40 Implements actions on records of the Connection Preferences table, to allow clients to set
41 the preferred order in which connections are attempted.
43 The class is similiar to CCommsDbTableView, but only allows access to connection
44 preferences as a set and not to individual fields in the table. This prevents
45 inappropriate updates of the records. Like CCommsDbTableView, the class has
46 a group of functions for navigating through the records in the view, and another
47 group for setting fields in the current record.
49 Clients do not create this type of object, but get an instance through
50 CCommsDatabase::OpenConnectionPrefTableLC(),
51 CCommsDatabase::OpenConnectionPrefTableInRankOrderLC(), or
52 CCommsDatabase::OpenConnectionPrefTableViewOnRankLC().
54 In addition to the leave codes documented, all leaving functions can leave
55 with any error returned by DBMS during database manipulation.
57 @see CCommDbOverrideSettings::GetConnectionPreferenceOverride()
58 @see CCommDbOverrideSettings::SetConnectionPreferenceOverride()
63 friend class CCommsDatabaseBase;
66 class TCommDbIapBearer
67 /** Encapsulates the bearer set (CONNECT_PREF_BEARER_SET) and IAP (CONNECT_PREF_IAP)
69 Used in calls to UpdateBearerL() and as a public member of TCommDbIapConnectionPref.
74 IMPORT_C TCommDbIapBearer();
76 /** Value for the bearer set (CONNECT_PREF_BEARER_SET) field. */
78 /** Value for the IAP (CONNECT_PREF_IAP) field. */
82 class TCommDbIapConnectionPref
83 /** Encapsulates the rank (CONNECT_PREF_RANKING), direction (CONNECTION_PREF_DIRECTION),
84 and dialog preference (CONNECT_PREF_DIALOG_PREF) fields, plus a TCommDbIapBearer
86 A complete connection preference - containing rank, direction, dialogue option,
87 bearers for the dialogue and the prefered IAP.
88 @see TCommDbConnectionDirection
93 IMPORT_C TCommDbIapConnectionPref();
94 IMPORT_C TBool operator==(const TCommDbIapConnectionPref& aPref) const;
96 /** Value for the rank (CONNECT_PREF_BEARER_SET) field. */
98 /** Value for the direction (CONNECTION_PREF_DIRECTION) field.
100 @see TCommDbConnectionDirection */
101 TCommDbConnectionDirection iDirection;
102 /** Value for the dialog preference (CONNECT_PREF_DIALOG_PREF) field.
104 @see TCommDbDialogPref */
105 TCommDbDialogPref iDialogPref;
106 /** Values for the bearer (CONNECT_PREF_BEARER_SET) and IAP (CONNECT_PREF_IAP) fields.
108 @see TCommDbIapBearer */
109 TCommDbIapBearer iBearer;
112 class TCommDbIspBearer
115 Frame left in place for BC with 6.1
120 IMPORT_C TCommDbIspBearer();
123 class TCommDbIspConnectionPref
130 IMPORT_C TCommDbIspConnectionPref();
131 IMPORT_C TBool operator==(const TCommDbIspConnectionPref& aPref) const;
133 TCommDbIspBearer iBearer;
137 IMPORT_C virtual ~CCommsDbConnectionPrefTableView();
139 static CCommsDbConnectionPrefTableView* NewLC(CCommsDatabase& aDb, const TDbQuery& aQuery);
140 static CCommsDbConnectionPrefTableView* NewLC(CCommsDatabase& aDb, TCommDbConnectionDirection aDirection, TBool aSortRanking = EFalse);
141 static CCommsDbConnectionPrefTableView* NewL(CCommsDatabase& aDb, TCommDbConnectionDirection aDirection, TUint32 aRank);
143 IMPORT_C void InsertConnectionPreferenceL(const TCommDbIapConnectionPref& aPref, TBool aReadOnly = EFalse);
145 IMPORT_C void ReadConnectionPreferenceL(TCommDbIapConnectionPref& aPref);
147 IMPORT_C void UpdateBearerL(const TCommDbIapBearer& aUpdate, TBool aReadOnly = EFalse);
149 IMPORT_C void UpdateDialogPrefL(const TCommDbDialogPref& aUpdate);
151 IMPORT_C void ChangeConnectionPreferenceRankL(TUint32 aNewRank);
153 IMPORT_C void DeleteConnectionPreferenceL();
155 IMPORT_C void SwapConnectionPreferencesL(TCommDbConnectionDirection aDirection, TUint32 aFirstRank, TUint32 aSecondRank);
157 IMPORT_C TInt GotoFirstRecord();
159 IMPORT_C TInt GotoNextRecord();
161 IMPORT_C TInt GotoPreviousRecord();
164 // ISP Connection Preference record operations
165 // All these were deprecated in 7.0 but have now
166 // been re-instated in limited form to accomodate 6.1 BC
168 IMPORT_C void InsertConnectionPreferenceL(const TCommDbIspConnectionPref& aPref, TBool aReadOnly = EFalse);
169 IMPORT_C void UpdateBearerL(const TCommDbIspBearer& aUpdate, TBool aReadOnly = EFalse);
170 IMPORT_C void ReadConnectionPreferenceL(TCommDbIspConnectionPref& aPref);
173 CCommsDbConnectionPrefTableView(CCommsDatabase& aDb);
174 void ConstructL(const TDbQuery& aQuery);
175 void ConstructL(TCommDbConnectionDirection aDirection, TBool aSortRanking);
176 void ConstructL(TCommDbConnectionDirection aDirection, TUint32 aRank);
178 void OpenL(const TDbQuery& aQuery);
179 RDbRowSet::TAccess GetL();
180 inline TDbColNo ColNum(const TDesC& aColumn) const;
181 void GetUint32L(const TDesC& aColumnName, TUint32& aValue);
184 void SetRankL(TUint32 aNewRank);
185 void DoSwapConnectionPreferencesL(TCommDbConnectionDirection aDirection, TUint32 aFirstRank, TUint32 aSecondRank);
188 /** DBMS view. Variable not used in shim. Not removed because of BC break */
190 CCommDbTableExtension* iTableExt;
192 /** Comms data base that is being viewed. */