williamr@2
|
1 |
// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
2 |
// All rights reserved.
|
williamr@2
|
3 |
// This component and the accompanying materials are made available
|
williamr@4
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
williamr@2
|
5 |
// which accompanies this distribution, and is available
|
williamr@4
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
williamr@2
|
7 |
//
|
williamr@2
|
8 |
// Initial Contributors:
|
williamr@2
|
9 |
// Nokia Corporation - initial contribution.
|
williamr@2
|
10 |
//
|
williamr@2
|
11 |
// Contributors:
|
williamr@2
|
12 |
//
|
williamr@2
|
13 |
// Description:
|
williamr@2
|
14 |
// Comms Database Connection Preference Table header
|
williamr@2
|
15 |
//
|
williamr@2
|
16 |
//
|
williamr@2
|
17 |
|
williamr@2
|
18 |
/**
|
williamr@2
|
19 |
@file
|
williamr@2
|
20 |
@publishedAll
|
williamr@2
|
21 |
@deprecated since v9.1. Functionality is replaced with commsdat.
|
williamr@2
|
22 |
*/
|
williamr@2
|
23 |
|
williamr@2
|
24 |
#ifndef CDBPREFTABLE_H
|
williamr@2
|
25 |
#define CDBPREFTABLE_H
|
williamr@2
|
26 |
|
williamr@2
|
27 |
#include <d32dbms.h>
|
williamr@2
|
28 |
#include <cdbcols.h>
|
williamr@2
|
29 |
#include <cdblen.h>
|
williamr@2
|
30 |
|
williamr@2
|
31 |
class CCommsDatabase;
|
williamr@2
|
32 |
class TCommDbCommonBearerInfo;
|
williamr@2
|
33 |
class CCommDbTableExtension;
|
williamr@2
|
34 |
class CCommsDbTableView;
|
williamr@2
|
35 |
//Created via CCommsDatabase::OpenConnectionPrefTableLC() or NewLC().
|
williamr@2
|
36 |
//Uses a CCommsDatabase and has an RDbView for access to the database.
|
williamr@2
|
37 |
class CCommsDbConnectionPrefTableView : public CBase
|
williamr@2
|
38 |
/**
|
williamr@2
|
39 |
|
williamr@2
|
40 |
Implements actions on records of the Connection Preferences table, to allow clients to set
|
williamr@2
|
41 |
the preferred order in which connections are attempted.
|
williamr@2
|
42 |
|
williamr@2
|
43 |
The class is similiar to CCommsDbTableView, but only allows access to connection
|
williamr@2
|
44 |
preferences as a set and not to individual fields in the table. This prevents
|
williamr@2
|
45 |
inappropriate updates of the records. Like CCommsDbTableView, the class has
|
williamr@2
|
46 |
a group of functions for navigating through the records in the view, and another
|
williamr@2
|
47 |
group for setting fields in the current record.
|
williamr@2
|
48 |
|
williamr@2
|
49 |
Clients do not create this type of object, but get an instance through
|
williamr@2
|
50 |
CCommsDatabase::OpenConnectionPrefTableLC(),
|
williamr@2
|
51 |
CCommsDatabase::OpenConnectionPrefTableInRankOrderLC(), or
|
williamr@2
|
52 |
CCommsDatabase::OpenConnectionPrefTableViewOnRankLC().
|
williamr@2
|
53 |
|
williamr@2
|
54 |
In addition to the leave codes documented, all leaving functions can leave
|
williamr@2
|
55 |
with any error returned by DBMS during database manipulation.
|
williamr@2
|
56 |
|
williamr@2
|
57 |
@see CCommDbOverrideSettings::GetConnectionPreferenceOverride()
|
williamr@2
|
58 |
@see CCommDbOverrideSettings::SetConnectionPreferenceOverride()
|
williamr@2
|
59 |
@publishedAll
|
williamr@2
|
60 |
@released */
|
williamr@2
|
61 |
{
|
williamr@2
|
62 |
public:
|
williamr@2
|
63 |
friend class CCommsDatabaseBase;
|
williamr@2
|
64 |
|
williamr@2
|
65 |
public:
|
williamr@2
|
66 |
class TCommDbIapBearer
|
williamr@2
|
67 |
/** Encapsulates the bearer set (CONNECT_PREF_BEARER_SET) and IAP (CONNECT_PREF_IAP)
|
williamr@2
|
68 |
fields.
|
williamr@2
|
69 |
Used in calls to UpdateBearerL() and as a public member of TCommDbIapConnectionPref.
|
williamr@2
|
70 |
@publishedAll
|
williamr@2
|
71 |
@released */
|
williamr@2
|
72 |
{
|
williamr@2
|
73 |
public:
|
williamr@2
|
74 |
IMPORT_C TCommDbIapBearer();
|
williamr@2
|
75 |
public:
|
williamr@2
|
76 |
/** Value for the bearer set (CONNECT_PREF_BEARER_SET) field. */
|
williamr@2
|
77 |
TUint32 iBearerSet;
|
williamr@2
|
78 |
/** Value for the IAP (CONNECT_PREF_IAP) field. */
|
williamr@2
|
79 |
TUint32 iIapId;
|
williamr@2
|
80 |
};
|
williamr@2
|
81 |
|
williamr@2
|
82 |
class TCommDbIapConnectionPref
|
williamr@2
|
83 |
/** Encapsulates the rank (CONNECT_PREF_RANKING), direction (CONNECTION_PREF_DIRECTION),
|
williamr@2
|
84 |
and dialog preference (CONNECT_PREF_DIALOG_PREF) fields, plus a TCommDbIapBearer
|
williamr@2
|
85 |
object.
|
williamr@2
|
86 |
A complete connection preference - containing rank, direction, dialogue option,
|
williamr@2
|
87 |
bearers for the dialogue and the prefered IAP.
|
williamr@2
|
88 |
@see TCommDbConnectionDirection
|
williamr@2
|
89 |
@publishedAll
|
williamr@2
|
90 |
@released */
|
williamr@2
|
91 |
{
|
williamr@2
|
92 |
public:
|
williamr@2
|
93 |
IMPORT_C TCommDbIapConnectionPref();
|
williamr@2
|
94 |
IMPORT_C TBool operator==(const TCommDbIapConnectionPref& aPref) const;
|
williamr@2
|
95 |
public:
|
williamr@2
|
96 |
/** Value for the rank (CONNECT_PREF_BEARER_SET) field. */
|
williamr@2
|
97 |
TUint32 iRanking;
|
williamr@2
|
98 |
/** Value for the direction (CONNECTION_PREF_DIRECTION) field.
|
williamr@2
|
99 |
|
williamr@2
|
100 |
@see TCommDbConnectionDirection */
|
williamr@2
|
101 |
TCommDbConnectionDirection iDirection;
|
williamr@2
|
102 |
/** Value for the dialog preference (CONNECT_PREF_DIALOG_PREF) field.
|
williamr@2
|
103 |
|
williamr@2
|
104 |
@see TCommDbDialogPref */
|
williamr@2
|
105 |
TCommDbDialogPref iDialogPref;
|
williamr@2
|
106 |
/** Values for the bearer (CONNECT_PREF_BEARER_SET) and IAP (CONNECT_PREF_IAP) fields.
|
williamr@2
|
107 |
|
williamr@2
|
108 |
@see TCommDbIapBearer */
|
williamr@2
|
109 |
TCommDbIapBearer iBearer;
|
williamr@2
|
110 |
};
|
williamr@2
|
111 |
|
williamr@2
|
112 |
class TCommDbIspBearer
|
williamr@2
|
113 |
/**
|
williamr@2
|
114 |
|
williamr@2
|
115 |
Frame left in place for BC with 6.1
|
williamr@2
|
116 |
@publishedAll
|
williamr@2
|
117 |
@deprecated 7.0 */
|
williamr@2
|
118 |
{
|
williamr@2
|
119 |
public:
|
williamr@2
|
120 |
IMPORT_C TCommDbIspBearer();
|
williamr@2
|
121 |
};
|
williamr@2
|
122 |
|
williamr@2
|
123 |
class TCommDbIspConnectionPref
|
williamr@2
|
124 |
/**
|
williamr@2
|
125 |
@publishedAll
|
williamr@2
|
126 |
@deprecated
|
williamr@2
|
127 |
*/
|
williamr@2
|
128 |
{
|
williamr@2
|
129 |
public:
|
williamr@2
|
130 |
IMPORT_C TCommDbIspConnectionPref();
|
williamr@2
|
131 |
IMPORT_C TBool operator==(const TCommDbIspConnectionPref& aPref) const;
|
williamr@2
|
132 |
public:
|
williamr@2
|
133 |
TCommDbIspBearer iBearer;
|
williamr@2
|
134 |
};
|
williamr@2
|
135 |
|
williamr@2
|
136 |
public:
|
williamr@2
|
137 |
IMPORT_C virtual ~CCommsDbConnectionPrefTableView();
|
williamr@2
|
138 |
|
williamr@2
|
139 |
static CCommsDbConnectionPrefTableView* NewLC(CCommsDatabase& aDb, const TDbQuery& aQuery);
|
williamr@2
|
140 |
static CCommsDbConnectionPrefTableView* NewLC(CCommsDatabase& aDb, TCommDbConnectionDirection aDirection, TBool aSortRanking = EFalse);
|
williamr@2
|
141 |
static CCommsDbConnectionPrefTableView* NewL(CCommsDatabase& aDb, TCommDbConnectionDirection aDirection, TUint32 aRank);
|
williamr@2
|
142 |
|
williamr@2
|
143 |
IMPORT_C void InsertConnectionPreferenceL(const TCommDbIapConnectionPref& aPref, TBool aReadOnly = EFalse);
|
williamr@2
|
144 |
|
williamr@2
|
145 |
IMPORT_C void ReadConnectionPreferenceL(TCommDbIapConnectionPref& aPref);
|
williamr@2
|
146 |
|
williamr@2
|
147 |
IMPORT_C void UpdateBearerL(const TCommDbIapBearer& aUpdate, TBool aReadOnly = EFalse);
|
williamr@2
|
148 |
|
williamr@2
|
149 |
IMPORT_C void UpdateDialogPrefL(const TCommDbDialogPref& aUpdate);
|
williamr@2
|
150 |
|
williamr@2
|
151 |
IMPORT_C void ChangeConnectionPreferenceRankL(TUint32 aNewRank);
|
williamr@2
|
152 |
|
williamr@2
|
153 |
IMPORT_C void DeleteConnectionPreferenceL();
|
williamr@2
|
154 |
|
williamr@2
|
155 |
IMPORT_C void SwapConnectionPreferencesL(TCommDbConnectionDirection aDirection, TUint32 aFirstRank, TUint32 aSecondRank);
|
williamr@2
|
156 |
|
williamr@2
|
157 |
IMPORT_C TInt GotoFirstRecord();
|
williamr@2
|
158 |
|
williamr@2
|
159 |
IMPORT_C TInt GotoNextRecord();
|
williamr@2
|
160 |
|
williamr@2
|
161 |
IMPORT_C TInt GotoPreviousRecord();
|
williamr@2
|
162 |
|
williamr@2
|
163 |
//
|
williamr@2
|
164 |
// ISP Connection Preference record operations
|
williamr@2
|
165 |
// All these were deprecated in 7.0 but have now
|
williamr@2
|
166 |
// been re-instated in limited form to accomodate 6.1 BC
|
williamr@2
|
167 |
//
|
williamr@2
|
168 |
IMPORT_C void InsertConnectionPreferenceL(const TCommDbIspConnectionPref& aPref, TBool aReadOnly = EFalse);
|
williamr@2
|
169 |
IMPORT_C void UpdateBearerL(const TCommDbIspBearer& aUpdate, TBool aReadOnly = EFalse);
|
williamr@2
|
170 |
IMPORT_C void ReadConnectionPreferenceL(TCommDbIspConnectionPref& aPref);
|
williamr@2
|
171 |
|
williamr@2
|
172 |
protected:
|
williamr@2
|
173 |
CCommsDbConnectionPrefTableView(CCommsDatabase& aDb);
|
williamr@2
|
174 |
void ConstructL(const TDbQuery& aQuery);
|
williamr@2
|
175 |
void ConstructL(TCommDbConnectionDirection aDirection, TBool aSortRanking);
|
williamr@2
|
176 |
void ConstructL(TCommDbConnectionDirection aDirection, TUint32 aRank);
|
williamr@2
|
177 |
void Close();
|
williamr@2
|
178 |
void OpenL(const TDbQuery& aQuery);
|
williamr@2
|
179 |
RDbRowSet::TAccess GetL();
|
williamr@2
|
180 |
inline TDbColNo ColNum(const TDesC& aColumn) const;
|
williamr@2
|
181 |
void GetUint32L(const TDesC& aColumnName, TUint32& aValue);
|
williamr@2
|
182 |
|
williamr@2
|
183 |
private:
|
williamr@2
|
184 |
void SetRankL(TUint32 aNewRank);
|
williamr@2
|
185 |
void DoSwapConnectionPreferencesL(TCommDbConnectionDirection aDirection, TUint32 aFirstRank, TUint32 aSecondRank);
|
williamr@2
|
186 |
|
williamr@2
|
187 |
protected:
|
williamr@2
|
188 |
/** DBMS view. Variable not used in shim. Not removed because of BC break */
|
williamr@2
|
189 |
RDbView iTableView;
|
williamr@2
|
190 |
CCommDbTableExtension* iTableExt;
|
williamr@2
|
191 |
|
williamr@2
|
192 |
/** Comms data base that is being viewed. */
|
williamr@2
|
193 |
CCommsDatabase& iDb;
|
williamr@2
|
194 |
};
|
williamr@2
|
195 |
|
williamr@2
|
196 |
#endif
|