1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
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 |
4 // under the terms of "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 // |
7 // |
8 // Initial Contributors: |
8 // Initial Contributors: |
9 // Nokia Corporation - initial contribution. |
9 // Nokia Corporation - initial contribution. |
10 // |
10 // |
11 // Contributors: |
11 // Contributors: |
12 // |
12 // |
13 // Description: |
13 // Description: |
14 // |
14 // |
15 |
15 |
16 |
|
17 |
|
18 /** |
|
19 @file |
|
20 @deprecated since v9.1. Functionality is replaced with commsdat. |
|
21 */ |
|
22 |
|
23 #if !(defined COMMDBCONNPREF_H) |
16 #if !(defined COMMDBCONNPREF_H) |
24 #define COMMDBCONNPREF_H |
17 #define COMMDBCONNPREF_H |
25 |
18 |
26 #include <connpref.h> |
19 #include <connpref.h> |
27 #include <cdbcols.h> |
20 #include <cdbcols.h> |
28 |
21 |
29 /** |
22 class TCommDbConnPref : public TConnPref |
30 Constant for storing Major Version Number |
23 /** Connection preferences which override the contents of the ConnectionPreferences |
31 @internalTechnology |
24 tables in CommsDat. The only mandatory field is IAP. |
32 */ |
|
33 const TInt8 KMajorVersionNumber = 8; |
|
34 |
25 |
35 /** |
26 An Internet Access Point(IAP) represents a IP bound bearer and a set of parameters |
36 Constant for storing Minor Version Number |
27 on that bearer, which the device can use to make a connection to the Internet. |
37 */ |
|
38 const TInt8 KMinorVersionNumber = 0; |
|
39 |
28 |
40 /** |
29 A list of available IAPs and Networks can be retrieved from CommsDat using |
41 Constant for storing Build Version Number |
30 CommsDat::CCDIAPRecord and CCDNetworkRecord. |
42 */ |
|
43 const TInt16 KBuildVersionNumber = 1; |
|
44 |
31 |
|
32 @code |
|
33 RConnection conn; |
|
34 User::LeaveIfError(conn.Open(sockSvr)); |
|
35 CleanupClosePushL(conn); |
45 |
36 |
46 /** |
37 TCommDbConnPref prefs; |
47 @internalTechnology |
38 prefs.SetIapId(3); |
48 */ |
39 TInt error = conn.Start(prefs); |
49 struct SCommDbConnPref |
40 @endcode |
50 { |
|
51 TUint32 iIapId; |
|
52 TUint32 iNetId; |
|
53 TCommDbDialogPref iDialogPref; |
|
54 TCommDbConnectionDirection iDirection; |
|
55 TUint32 iBearerSet; |
|
56 }; |
|
57 |
41 |
58 class TCommDbConnPref : public TConnPref |
42 @see CommsDat::CCDNetworkRecord |
59 /** |
43 @see CommsDat::CCDIAPRecord |
|
44 @see TCommDbDialogPref |
|
45 @see TCommDbConnectionDirection |
|
46 @see TCommDbBearer |
|
47 @see RConnection::Start |
|
48 |
60 @publishedAll |
49 @publishedAll |
61 @released since v7.0s |
50 @released since v7.0s |
62 */ |
51 */ |
63 { |
52 { |
64 friend class TCommDbMultiConnPref; |
53 friend class TCommDbMultiConnPref; |
85 inline TBool operator==(const TCommDbConnPref& aPref) const; |
74 inline TBool operator==(const TCommDbConnPref& aPref) const; |
86 inline TBool operator!=(const TCommDbConnPref& aPref) const; |
75 inline TBool operator!=(const TCommDbConnPref& aPref) const; |
87 |
76 |
88 inline static TCommDbConnPref& Cast(const TConnPref& aPref); |
77 inline static TCommDbConnPref& Cast(const TConnPref& aPref); |
89 |
78 |
90 protected: |
79 public: |
|
80 struct SCommDbConnPref |
|
81 { |
|
82 TUint32 iIapId; |
|
83 TUint32 iNetId; |
|
84 TCommDbDialogPref iDialogPref; |
|
85 TCommDbConnectionDirection iDirection; |
|
86 TUint32 iBearerSet; |
|
87 }; |
91 inline SCommDbConnPref* PrefPtr() const; |
88 inline SCommDbConnPref* PrefPtr() const; |
|
89 const static TInt8 KMajorVersionNumber = 8; |
|
90 const static TInt8 KMinorVersionNumber = 0; |
|
91 const static TInt16 KBuildVersionNumber = 1; |
92 }; |
92 }; |
93 |
93 |
94 /** |
|
95 @internalTechnology |
|
96 */ |
|
97 const TInt KMaxMultiConnPrefCount = 2; |
|
98 |
94 |
99 /** |
|
100 @internalTechnology |
|
101 */ |
|
102 struct SCommDbMultiConnPref |
|
103 { |
|
104 TInt iNumAttempts; |
|
105 struct SCommDbConnPref iPrefs[KMaxMultiConnPrefCount]; |
|
106 }; |
|
107 |
95 |
108 class TCommDbMultiConnPref : public TConnPref |
96 class TCommDbMultiConnPref : public TConnPref |
109 /** |
97 /** A set of TCommDbConnPrefs which the device will use to attempt to connect |
|
98 to the internet. The preferences at index 1 will be used first, and if this fails |
|
99 the preferences at index 2 will be used, and so on until connection attempts |
|
100 are exhausted. |
|
101 |
|
102 The index counts from 1. There must be as many connection preferences as there |
|
103 are connection attempts. |
|
104 |
|
105 @code |
|
106 RConnection conn; |
|
107 User::LeaveIfError(conn.Open(sockSvr)); |
|
108 CleanupClosePushL(conn); |
|
109 |
|
110 TCommDbConnPref prefsA; |
|
111 prefsA.SetIapId(3); |
|
112 TCommDbConnPref prefsB; |
|
113 prefsB.SetIapId(5); |
|
114 |
|
115 TCommDbMultiConnPref prefs; |
|
116 prefs.SetPreference(1, prefsA); |
|
117 prefs.SetPreference(2, prefsB); |
|
118 prefs.SetConnectionAttempts(2); |
|
119 |
|
120 TInt error = conn.Start(prefs); |
|
121 @endcode |
|
122 |
|
123 @see TCommDbConnPref |
|
124 @see RConnection::Start |
|
125 |
110 @publishedAll |
126 @publishedAll |
111 @released since v7.0s |
127 @released since v7.0s |
112 */ |
128 */ |
113 { |
129 { |
114 public: |
130 public: |
121 IMPORT_C void SetConnectionAttempts(TInt aNumAttempts); |
137 IMPORT_C void SetConnectionAttempts(TInt aNumAttempts); |
122 IMPORT_C TInt ConnectionAttempts(); |
138 IMPORT_C TInt ConnectionAttempts(); |
123 |
139 |
124 inline static TCommDbMultiConnPref& Cast(const TConnPref& aPref); |
140 inline static TCommDbMultiConnPref& Cast(const TConnPref& aPref); |
125 |
141 |
126 protected: |
142 public: |
|
143 const static TInt KMaxMultiConnPrefCount = 2; |
|
144 struct SCommDbMultiConnPref |
|
145 { |
|
146 TInt iNumAttempts; |
|
147 struct TCommDbConnPref::SCommDbConnPref iPrefs[KMaxMultiConnPrefCount]; |
|
148 }; |
127 inline struct SCommDbMultiConnPref* PrefPtr() const; |
149 inline struct SCommDbMultiConnPref* PrefPtr() const; |
|
150 const static TInt8 KMajorVersionNumber = 8; |
|
151 const static TInt8 KMinorVersionNumber = 0; |
|
152 const static TInt16 KBuildVersionNumber = 1; |
128 }; |
153 }; |
129 |
154 |
130 #include <commdbconnpref.inl> |
155 #include <commdbconnpref.inl> |
131 |
156 |
132 #endif |
157 #endif |