|
1 /* |
|
2 * Copyright (c) 2002-2005 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: Header file for CNSmlDMProfilesContainer |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CNSMLDMPROFILESCONTAINER_H |
|
21 #define CNSMLDMPROFILESCONTAINER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <bldvariant.hrh> |
|
25 #include <eiklbo.h> |
|
26 #include <aknlists.h> |
|
27 #include <eikdialg.h> |
|
28 #include <eikmenup.h> |
|
29 #include <e32def.h> |
|
30 #include <aknstaticnotedialog.h> |
|
31 #include "NSmlDMSyncDocument.h" |
|
32 #include "NSmlDMSyncAppUi.h" |
|
33 |
|
34 // FORWARD DECLARATIONS |
|
35 class CNSmlDMSyncDocument; |
|
36 class TNSmlDMProfileItem; |
|
37 |
|
38 // CLASS DECLARATION |
|
39 |
|
40 /** |
|
41 * CNSmlDMProfilesContainer dialog class |
|
42 * |
|
43 */ |
|
44 class CNSmlDMProfilesContainer : public CCoeControl, |
|
45 public MCoeControlObserver, |
|
46 public MEikListBoxObserver |
|
47 { |
|
48 public: // Constructors and destructor |
|
49 |
|
50 /** |
|
51 * Two-phased constructor. |
|
52 */ |
|
53 static CNSmlDMProfilesContainer* NewL( CAknView* aView, |
|
54 const TRect& aRect ); |
|
55 |
|
56 /** |
|
57 * Destructor. |
|
58 */ |
|
59 ~CNSmlDMProfilesContainer(); |
|
60 |
|
61 public: // New functions |
|
62 |
|
63 /** |
|
64 * Refreshes the listbox contents. |
|
65 * @since Series 60 3.1 |
|
66 * @param None. |
|
67 * @return None. |
|
68 */ |
|
69 void RefreshL(); |
|
70 |
|
71 /** |
|
72 * Sets the iSettingsView true/false if settingsview is up/down |
|
73 * @param - |
|
74 * @return - |
|
75 */ |
|
76 inline void SetSettingsView() { iSettingsView = !iSettingsView; } |
|
77 |
|
78 /** |
|
79 * Return status of the Settings view |
|
80 * @param - |
|
81 * @return True if settings isn't open |
|
82 */ |
|
83 inline TBool SettingsView() const { return iSettingsView == EFalse; } |
|
84 |
|
85 /** |
|
86 * Update index on the main view |
|
87 * @param TInt aIndex - value of the index |
|
88 * @return - |
|
89 */ |
|
90 void SetCurrentIndex( TInt aIndex ); |
|
91 |
|
92 /** |
|
93 * Shows a menu corresponding to the given menu bar |
|
94 * resource identifier. |
|
95 * @since Series 60 3.1 |
|
96 * @param aResource Resource identifier of the menu to be shown. |
|
97 * @return None. |
|
98 */ |
|
99 void ShowContextMenuL( TInt aResource ); |
|
100 |
|
101 /** |
|
102 * Read profiles and fill the profile item list |
|
103 * @param - |
|
104 * @return - |
|
105 */ |
|
106 void ReadProfileListL(); |
|
107 |
|
108 /** |
|
109 * Create and show the logview dialog |
|
110 * @param - |
|
111 * @return - |
|
112 */ |
|
113 void PopupLogViewL(); |
|
114 |
|
115 /** |
|
116 * Close the active popupmenu |
|
117 * @param - |
|
118 * @return - |
|
119 */ |
|
120 void ClosePopupMenuL(); |
|
121 |
|
122 /** |
|
123 * Status of the main dialog menu |
|
124 * @param - |
|
125 * @return - ETrue if menu is up |
|
126 */ |
|
127 TBool MenuUp() const { return iMenuUp == 1; } |
|
128 |
|
129 /** |
|
130 * Closes menu |
|
131 * @param - |
|
132 * @return - |
|
133 */ |
|
134 void CloseMenuUp() { iMenuUp =0; } |
|
135 |
|
136 public: // Functions from base classes |
|
137 |
|
138 /** |
|
139 * From CoeControl Responds to size changes. |
|
140 * Sets the size and position of the contents of this control. |
|
141 * @since Series 60 3.1 |
|
142 * @param None. |
|
143 * @return None. |
|
144 */ |
|
145 void SizeChanged(); |
|
146 |
|
147 /** |
|
148 * From CoeControl Handles the situations where |
|
149 * a resource (e.g. skin or layout) is changed. |
|
150 * @since Series 60 3.1 |
|
151 * @param aType Type of resource change. |
|
152 * @return None. |
|
153 */ |
|
154 void HandleResourceChange( TInt aType ); |
|
155 |
|
156 /** |
|
157 * From CoeControl Gets the number of controls contained |
|
158 * in a compound control. |
|
159 * @since Series 60 3.1 |
|
160 * @param None. |
|
161 * @return The number of component controls contained by this control. |
|
162 */ |
|
163 TInt CountComponentControls() const; |
|
164 |
|
165 /** |
|
166 * From CoeControl Gets the specified component of a compound control. |
|
167 * @since Series 60 3.1 |
|
168 * @param aIndex The index of the control to get. |
|
169 * @return Reference to the component control. |
|
170 */ |
|
171 CCoeControl* ComponentControl( TInt aIndex ) const; |
|
172 |
|
173 /** |
|
174 * From CoeControl Draws the control. |
|
175 * @since Series 60 3.1 |
|
176 * @param aRect The region of the control to be redrawn. |
|
177 * @return None. |
|
178 */ |
|
179 void Draw( const TRect& aRect ) const; |
|
180 |
|
181 /** |
|
182 * From CoeControl Handles key events. |
|
183 * @since Series 60 3.1 |
|
184 * @param aKeyEvent The key event that occurred. |
|
185 * @param aType The event type. |
|
186 * @return Response to the key event. |
|
187 */ |
|
188 TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); |
|
189 |
|
190 /** |
|
191 * Handle ListBox EventL |
|
192 * @param CEikListBox* aListBox Pointer to used listbox |
|
193 * @param TListBoxEvent aEventType Event type |
|
194 * @return - |
|
195 */ |
|
196 void HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aEventType ); |
|
197 |
|
198 /** |
|
199 * From MCoeControlObserver Handles an event from an observed control. |
|
200 * @since Series 60 3.1 |
|
201 * @param aControl The control that sent the event. |
|
202 * @param aEventType The event type. |
|
203 * @return None. |
|
204 */ |
|
205 void HandleControlEventL( CCoeControl* aControl, TCoeEvent aEventType ); |
|
206 |
|
207 /** |
|
208 * From CoeControl Gets the control's help context. |
|
209 * @since Series 60 3.1 |
|
210 * @param aContext The control's help context |
|
211 * @return None. |
|
212 */ |
|
213 void GetHelpContext( TCoeHelpContext& aContext ) const; |
|
214 /** |
|
215 * Handle Pointer EventL |
|
216 * @since Series 60 3.2 |
|
217 * @param aPointerEvent The event type |
|
218 * @return None. |
|
219 */ |
|
220 void HandlePointerEventL( const TPointerEvent& aPointerEvent ); |
|
221 |
|
222 protected: |
|
223 |
|
224 /** |
|
225 * Change of focus |
|
226 * @param - |
|
227 * @return - |
|
228 */ |
|
229 void FocusChanged(TDrawNow aDrawNow); |
|
230 |
|
231 protected: // Functions from CEikDialog |
|
232 |
|
233 /** |
|
234 * Called by framework before the dialog is shown |
|
235 * @param - |
|
236 * @return - |
|
237 */ |
|
238 void PreLayoutDynInitL(); |
|
239 |
|
240 /** |
|
241 * Called by framework after the dialog is shown |
|
242 * @param - |
|
243 * @return - |
|
244 */ |
|
245 void PostLayoutDynInitL(); |
|
246 |
|
247 /** |
|
248 * Build and format the logview listbox texts |
|
249 * @param aArray - |
|
250 * @return - |
|
251 */ |
|
252 void FormatLogViewListL(CDesCArray* aArray); |
|
253 |
|
254 /** |
|
255 * Appends icons to the contained listbox. |
|
256 * @since Series 60 3.1 |
|
257 * @param None. |
|
258 * @return None. |
|
259 */ |
|
260 void AddIconsL(); |
|
261 |
|
262 private: |
|
263 |
|
264 /** |
|
265 * C++ default constructor. |
|
266 */ |
|
267 CNSmlDMProfilesContainer( CAknView* aView ); |
|
268 |
|
269 /** |
|
270 * By default Symbian 2nd phase constructor is private. |
|
271 */ |
|
272 void ConstructL( const TRect& aRect ); |
|
273 |
|
274 public: // data |
|
275 CAknDoubleLargeStyleListBox* iProfilesListBox; |
|
276 |
|
277 private: // data |
|
278 CNSmlDMSyncAppUi* iAppUi; |
|
279 CNSmlDMSyncDocument* iDocument; |
|
280 // Pointer to the view instance |
|
281 CAknView* iView; |
|
282 |
|
283 TBool iContextMenuUp; |
|
284 TBool iConfirmationNoteUp; |
|
285 TInt iMenuUp; |
|
286 TBool iSettingsView; |
|
287 }; |
|
288 |
|
289 #endif // CNSMLDMPROFILESCONTAINER_H |
|
290 |
|
291 // End of File |