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: Dialog for setting the gateway. It's used temporarily. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CMDIALOG_H |
|
19 #define CMDIALOG_H |
|
20 |
|
21 // INCLUDES |
|
22 |
|
23 #include <AknForm.h> |
|
24 #include <AknInfoPopupNoteController.h> |
|
25 #include "cmlistboxmodel.h" |
|
26 #include "cmlistbox.h" |
|
27 #include "cmdestinationimpl.h" |
|
28 #include "cmmanagerimpl.h" |
|
29 #include <mcmdexec.h> |
|
30 #include "cmcommsdatnotifier.h" |
|
31 |
|
32 //#include <EIKLBO.H> |
|
33 |
|
34 // CLASS DECLARATION |
|
35 class CEikStatusPane; |
|
36 class CAknTitlePane; |
|
37 class CAknNavigationControlContainer; |
|
38 class CAknNavigationDecorator; |
|
39 class CCmWizard; |
|
40 class CCmdExec; |
|
41 class CDestDlg; |
|
42 |
|
43 /** |
|
44 * Dialog for displaying and editing connection methods |
|
45 * also base class for CUncatDlg |
|
46 * @lib cmmanager.lib |
|
47 * @since S60 v3.2 |
|
48 */ |
|
49 NONSHARABLE_CLASS( CCmDlg ) : public CAknDialog |
|
50 , MEikListBoxObserver |
|
51 , MAknInfoPopupNoteObserver |
|
52 , public MCmdExec |
|
53 , public MCmCommsDatWatcher |
|
54 { |
|
55 public : // construction |
|
56 CCmDlg( CCmManagerImpl* aCmManager, TUint32 aDestUid, |
|
57 CDestDlg* aDestDlg ); |
|
58 |
|
59 ~CCmDlg(); |
|
60 |
|
61 /** |
|
62 * Two-phased constructor. |
|
63 */ |
|
64 static CCmDlg* NewL( CCmManagerImpl* aCmManager, TUint32 aDestUid, |
|
65 CDestDlg* aDestDlg ); |
|
66 |
|
67 TInt ConstructAndRunLD( TUint32 aHighLight, TUint32& aSelected ); |
|
68 |
|
69 // From MEikMenuObserver |
|
70 virtual void DynInitMenuPaneL( TInt aResourceId, |
|
71 CEikMenuPane* aMenuPane ); |
|
72 // From MEikCommandObserver |
|
73 virtual void ProcessCommandL( TInt aCommandId ) ; |
|
74 |
|
75 /** |
|
76 * Updates listbox data |
|
77 */ |
|
78 virtual void HandleListboxDataChangeL(); |
|
79 |
|
80 /** |
|
81 * Handle key event. |
|
82 * @param aKeyEvent The key event. |
|
83 * @param aType Key event type. |
|
84 * @return Response (was the key event consumed?). |
|
85 */ |
|
86 TKeyResponse OfferKeyEventL |
|
87 ( const TKeyEvent& aKeyEvent, TEventCode aType ); |
|
88 |
|
89 public: |
|
90 /** |
|
91 * From base class MCmdExec |
|
92 */ |
|
93 void Execute(); |
|
94 |
|
95 public: // From CCoeControl |
|
96 |
|
97 /** |
|
98 * Returns the help context |
|
99 * From CCoeControl |
|
100 * |
|
101 * @since S60 3.2 |
|
102 * @param aContext the returned help context |
|
103 */ |
|
104 void GetHelpContext( TCoeHelpContext& aContext ) const; |
|
105 |
|
106 /** |
|
107 * Handles the resource change |
|
108 * From CCoeControl |
|
109 * |
|
110 * @since S60 5.0 |
|
111 * @param aType Type of the resource change |
|
112 */ |
|
113 void HandleResourceChange( TInt aType ); |
|
114 |
|
115 public: // From MCmCommsDatWatcher |
|
116 |
|
117 /** |
|
118 * Watch changes in CommsDat |
|
119 */ |
|
120 virtual void CommsDatChangesL(); |
|
121 |
|
122 protected : // from CEikDialog |
|
123 TBool OkToExitL( TInt aButtonId ) ; |
|
124 |
|
125 virtual void PreLayoutDynInitL(); |
|
126 |
|
127 SEikControlInfo CreateCustomControlL ( TInt aControlType ); |
|
128 |
|
129 // From MEikListBoxObserver |
|
130 void HandleListBoxEventL( CEikListBox* aListBox, |
|
131 TListBoxEvent aEventType ); |
|
132 |
|
133 /** |
|
134 * Initialises listbox texts |
|
135 */ |
|
136 virtual void InitTextsL(); |
|
137 |
|
138 /** |
|
139 * Sets the number of conn methods text on navi pane |
|
140 */ |
|
141 void SetNoOfCMsL(TInt aCount); |
|
142 |
|
143 |
|
144 //from MAknInfoPopupNoteObserver |
|
145 /* Handles events reported from info popup note. |
|
146 * @param aController The controller that controls the note, from |
|
147 * where the event originates. |
|
148 * @param aEvent The event. |
|
149 */ |
|
150 void HandleInfoPopupNoteEvent( |
|
151 CAknInfoPopupNoteController* aController, |
|
152 TAknInfoPopupNoteEvent aEvent ); |
|
153 |
|
154 /** |
|
155 * @return the currently focused connection method in the list |
|
156 */ |
|
157 virtual CCmPluginBase* CurrentCML(); |
|
158 |
|
159 /** |
|
160 * @return the connection method in the list at the specified index |
|
161 */ |
|
162 virtual CCmPluginBase* CMByIndexL( TInt aIndex ); |
|
163 |
|
164 /** |
|
165 * @return the connection mehtod count |
|
166 */ |
|
167 virtual TInt CMCount(); |
|
168 |
|
169 /** |
|
170 * deletes the currently highlighted conneciton method |
|
171 */ |
|
172 void DeleteCurrentCmL(); |
|
173 |
|
174 void RenameConnectionMethodL(); |
|
175 void PrioritiseConnectionMethodL(); |
|
176 void AddConnectionMethodL(); |
|
177 void CopyConnectionMethodL(); |
|
178 void MoveConnectionMethodL(); |
|
179 void EditConnectionMethodL(); |
|
180 |
|
181 /** |
|
182 * Indicates if a connection is in use and displays and error message |
|
183 * |
|
184 * @return ETrue if in use |
|
185 */ |
|
186 TBool CurrentCmInUseL(); |
|
187 |
|
188 virtual void ConstructCMArrayL( RArray<TUint32>& aCmIds ); |
|
189 |
|
190 /** |
|
191 * Remove hidden Connection Methods from the Array |
|
192 */ |
|
193 virtual void ClearHiddenCMsFromArrayL( RArray<TUint32>& aCmIds ); |
|
194 |
|
195 public: |
|
196 /** |
|
197 * From base class MCmdExec |
|
198 */ |
|
199 void HandleLeaveError( TInt aError ); |
|
200 |
|
201 private: |
|
202 |
|
203 /** |
|
204 * Finishes the priorizing method |
|
205 * |
|
206 * @param aOkPushed ETrue if the OK button pushed. |
|
207 * EFalse if the Cancel button pushed. |
|
208 * |
|
209 */ |
|
210 void FinishPriorizingL( TBool aOkPushed ); |
|
211 |
|
212 /** |
|
213 * Rebuild item index array to remove some Iap that has been deleted from |
|
214 * CommsDat by other application |
|
215 */ |
|
216 void ReBuildItemIndexArrayL(); |
|
217 |
|
218 /** |
|
219 * Reorder connection methods according to underlying connection in case of vpn |
|
220 */ |
|
221 void ReOrderCMsL(); |
|
222 |
|
223 |
|
224 /** |
|
225 * Get a proper index in list for priority |
|
226 */ |
|
227 TInt GetInsertIndexL( TInt aCount, TUint32 aPriority ); |
|
228 |
|
229 /** |
|
230 * Check if plugin exits exceptionally |
|
231 */ |
|
232 TBool IsExceptionExitL(); |
|
233 |
|
234 protected: |
|
235 CCmListboxModel* iModel; |
|
236 TUint32 iHighlight; |
|
237 TUint32* iSelected; |
|
238 TBool iModelPassed; |
|
239 CCmListbox* iListbox; |
|
240 CEikStatusPane* iStatusPane; // NOT owned |
|
241 CAknTitlePane* iTitlePane; // NOT owned |
|
242 CAknNavigationControlContainer* iNaviPane; // NOT owned |
|
243 CAknNavigationDecorator* iNaviDecorator; // owned |
|
244 HBufC* iOldTitleText; |
|
245 CCmManagerImpl* iCmManager; // NOT owned |
|
246 TUint32 iDestUid; // uid of the destination the |
|
247 // connection mehtods belong to |
|
248 TBool iPrioritising; |
|
249 TInt iExitReason; // Exit reason, can be KUserExit or |
|
250 // KUserBack used to pass user exit |
|
251 // event |
|
252 CAknInfoPopupNoteController* iInfoPopupNoteController; |
|
253 |
|
254 private: |
|
255 |
|
256 TInt iCmToPrioritise; // connection mehthod index |
|
257 // selected to prioritise |
|
258 CCmDestinationImpl* iCmDestinationImpl; // the destination the |
|
259 |
|
260 CCmWizard* iCmWizard; // wizard for connection method creation |
|
261 // Indicated that Escape has arrived and it should be forwarded when CmWizard |
|
262 // finished its work |
|
263 TBool iEscapeArrived; |
|
264 |
|
265 TBool iProcessing; |
|
266 TBool iAlreadyConfirmedDelete; |
|
267 // connection mehtods belongs to |
|
268 TBool iExitduringProcessing; |
|
269 TBool iBackduringProcessing; |
|
270 CDestDlg* iDestDlg; |
|
271 |
|
272 /** |
|
273 * Indicate if exiting from plugin normally or exceptionally |
|
274 */ |
|
275 TBool iPluginExitExceptionally; |
|
276 |
|
277 protected: |
|
278 // This is nescessary becaue in case of not supported CMs the data base |
|
279 // and the lisbox content is different.(The listbox doesn' show the |
|
280 // unsupported ones.) |
|
281 RArray<TInt> iItemIndex; |
|
282 CCmdExec* iCmdExec; |
|
283 }; |
|
284 |
|
285 #endif |
|