|
1 /* |
|
2 * Copyright (c) 2002 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 the License "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: |
|
15 * Handles white list settings in provisioning. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef WHITELISTADAPTER_H |
|
21 #define WHITELISTADAPTER_H |
|
22 |
|
23 // INCLUDE FILES |
|
24 // User includes |
|
25 #include "WhiteListAdapterDef.h" |
|
26 // System includes |
|
27 #include <CWPAdapter.h> |
|
28 #include <msvapi.h> |
|
29 #include <MWPContextExtension.h> |
|
30 |
|
31 // FORWARD DECLARATIONS |
|
32 |
|
33 class CPushMtmSettings; |
|
34 class CWPCharacteristic; |
|
35 class CWPParameter; |
|
36 class MWPPairVisitor; |
|
37 class TWhiteListAdapterItem; |
|
38 |
|
39 // CLASS DECLARATION |
|
40 |
|
41 /** |
|
42 * An ECOM adapter plug-in. It is responsible for maintaining data in a |
|
43 * WAP Provisioning pushed message : we get appropriate physical proxy |
|
44 * addresses from the message and store them in Push MTM settings. It is the |
|
45 * Push Content Handler that will use these addresses to filter out |
|
46 * unauthorized pushed SL messages. |
|
47 * Note : although an adapter should always be prepared for displaying the |
|
48 * processed and stored settings in the appropriate format, the stored items |
|
49 * in this specific adapter will _never_ be displayed. Thus, ItemCount, |
|
50 * SummaryTitle and SummaryText methods have been written considering this |
|
51 * approach. |
|
52 */ |
|
53 class CWhiteListAdapter : public CWPAdapter, |
|
54 public MMsvSessionObserver, |
|
55 public MWPContextExtension |
|
56 { |
|
57 public : // construction, destruction |
|
58 /** |
|
59 * Two-phased constructor. |
|
60 */ |
|
61 static CWhiteListAdapter* NewL(); |
|
62 |
|
63 /** |
|
64 * Destructor. |
|
65 */ |
|
66 ~CWhiteListAdapter(); |
|
67 |
|
68 public : // from CWPAdapter |
|
69 |
|
70 /** |
|
71 * Check the number of settings items. |
|
72 * @see CWPAdapter |
|
73 */ |
|
74 /*virtual*/ TInt ItemCount() const; |
|
75 |
|
76 /** |
|
77 * Returns the title of the nth summary line. |
|
78 * @see CWPAdapter |
|
79 */ |
|
80 /*virtual*/ const TDesC16& SummaryTitle( TInt aIndex ) const; |
|
81 |
|
82 /** |
|
83 * Returns the text of the nth summary line. |
|
84 * @see CWPAdapter |
|
85 */ |
|
86 /*virtual*/ const TDesC16& SummaryText( TInt aIndex ) const; |
|
87 |
|
88 /** |
|
89 * Saves one setting handled by the adapter. |
|
90 * @see CWPAdapter |
|
91 */ |
|
92 /*virtual*/ void SaveL( TInt aItem ); |
|
93 |
|
94 /** |
|
95 * Returns ETrue if the adapter can set the settings as default. |
|
96 * @see CWPAdapter |
|
97 */ |
|
98 /*virtual*/ TBool CanSetAsDefault( TInt aItem ) const; |
|
99 |
|
100 /** |
|
101 * Adapter sets the settings as default. |
|
102 * @see CWPAdapter |
|
103 */ |
|
104 /*virtual*/ void SetAsDefaultL( TInt aItem ); |
|
105 |
|
106 /** |
|
107 * Calls the pair visitor for each detail line of an item. |
|
108 * @see CWPAdapter |
|
109 */ |
|
110 /*virtual*/ TInt DetailsL( TInt aItem, MWPPairVisitor& aVisitor ); |
|
111 |
|
112 /** |
|
113 * Returns a pointer to a context extension. |
|
114 * @param aExtension |
|
115 * Contains a pointer to MWPContextExtension if supported. |
|
116 * @return KErrNotSupported if not supported, KErrNone otherwise |
|
117 */ |
|
118 /*virtual*/ TInt ContextExtension( MWPContextExtension*& aExtension ); |
|
119 |
|
120 public: // From MWPVisitor (inheritance is through CWPAdapter) |
|
121 |
|
122 /** |
|
123 * Called for each characteristic found. |
|
124 * @see MWPVisitor |
|
125 */ |
|
126 /*virtual*/ void VisitL( CWPCharacteristic& aCharacteristic ); |
|
127 |
|
128 /** |
|
129 * Called for each parameter found. |
|
130 * @see MWPVisitor |
|
131 */ |
|
132 /*virtual*/ void VisitL( CWPParameter& aParameter ); |
|
133 |
|
134 /** |
|
135 * Called for each link to a logical proxy or access point. |
|
136 * @see MWPVisitor |
|
137 */ |
|
138 /*virtual*/ void VisitLinkL( CWPCharacteristic& aCharacteristic ); |
|
139 |
|
140 public : // from MMsvSessionObserver |
|
141 /** |
|
142 * Indicates an event has occurred. |
|
143 * @see MMsvSessionObserver |
|
144 */ |
|
145 /*virtual*/ void HandleSessionEventL( TMsvSessionEvent aEvent, |
|
146 TAny* aArg1, |
|
147 TAny* aArg2, |
|
148 TAny* aArg3 ); |
|
149 |
|
150 private : // construction |
|
151 /** |
|
152 * Constructor. |
|
153 */ |
|
154 CWhiteListAdapter(); |
|
155 |
|
156 /** |
|
157 * Second-phase constructor. |
|
158 */ |
|
159 void ConstructL(); |
|
160 |
|
161 private : // internal new methods |
|
162 /** |
|
163 * This method is for interpreting a string as push support. |
|
164 * If the value of the string is '1', then push is enabled, |
|
165 * if it's equal to '0', then push is disabled, otherwise the proxy |
|
166 * does not care of push. |
|
167 * @param aPushSupport String to be processed. |
|
168 * @return TPushSupport enumeration value. |
|
169 */ |
|
170 TPushSupport ResolvePushSupport( const TDesC& aPushSupport ); |
|
171 |
|
172 private: // From MWPContextExtension |
|
173 |
|
174 /** |
|
175 * Returns the data used for saving. |
|
176 * @param aIndex The index of the data |
|
177 * @return The data. Ownership is transferred. |
|
178 */ |
|
179 const TDesC8& SaveDataL( TInt aIndex ) const; |
|
180 |
|
181 /** |
|
182 * Deletes a saved item. |
|
183 * @param aSaveData The data used for saving |
|
184 */ |
|
185 void DeleteL( const TDesC8& aSaveData ); |
|
186 |
|
187 /** |
|
188 * Returns the UID of the adapter. |
|
189 * @return UID |
|
190 */ |
|
191 TUint32 Uid() const; |
|
192 |
|
193 private : // data members |
|
194 |
|
195 RPointerArray<TWhiteListAdapterItem> iItems; ///< Physical proxies |
|
196 |
|
197 /** |
|
198 * These items are parts of the current logical proxy and have not |
|
199 * been added to the final item array (i.e. iItems array), because |
|
200 * further processing is needed. |
|
201 */ |
|
202 RPointerArray<TWhiteListAdapterItem> iItemsToBeAdded; |
|
203 |
|
204 TPushSupport iLogicalProxyPushSupport; |
|
205 |
|
206 TBool iPhysicalProxyIsVisited; ///< In order to differentiate |
|
207 ///< if we are visiting a |
|
208 ///< ph. or a log. proxy |
|
209 |
|
210 TWhiteListAdapterItem* iCurrentItem; ///< Current physical proxy. |
|
211 ///< Has. |
|
212 |
|
213 CMsvSession* iMsvSession; ///< Session to the Message |
|
214 ///< Server. Has. |
|
215 CPushMtmSettings* iPushMtmSettings; ///< Push MTM Settings object. |
|
216 ///< Has. |
|
217 }; |
|
218 |
|
219 #endif // WHITELISTADAPTER_H |
|
220 |
|
221 // End of file |