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: Popup for selecting the underlying connection method or |
|
15 * destination for a VPN connection method |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef CMPVPN_NEXT_LAYER_SELECT_DLG_H |
|
20 #define CMPVPN_NEXT_LAYER_SELECT_DLG_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <aknlistquerydialog.h> // CAknListQueryDialog |
|
24 |
|
25 #include <ConeResLoader.h> // resource reader |
|
26 |
|
27 class CEikonEnv; |
|
28 class CCmPluginBaseEng; |
|
29 class CCmManagerImpl; |
|
30 class CGulIcon; |
|
31 |
|
32 |
|
33 |
|
34 /** |
|
35 * CmPluginVpnNextLayerSelectDlg dialog class |
|
36 * |
|
37 * |
|
38 * |
|
39 * @since S60 v3.2 |
|
40 */ |
|
41 NONSHARABLE_CLASS( CmPluginVpnNextLayerSelectDlg ) : public CAknListQueryDialog |
|
42 { |
|
43 public: // Constructors and destructor |
|
44 |
|
45 static CmPluginVpnNextLayerSelectDlg* NewL( |
|
46 CCmPluginBaseEng& aCmPluginBaseEng, |
|
47 RArray<TUint32>& aBindableMethods, |
|
48 TBool& aSnapSelected, |
|
49 TUint32& aNextLayerId ); |
|
50 |
|
51 /** |
|
52 * Destructor. |
|
53 */ |
|
54 virtual ~CmPluginVpnNextLayerSelectDlg(); |
|
55 |
|
56 |
|
57 private: // Constructor |
|
58 |
|
59 /** |
|
60 * Constructor. |
|
61 */ |
|
62 CmPluginVpnNextLayerSelectDlg( CCmPluginBaseEng& aCmPluginBaseEng, |
|
63 RArray<TUint32>& aBindableMethods, |
|
64 TBool& aSnapSelected, |
|
65 TUint32& aNextLayerId, |
|
66 TInt aDummyIndex ); |
|
67 |
|
68 /** |
|
69 * Second phase constructor. Leaves on failure. |
|
70 */ |
|
71 void ConstructL(); |
|
72 |
|
73 public: // new |
|
74 |
|
75 static TInt CancelAsynchronouslyL( TAny* aObject ); |
|
76 |
|
77 |
|
78 protected: // From CAknListQueryDialog |
|
79 |
|
80 /** |
|
81 * @see CAknListQueryDialog |
|
82 */ |
|
83 virtual void PreLayoutDynInitL(); |
|
84 |
|
85 /** |
|
86 * @see CAknListQueryDialog |
|
87 */ |
|
88 TBool OkToExitL( TInt aButtonId ); |
|
89 |
|
90 public: // From CAknListQueryDialog |
|
91 |
|
92 /** |
|
93 * @see CAknListQueryDialog |
|
94 */ |
|
95 void ProcessCommandL( TInt aCommandId ); |
|
96 |
|
97 /** |
|
98 * @see CAknListQueryDialog |
|
99 */ |
|
100 void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); |
|
101 |
|
102 /** |
|
103 * @see CAknListQueryDialog |
|
104 */ |
|
105 void HandleListBoxEventL( CEikListBox* aListBox, |
|
106 TListBoxEvent aEventType ); |
|
107 |
|
108 |
|
109 public: // From CCoeControl |
|
110 |
|
111 /** |
|
112 * Returns the help context |
|
113 * From CCoeControl |
|
114 * |
|
115 * @since S60 3.2 |
|
116 * @param aContext the returned help context |
|
117 */ |
|
118 void GetHelpContext( TCoeHelpContext& aContext ) const; |
|
119 |
|
120 /** |
|
121 * From CCoeControl |
|
122 * |
|
123 * @since S60 3.2 |
|
124 * @param aKeyEvent The key event. |
|
125 * @param aType Key event type. |
|
126 * @return key response (was the key event consumed?). |
|
127 */ |
|
128 TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, |
|
129 TEventCode aType ); |
|
130 |
|
131 |
|
132 private: // new functions |
|
133 |
|
134 /* |
|
135 * Load the given resource file |
|
136 * |
|
137 * @since S60 3.2 |
|
138 * @param aResFileName |
|
139 */ |
|
140 void LoadResourceL( const TDesC& aResFileName ); |
|
141 |
|
142 /* |
|
143 * Formats the texts for the list items using given resources |
|
144 * |
|
145 * @param aFirstLineResId the resource Id for the first line |
|
146 * @param aSecondLineResId the resource Id for the second line |
|
147 * @param aIconIndex the icon's index value |
|
148 * @return the formatted text |
|
149 */ |
|
150 HBufC* FormatListItemTextsLC( TInt aFirstLineResId, |
|
151 TInt aSecondLineResId, |
|
152 TInt aIconIndex ); |
|
153 |
|
154 /** |
|
155 */ |
|
156 HBufC* FormatListItemTextsLC( TInt aFirstLineResId, |
|
157 const TDesC& aSecondLineText, |
|
158 TInt aIconIndex ); |
|
159 |
|
160 /** |
|
161 */ |
|
162 HBufC* FormatListItemTextsLC( const TDesC& aFirstLineResId, |
|
163 const TDesC& aSecondLineText, |
|
164 TInt aIconIndex ); |
|
165 |
|
166 /** |
|
167 */ |
|
168 HBufC* FormatListItemTextsL( const TDesC& aFirstLineText, |
|
169 const TDesC& aSecondLineText, |
|
170 TInt aIconIndex ); |
|
171 |
|
172 /** |
|
173 * Displays a radio button selection dialog to select the |
|
174 * underlying connection method |
|
175 * |
|
176 * @since S60 3.2 |
|
177 * @param aDestinationId the destination id to search |
|
178 * @param aCmId the selection as a return value |
|
179 * @return ETrue if selection made EFalse if cancelled |
|
180 */ |
|
181 TBool ShowCMSelectionDlgL( TUint32 aDestinationId, |
|
182 TUint32& aCmId ); |
|
183 |
|
184 void SetTextsAndIconsL(); |
|
185 |
|
186 void AppendDestinationTextsL( CCmDestinationImpl& aDestination, |
|
187 TInt aNumCms, |
|
188 CDesCArray& aItems, |
|
189 CArrayPtr<CGulIcon>& aIcons ); |
|
190 |
|
191 void AppendUncatDestinationL( CDesCArray& aItems, |
|
192 CArrayPtr<CGulIcon>& aIcons ); |
|
193 |
|
194 void AppendEasyWlanL( CDesCArray& aItems, |
|
195 CArrayPtr<CGulIcon>& aIcons ); |
|
196 |
|
197 |
|
198 private: // data members |
|
199 |
|
200 /** |
|
201 * Eikon environment |
|
202 */ |
|
203 CEikonEnv& iMyEikonEnv; |
|
204 |
|
205 /** |
|
206 * base class not owned |
|
207 */ |
|
208 CCmPluginBaseEng& iCmPluginBaseEng; |
|
209 |
|
210 /** |
|
211 * Result of selection: ETrue if a SNAP was selected |
|
212 */ |
|
213 TBool& iSnapSelected; |
|
214 |
|
215 /** |
|
216 * Result of selection: The ID of the connection method or SNAP |
|
217 */ |
|
218 TUint32& iNextLayerId; |
|
219 |
|
220 /** |
|
221 * Resource reader |
|
222 */ |
|
223 RConeResourceLoader iResourceReader; |
|
224 |
|
225 /** |
|
226 * An array containing all of the destination's ids |
|
227 */ |
|
228 RArray<TUint32>& iDestinations; |
|
229 |
|
230 /** |
|
231 * The id of EasyWlan ( zero if none ) |
|
232 */ |
|
233 TUint32 iEasyWlanId; |
|
234 |
|
235 /** |
|
236 * access to the cmmanager |
|
237 */ |
|
238 CCmManagerImpl& iCmManager; // not owned |
|
239 |
|
240 /** |
|
241 * Flag to determine if there are uncategorised connection methods |
|
242 */ |
|
243 TBool iUncatItems; |
|
244 |
|
245 /** |
|
246 * One shot active object for asynchronous exiting with Cancel |
|
247 */ |
|
248 CAsyncCallBack* iAsyncCancel; |
|
249 |
|
250 |
|
251 }; |
|
252 #endif // CMPVPN_NEXT_LAYER_SELECT_DLG_H |
|