|
1 /* |
|
2 * Copyright (c) 2006 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: project specification |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef MUSWPADAPTER_H |
|
21 #define MUSWPADAPTER_H |
|
22 |
|
23 |
|
24 #include "musunittesting.h" |
|
25 |
|
26 #include <CWPAdapter.h> |
|
27 |
|
28 |
|
29 class CWPCharacteristic; |
|
30 class CMusWpItem; |
|
31 |
|
32 |
|
33 /** |
|
34 * CMusWpAdapter handles application-specific OTA (Over-The-Air) settings |
|
35 * of Mus. |
|
36 */ |
|
37 class CMusWpAdapter : public CWPAdapter |
|
38 { |
|
39 MUS_UNITTEST( UT_CMusWpAdapter ) |
|
40 |
|
41 public: // Constructors and destructor |
|
42 |
|
43 /** |
|
44 * Two-phased constructor. |
|
45 */ |
|
46 static CMusWpAdapter* NewL(); |
|
47 |
|
48 /** |
|
49 * Destructor. |
|
50 */ |
|
51 virtual ~CMusWpAdapter(); |
|
52 |
|
53 |
|
54 public: // from CWPAdapter, pure virtual in base class |
|
55 |
|
56 /** |
|
57 * Check the number of settings items. |
|
58 * |
|
59 * @return Number of items |
|
60 */ |
|
61 TInt ItemCount() const; |
|
62 |
|
63 /** |
|
64 * Returns the title of the nth summary line. |
|
65 * |
|
66 * @param aIndex Number of summary line |
|
67 * @return Summary line title |
|
68 */ |
|
69 const TDesC16& SummaryTitle(TInt aIndex) const; |
|
70 |
|
71 /** |
|
72 * Returns the text of the nth summary line. |
|
73 * |
|
74 * @param aIndex Number of summary line |
|
75 * @return Summary line text |
|
76 */ |
|
77 const TDesC16& SummaryText(TInt aIndex) const; |
|
78 |
|
79 /** |
|
80 * Saves one setting handled by the adapter. |
|
81 * |
|
82 * @param Setting number |
|
83 */ |
|
84 void SaveL( TInt aItem ); |
|
85 |
|
86 /** |
|
87 * Returns ETrue if the adapter can set the settings as default. |
|
88 * |
|
89 * @param Setting number |
|
90 * @return ETrue if the setting can be made default |
|
91 */ |
|
92 TBool CanSetAsDefault( TInt aItem ) const; |
|
93 |
|
94 /** |
|
95 * Adapter sets the settings as default. |
|
96 * |
|
97 * @param Setting number |
|
98 */ |
|
99 void SetAsDefaultL( TInt aItem ); |
|
100 |
|
101 /** |
|
102 * Calls the pair visitor for each detail line of an item. |
|
103 * |
|
104 * @param aItem Item whose details are needed |
|
105 * @param aVisitor Pair visitor |
|
106 * @return KErrNotSupported if not supported |
|
107 */ |
|
108 TInt DetailsL( TInt aItem, MWPPairVisitor& aVisitor ); |
|
109 |
|
110 |
|
111 public: // from CWPAdapter, empty implementations in base class |
|
112 |
|
113 /** |
|
114 * Informs the adapters of the saved settings. |
|
115 * |
|
116 * @param TDesC8& aAppIdOfSavingItem. UID of the adapter component. |
|
117 * @param HBufC8& aAppRef. APPREF of the saved settings. |
|
118 * @param HBufC8& aStorageIdValue. Value that identifies the settings in |
|
119 * its storage. |
|
120 * @param TBool& aIsLastOfItsType. ETrue is gotten if the saved set |
|
121 * was last of its type. |
|
122 */ |
|
123 void SettingsSavedL ( const TDesC8& aAppIdOfSavingItem, |
|
124 const TDesC8& aAppRef, |
|
125 const TDesC8& aStorageIdValue ); |
|
126 |
|
127 /** |
|
128 * Informs the adapters of the finalization of saving. |
|
129 */ |
|
130 void SavingFinalizedL(); |
|
131 |
|
132 |
|
133 public: // from CWPAdapter, which derives them from MWPVisitor |
|
134 |
|
135 /** |
|
136 * Called for each characteristic found. |
|
137 * |
|
138 * @param aCharacteristic The characteristic found |
|
139 */ |
|
140 void VisitL(CWPCharacteristic& aElement); |
|
141 |
|
142 /** |
|
143 * Called for each parameter found. |
|
144 * |
|
145 * @param aParameter The parameter found |
|
146 */ |
|
147 void VisitL(CWPParameter& aElement); |
|
148 |
|
149 /** |
|
150 * Called for each link to a logical proxy or access point. |
|
151 * No implementation needed. |
|
152 * |
|
153 * @param aCharacteristic The characteristic found by following the |
|
154 * link. |
|
155 */ |
|
156 void VisitLinkL(CWPCharacteristic& aLink ); |
|
157 |
|
158 |
|
159 private: // Constructors |
|
160 |
|
161 /** |
|
162 * C++ default constructor. |
|
163 */ |
|
164 CMusWpAdapter(); |
|
165 |
|
166 /** |
|
167 * 2nd phase constructor. |
|
168 */ |
|
169 void ConstructL(); |
|
170 |
|
171 |
|
172 private: // data |
|
173 |
|
174 // Title to be shown in provisioning message |
|
175 HBufC* iSummaryTitle; |
|
176 |
|
177 // The application id of the current characteristic. |
|
178 HBufC* iAppID; |
|
179 |
|
180 // Settings |
|
181 CMusWpItem* iWpItem; |
|
182 |
|
183 // Parsed settings |
|
184 CMusWpItem* iNewWpItem; |
|
185 |
|
186 // ETrue if we have profile id to save |
|
187 TBool iProfileIdReceived; |
|
188 |
|
189 |
|
190 private: // saved settings |
|
191 |
|
192 /** |
|
193 * Profile Id of SIP profile saved by SIPAdapter meant |
|
194 * to be used with Mus. |
|
195 */ |
|
196 TUint32 iProfileId; |
|
197 |
|
198 |
|
199 }; |
|
200 |
|
201 |
|
202 #endif // MUSWPADAPTER_H |