|
1 /* |
|
2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Settings item for one destination network. Also handles |
|
15 * saving destination networks to permanent storage. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #ifndef CWPDESTINATIONNWITEM_H |
|
22 #define CWPDESTINATIONNWITEM_H |
|
23 |
|
24 #include <e32base.h> |
|
25 #include <cmmanagerext.h> |
|
26 |
|
27 class CWPCharacteristic; |
|
28 |
|
29 /** |
|
30 * Destination network settings item. |
|
31 * |
|
32 * Destination network item handles saving destination networks via |
|
33 * Connection Method Manager API. |
|
34 * |
|
35 * @lib cwpdestinationnwadapter.lib |
|
36 * @since S60 v3.2. |
|
37 */ |
|
38 class CWPDestinationNwItem : public CBase |
|
39 { |
|
40 /** |
|
41 * Friend classes for unit testing - uncomment when running tests. |
|
42 */ |
|
43 //friend class UT_wpdestinationnwadapter; |
|
44 |
|
45 public: |
|
46 |
|
47 static CWPDestinationNwItem* NewL(); |
|
48 |
|
49 virtual ~CWPDestinationNwItem(); |
|
50 |
|
51 /** |
|
52 * Setter for APPREF. |
|
53 * @since S60 v3.2. |
|
54 * @param aAPPREF. |
|
55 */ |
|
56 void SetAppRefL( const TDesC8& aAppRef ); |
|
57 |
|
58 /** |
|
59 * Setter for user viewable name of the setting. |
|
60 * @since S60 v3.2. |
|
61 * @param aNAME. Value is TCP or UDP. |
|
62 */ |
|
63 void SetSettingsNameL( const TDesC& aSettingsName ); |
|
64 |
|
65 /** |
|
66 * Setter for NAPDEF (IAP settings). |
|
67 * @since S60 v3.2. |
|
68 * @param aNapDef. |
|
69 */ |
|
70 void AddNapDefL( CWPCharacteristic* aNapDef ); |
|
71 |
|
72 /** |
|
73 * Getter for APPREF value. |
|
74 * @since S60 v3.2. |
|
75 * @return APPREF. |
|
76 */ |
|
77 const TDesC8& AppRef() const; |
|
78 |
|
79 /** |
|
80 * Getter for user viewable name of Destination network. |
|
81 * @since S60 v3.2. |
|
82 * @return Settings name. |
|
83 */ |
|
84 const TDesC& SettingsName() const; |
|
85 |
|
86 /** |
|
87 * Saves the destination network settings. |
|
88 * @since S60 v3.2. |
|
89 */ |
|
90 void SaveL(); |
|
91 |
|
92 /** |
|
93 * Return destination network ID. |
|
94 * @since S60 v3.2. |
|
95 * @return ID of the destination network. |
|
96 */ |
|
97 const TDesC8& SaveData() const; |
|
98 |
|
99 private: |
|
100 |
|
101 /** |
|
102 * Creates a network destination. |
|
103 * @since S60 v3.2. |
|
104 * @param aCmManager Connection Method Manager handle. |
|
105 * @return Network destination. |
|
106 */ |
|
107 RCmDestinationExt CreateDestinationL( RCmManagerExt& aCmManager ); |
|
108 |
|
109 /** |
|
110 * Returnes the Iap id that matches the given Wap id. |
|
111 * @since S60 v3.2.3 |
|
112 * @param aWapId IAP's Wap Id. |
|
113 * @return Iap Id. |
|
114 */ |
|
115 TUint32 IapIdFromWapIdL( TUint32 aWapId ); |
|
116 |
|
117 private: |
|
118 |
|
119 void ConstructL(); |
|
120 CWPDestinationNwItem(); |
|
121 |
|
122 private: // data |
|
123 |
|
124 /** |
|
125 * Destination network reference identity in provisioning document. |
|
126 * Own. |
|
127 */ |
|
128 HBufC8* iAppRef; |
|
129 |
|
130 /** |
|
131 * Name of destination network visible to user when viewing the |
|
132 * provisioning message. |
|
133 * Own. |
|
134 */ |
|
135 HBufC* iSettingsName; |
|
136 |
|
137 /** |
|
138 * Array of NAPDEFs, IAP settings. |
|
139 * Not own. (Contained pointers are deleted by ProvisioningEngine.) |
|
140 */ |
|
141 RPointerArray<CWPCharacteristic> iNapDefs; |
|
142 |
|
143 /** |
|
144 * ID value of the referred IAP. |
|
145 */ |
|
146 TUint32 iIAPId; |
|
147 |
|
148 /** |
|
149 * Destination network ID as a descriptor to be returned by the |
|
150 * SaveData method to the framework via adapters SaveDataL. |
|
151 * Own. |
|
152 */ |
|
153 HBufC8* iSavedProfileId; |
|
154 |
|
155 }; |
|
156 |
|
157 #endif // CWPDESTINATIONNWITEM_H |