1 aknsettingpage.h |
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 "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * Base class for setting page (setting item editing) UI |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef __AKNSETTINGPAGE_H__ |
|
21 #define __AKNSETTINGPAGE_H__ |
|
22 |
|
23 #include <AknControl.h> |
|
24 |
|
25 #include <eikdef.h> |
|
26 #include <eikbtgpc.h> |
|
27 |
|
28 // For menu support |
|
29 #include <eikmenub.h> |
|
30 #include <eikmenup.h> |
|
31 #include <eikmobs.h> |
|
32 |
|
33 // for layout support |
|
34 #include <aknutils.h> |
|
35 |
|
36 // for navipane support (hint text) |
|
37 #include <aknnavi.h> |
|
38 |
|
39 // |
|
40 // Forward declarations |
|
41 // |
|
42 class CEikLabel; |
|
43 class CAknSettingPageSkinsInfo; |
|
44 class MAknsControlContext; |
|
45 class CAknsFrameBackgroundControlContext; |
|
46 class CAknSettingPageExtension; |
|
47 |
|
48 |
|
49 // Used as the return value of SettingId() if not yet set. |
|
50 // This because the Id might want to be the index of a 0-based array |
|
51 |
|
52 const TInt KAknSettingPageNoIdSet = -1; |
|
53 |
|
54 class CAknSettingPage; |
|
55 |
|
56 // This class is used as a means of notifying change in settings. |
|
57 |
|
58 class MAknSettingPageObserver |
|
59 { |
|
60 public: |
|
61 enum TAknSettingPageEvent |
|
62 { |
|
63 EEventSettingChanged, |
|
64 EEventSettingCancelled, |
|
65 EEventSettingOked |
|
66 }; |
|
67 public: |
|
68 |
|
69 /** |
|
70 * Handles an event of type aEventType reported by the Setting Page to this observer. |
|
71 */ |
|
72 virtual void HandleSettingPageEventL(CAknSettingPage* aSettingPage,TAknSettingPageEvent aEventType )=0; |
|
73 |
|
74 }; |
|
75 |
|
76 class CAknSettingPage : public CAknControl, public MCoeControlObserver, public MEikMenuObserver |
|
77 { |
|
78 public: |
|
79 |
|
80 /** |
|
81 * This enumeration is passed in the ExecuteLD() method to control how often the setting page |
|
82 * updates the externally held client object |
|
83 */ |
|
84 enum TAknSettingPageUpdateMode |
|
85 { |
|
86 EUpdateWhenChanged, |
|
87 EUpdateWhenAccepted |
|
88 }; |
|
89 |
|
90 /** |
|
91 * This enumeration is used to select the type and IIDs for the various classes defined in the |
|
92 * Skins LAF spec for "Opened Setting Items" |
|
93 */ |
|
94 enum TEditedItemSkinClass |
|
95 { |
|
96 ESettingPageSkinEditedItemClassValueItemList, |
|
97 ESettingPageSkinEditedItemClassVolume, |
|
98 ESettingPageSkinEditedItemClassSlider, |
|
99 ESettingPageSkinEditedItemClassTextEntry, |
|
100 ESettingPageSkinEditedItemClassCodeDateTimeEntry |
|
101 }; |
|
102 /** |
|
103 * Simple contructor for using a single setting page resource which itself gives all |
|
104 * the setup |
|
105 */ |
|
106 IMPORT_C CAknSettingPage( TInt aSettingPageResourceId ); |
|
107 /** |
|
108 * Constructor that allows separate setting page and editor resources |
|
109 * |
|
110 * In all cases the number (if supplied i.e. <> 0 ) is used. |
|
111 * |
|
112 * Editor Resource Setting Page Resource |
|
113 * present present Both are used (but text & number overridden) |
|
114 * = 0 present Editor resource is used via SP resource |
|
115 * present = 0 Default Avkon SP resource if used |
|
116 * = 0 = 0 Not permitted |
|
117 * |
|
118 * Note: The first argument is a TDesC* (rather than TDesC&) because the other constructor |
|
119 * cannot initialize such a member without allocation or having an internal dummy buffer. |
|
120 * |
|
121 * Rules for text and numbers: The rules are the same for both: (non-zero length) text or number other |
|
122 * than EAknSettingPageNoOrdinalDisplayed if given in this constructor will not override resource |
|
123 * (unless that is zero length or EAknSettingPageNoOrdinalDisplayed). Note, however, that text or number given via the |
|
124 * specific API for setting them, WILL override resource. |
|
125 * It is assumed that number from resource is very rare. Special text is somewhat more likely. |
|
126 * |
|
127 * @param aSettingTitleText Text at top of setting pane (not copied; must be owned externally until ExecuteLD is called) |
|
128 * @param aSettingNumber Number at top left (if present) |
|
129 * @param aControlType Determines the type constructed and how its resource is read |
|
130 * @param aEditorResourceId Editor resource to use in the setting page (if present) |
|
131 * @param aSettingPageResourceId Setting Page to use (if present) |
|
132 */ |
|
133 IMPORT_C CAknSettingPage( const TDesC* aSettingTitleText, |
|
134 TInt aSettingNumber, |
|
135 TInt aControlType, |
|
136 TInt aEditorResourceId, |
|
137 TInt aSettingPageResourceId = 0 ); |
|
138 /** |
|
139 * C++ destructor |
|
140 */ |
|
141 IMPORT_C virtual ~CAknSettingPage(); |
|
142 |
|
143 /** |
|
144 * Executes a waiting dialog-like setting page |
|
145 * |
|
146 * The passed mode determines if the editor's value is updated continuously, or just |
|
147 * when it is accepted. |
|
148 * |
|
149 * @param aMode The update mode of the class |
|
150 */ |
|
151 IMPORT_C TBool ExecuteLD( enum CAknSettingPage::TAknSettingPageUpdateMode aMode=EUpdateWhenAccepted ); |
|
152 |
|
153 /** |
|
154 * public method for construction. Only thing required to do in this class is to call the |
|
155 * BaseConstructL(). Derived classes may be required to do more |
|
156 * |
|
157 */ |
|
158 IMPORT_C virtual void ConstructL(); |
|
159 |
|
160 /** |
|
161 * Returns reference to the hosted "editor" control as a CCoeControl. |
|
162 * This routine is used in derived classes, which may then cast to the specific run-time type |
|
163 * Note also that derived classes may provide type-specific access that performs these casts already |
|
164 * |
|
165 * @return CCoeControl* pointer to the hosted editor control |
|
166 */ |
|
167 IMPORT_C CCoeControl* EditorControl() const; |
|
168 |
|
169 /** |
|
170 * Returns the setting Id. |
|
171 * |
|
172 * @return TInt the setting Id |
|
173 */ |
|
174 IMPORT_C TInt SettingId() const; |
|
175 |
|
176 /** |
|
177 * Sets the setting Id. The Id may be used to unabiguously number a setting in some context. |
|
178 * It would be useful to call SettingId() on aSettingPageControl in handling an observer |
|
179 * callback. The Id is not used internally. |
|
180 * |
|
181 * @param aSettingId An id to provide to the observer in the callback |
|
182 */ |
|
183 IMPORT_C void SetSettingId( TInt aSettingId ); |
|
184 /** |
|
185 * Substitutes the new setting number. |
|
186 * |
|
187 * @param aSettingNumber The new setting number to display |
|
188 */ |
|
189 IMPORT_C void SetSettingNumberL( const TInt aSettingNumber ); |
|
190 |
|
191 /** |
|
192 * Substitutes the new setting text. Memory is allocated for a copy. |
|
193 * If already constructed, the label is reformatted. |
|
194 * |
|
195 * Note that calling this will over-ride text in Setting Page resource |
|
196 * |
|
197 * @param aSettingText The new setting text to display |
|
198 */ |
|
199 IMPORT_C void SetSettingTextL( const TDesC& aSettingText ); |
|
200 |
|
201 /** |
|
202 * Sets the observer for the setting page. |
|
203 * |
|
204 * @param aObserver The observer for changes to the setting |
|
205 */ |
|
206 IMPORT_C void SetSettingPageObserver( MAknSettingPageObserver* aObserver); |
|
207 |
|
208 /** |
|
209 * Access method for the number of the setting page |
|
210 * |
|
211 */ |
|
212 IMPORT_C TInt SettingNumber() const; |
|
213 |
|
214 /** |
|
215 * Access method for whether the setting page is numbered or not |
|
216 * |
|
217 */ |
|
218 IMPORT_C TBool IsNumbered() const; |
|
219 |
|
220 /** |
|
221 * Set method for whether the setting page is numbered or not |
|
222 * |
|
223 */ |
|
224 IMPORT_C void SetNumbered( TBool aNumbered ); |
|
225 |
|
226 /** |
|
227 * Reads the passed-in setting page resource in order to read the contained editor control |
|
228 * resource information |
|
229 * @param aSettingPageResoruceId This is used to specifiy what resource to read |
|
230 * @param aControlType Returns the control type (MAY return 0 - that's a valid control type! |
|
231 * @param aEditorResourceId Returns the setting page's LLINK editor resource, but returns 0 if not present |
|
232 * |
|
233 * This will leave if an invalid resource ID is passed |
|
234 */ |
|
235 IMPORT_C static void GetEditorResourceInfoL( |
|
236 TInt aSettingPageResourceId, |
|
237 TInt& aControlType, |
|
238 TInt& aEditorResourceId ); |
|
239 |
|
240 |
|
241 /** |
|
242 * Set the edit-state of the setting page. The setting page can be edited or |
|
243 * it can be only viewed by the user. |
|
244 * |
|
245 * @since 3.1 |
|
246 * @param aEditable If false, the setting page cannot be modified by the user |
|
247 */ |
|
248 IMPORT_C void SetEditState(const TBool aEditable); |
|
249 |
|
250 /** |
|
251 * Is the setting page possible to edit by the user. |
|
252 * |
|
253 * @since 3.1 |
|
254 * @return Can user modify the setting page. True if can, false if cannot. |
|
255 */ |
|
256 IMPORT_C TBool IsEditable() const; |
|
257 |
|
258 /** |
|
259 * Used for aknsettingpage's extenstion corresponding function |
|
260 * |
|
261 * @since 5.0 |
|
262 * @param aCaption On return, this should be set to the caption of the target control. |
|
263 */ |
|
264 void GetCaptionForFep(TDes& aCaption) const; |
|
265 |
|
266 protected: |
|
267 |
|
268 /** |
|
269 * From CCoeControl |
|
270 * This routine is called as part of the set-up of the control. It is the place to put |
|
271 * layout code. |
|
272 * |
|
273 */ |
|
274 IMPORT_C virtual void SizeChanged(); |
|
275 |
|
276 |
|
277 /** |
|
278 * From CCoeControl |
|
279 * Takes any action required when the control gains or loses focus e.g. to change its appearance. |
|
280 * The control should be redrawn depending on the value of aDrawNow. Empty by default. |
|
281 */ |
|
282 IMPORT_C virtual void FocusChanged(TDrawNow aDrawNow); |
|
283 |
|
284 /** |
|
285 * From MEikCommandObserver |
|
286 * Processes events from the softkeys. Responds to EAknSoftkeyOk and EAknSoftkeyBack |
|
287 * to accept or cancel the pop-up. |
|
288 * |
|
289 * @param aCommandId Event Id from the soft-key |
|
290 */ |
|
291 IMPORT_C virtual void ProcessCommandL(TInt aCommandId); |
|
292 |
|
293 /** |
|
294 * From MCoeControlObserver: |
|
295 * Acts upon changes in the hosted control's state. |
|
296 * |
|
297 * This class's implementation is trivial and should be able to be |
|
298 * safely re-implemented in directly client-derived classes. |
|
299 * For non-base setting page classes, a call to the base class should be made |
|
300 * |
|
301 * @param aControl The control changing its state (not used) |
|
302 * @param aEventType The type of control event |
|
303 */ |
|
304 IMPORT_C virtual void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType); |
|
305 |
|
306 // |
|
307 // |
|
308 // Framework functions. New in this class |
|
309 // |
|
310 // |
|
311 /** |
|
312 * Framework method to determine if it is OK to exit the setting page. |
|
313 * Derived classes may check for valid data before allowing the dismissal of the |
|
314 * setting page. |
|
315 * |
|
316 * @param aAccept ETrue if the user has indicated to accept the setting page; EFalse otherwise |
|
317 * @return TBool a value indicating whether the setting page should be dismissed |
|
318 */ |
|
319 IMPORT_C virtual TBool OkToExitL(TBool aAccept); |
|
320 |
|
321 /** |
|
322 * Called immediately prior to activation of the dialog. Framework routine for derived |
|
323 * classes. |
|
324 * |
|
325 */ |
|
326 IMPORT_C virtual void DynamicInitL(); |
|
327 |
|
328 /** |
|
329 * Called when something has changed and the client's object needs to have its value updated |
|
330 * |
|
331 */ |
|
332 IMPORT_C virtual void UpdateSettingL(); |
|
333 |
|
334 /** |
|
335 * Called when the user accepts a setting and the setting page is about to be dismissed. The latest value of the |
|
336 * setting is written to the client's object |
|
337 */ |
|
338 IMPORT_C virtual void AcceptSettingL(); |
|
339 |
|
340 /** |
|
341 * Called when the user rejects the setting. A backup copy may need to be restored if UpdateWhenChanged flag was set |
|
342 * |
|
343 */ |
|
344 IMPORT_C virtual void RestoreOriginalSettingL(); |
|
345 |
|
346 /** |
|
347 * Display the menu |
|
348 */ |
|
349 IMPORT_C virtual void DisplayMenuL() ; |
|
350 |
|
351 /** |
|
352 * Hide the menu |
|
353 */ |
|
354 IMPORT_C virtual void HideMenu() ; |
|
355 |
|
356 /** |
|
357 * Puts the focus back on the editor. For complicated setting pages that have focus removed from them |
|
358 * at some point, then a re-implementation may have to do some work here. |
|
359 */ |
|
360 IMPORT_C virtual void SetFocusToEditor(); |
|
361 |
|
362 /** |
|
363 * This method should be implemented in listbox classes to move the selection in |
|
364 * listbox editors prior to exiting from the setting page. It is called on a |
|
365 * CAknSettingPage* reference, and is therefore declared here. |
|
366 */ |
|
367 IMPORT_C virtual void SelectCurrentItemL(); |
|
368 |
|
369 /** |
|
370 * Protected non-virtual base method for construction. Only thing required to do in this class is |
|
371 * call the ConstructFromResourceL routine and set the flag that says construction has occured |
|
372 * |
|
373 */ |
|
374 IMPORT_C void BaseConstructL(); |
|
375 |
|
376 /** |
|
377 * Called to remove the setting page. Should not be called except from within re-implemented |
|
378 * AttemptExitL |
|
379 * |
|
380 * @param aAccept ETrue to accept the current value; EFalse otherwise |
|
381 */ |
|
382 IMPORT_C void DismissL( TBool aAccept ); |
|
383 |
|
384 /** |
|
385 * This is used as a protected access function for the state of the menu bar |
|
386 * |
|
387 * @return TBool ETrue if the menu is currently showing |
|
388 */ |
|
389 IMPORT_C TBool MenuShowing() const ; |
|
390 |
|
391 /** |
|
392 * This constructs the control based upon the id passed |
|
393 * |
|
394 */ |
|
395 IMPORT_C void ConstructFromResourceL( TInt aResourceId); |
|
396 |
|
397 /** |
|
398 * This constructs the control based upon a constructed and positioned reader |
|
399 * |
|
400 */ |
|
401 IMPORT_C void ConstructFromResourceL(TResourceReader& aRes); |
|
402 |
|
403 /** |
|
404 * Called when the user accepts or cancels the setting. Default implementation |
|
405 * sets the return value and exists. |
|
406 * |
|
407 * Re-implementations must call DismissL and StopActiveScheduler() if the setting is |
|
408 * to leave. |
|
409 * |
|
410 * @param aAccept ETrue if the user accepted. EFalse if the user cancelled. |
|
411 */ |
|
412 IMPORT_C void AttemptExitL(TBool aAccept); |
|
413 /** |
|
414 * Method to determine the current running state of the setting page's |
|
415 * ActiveScheduler level. |
|
416 * |
|
417 * @return EFalse only if the CActiveSheduler level is not running |
|
418 */ |
|
419 IMPORT_C TBool Waiting(); |
|
420 |
|
421 /** |
|
422 * Access method to the Command button array |
|
423 * |
|
424 * Must be called after full construction, or null reference will be returned. |
|
425 * |
|
426 * @return CEikButtonGroupContainer* a pointer to the cba owned by the setting page |
|
427 */ |
|
428 IMPORT_C CEikButtonGroupContainer* Cba() const ; |
|
429 |
|
430 /** |
|
431 * This is used to access the default resource id for the cba - the one used when |
|
432 * data is valid. |
|
433 * |
|
434 * @return TInt the default resource Id |
|
435 */ |
|
436 IMPORT_C TInt DefaultCbaResourceId() const; |
|
437 |
|
438 /** |
|
439 * This routine routes the keys to the editor. |
|
440 * However, if the menu is showing, then events are sent to the menu. |
|
441 * |
|
442 * @param aKeyEvent event information |
|
443 * @param aType type of event being handled |
|
444 * |
|
445 */ |
|
446 IMPORT_C TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType); |
|
447 |
|
448 /** |
|
449 * This routine is the base layout for CAknSettingPage. It lays out the labels and configures |
|
450 * the drawing in general. |
|
451 */ |
|
452 IMPORT_C void StandardSettingPageLayout(); |
|
453 |
|
454 /** |
|
455 * This method can be used to test if BaseConstructL() has been called yet |
|
456 * successfully |
|
457 * |
|
458 * @return TBool ETrue if BaseContructL has been called (and not left) |
|
459 */ |
|
460 IMPORT_C TBool IsBaseConstructed(); |
|
461 |
|
462 /** |
|
463 * Access method for the internally held resource Id |
|
464 * |
|
465 */ |
|
466 IMPORT_C TInt SettingPageResourceId(); |
|
467 /** |
|
468 * Perform the drawing of coded within CAknSettingPage |
|
469 * |
|
470 */ |
|
471 IMPORT_C void BaseDraw(const TRect& aRect) const; |
|
472 |
|
473 /** |
|
474 * Set default construction values of internal state |
|
475 */ |
|
476 IMPORT_C void ResetFlags(); |
|
477 |
|
478 /** |
|
479 * Framework method called as soon as the setting page is displayed, but before the new active sheduler level |
|
480 * is started. Returning EFalse will dismiss the setting page right away |
|
481 * |
|
482 * @return TBool ETrue if the setting page is to continue |
|
483 */ |
|
484 IMPORT_C virtual TBool PostDisplayCheckL(); |
|
485 |
|
486 /** |
|
487 * This framework method is used to update the contents of the CBA in a custom way. |
|
488 * Some setting page classes implement a degree of validation and will implement this. |
|
489 * Derived classes should ensure that this is being called frequently enough for their |
|
490 * purposes. |
|
491 */ |
|
492 IMPORT_C virtual void UpdateCbaL(); |
|
493 |
|
494 /** |
|
495 * Called to access the validity state of the data |
|
496 * |
|
497 * @return TBool ETRrue if the data is valid |
|
498 */ |
|
499 IMPORT_C TBool DataValidity() const; |
|
500 |
|
501 /** |
|
502 * used to set the validity of the data |
|
503 * |
|
504 * @param TBool aValid Sets the validity true or false |
|
505 */ |
|
506 IMPORT_C void SetDataValidity(TBool aValid); |
|
507 |
|
508 /** |
|
509 * Framework method to set the validity of the data |
|
510 * This is called when the data changes. |
|
511 * |
|
512 */ |
|
513 IMPORT_C virtual void CheckAndSetDataValidity(); |
|
514 |
|
515 /** |
|
516 * Method to be called by CAknSettingPage descendents when they have laid themselves out. |
|
517 * This tells the base class how big the layout spec rectangle hosting the editor is. |
|
518 * The second rectangle is the size of the area that the base class does not have to |
|
519 * draw to for skins. Usually, this is the area actually inhabited by the editor control. |
|
520 * |
|
521 * Coordinates are to be given in pixels relative to the main_pane. |
|
522 * |
|
523 * @param aFrameRect Layout rectangle in which to host the editor. |
|
524 * @param aRealEditorRect Layout rectangle actually occupied by the editor control |
|
525 * |
|
526 * @since 2.0 |
|
527 */ |
|
528 void SetEditedItemLayoutRect( const TRect& aFrameRect, const TRect& aRealEditorRect); |
|
529 |
|
530 /** |
|
531 * Method to cause this class to construct a control context or type and IID, selected according to |
|
532 * the value of enumeration TEditedItemSkinClass, set its coordinate system |
|
533 * |
|
534 * This must be called after a call to SetEditedItemLayoutRect has been made on CAknSettingPage. |
|
535 * This is becasue this routine must set the control context's origin to the top left of the value |
|
536 * given to SetEditedItemLayoutRect. Since SetEditeItemLayoutRect is to be called in a SizeChanged |
|
537 * method, this means that the this should be called after the SizeChanged in the child class. |
|
538 |
|
539 * @param aClass enumeration specifying which class of editor (according to LAF spec) is being |
|
540 * constructed. |
|
541 * @param aParentAbsolute ETrue if there is an intervening Window between CAknSettingPage's window |
|
542 * and any control that is to draw skin items with this component. |
|
543 * |
|
544 * since 2.0 |
|
545 * |
|
546 */ |
|
547 void CreateEditedItemControlContextL( TEditedItemSkinClass aSkinClass, TBool aParentAbsolute); |
|
548 |
|
549 /** |
|
550 * Indicates whether skin system will be able to draw the editor frame and background |
|
551 * |
|
552 * @return TBool ETrue iff the drawing of the edited item frame is going to be handled by |
|
553 * the base CAknSettingPage class itself using Skins |
|
554 * @since 2.0 |
|
555 */ |
|
556 TBool IsSkinsHandlingEditorFrameDrawing() const; |
|
557 |
|
558 /** |
|
559 * Control context for providing to the skinning for the hosted editor and its framing |
|
560 * |
|
561 * @return A valid control context for frame drawing for a hosted editor or NULL |
|
562 * @since 2.0 |
|
563 */ |
|
564 CAknsFrameBackgroundControlContext* EditedItemControlContext() const; |
|
565 |
|
566 |
|
567 protected: |
|
568 /** |
|
569 * From MEikMenuObserver |
|
570 * Called when menu is cancelled. |
|
571 */ |
|
572 IMPORT_C virtual void SetEmphasis(CCoeControl* /*aMenuControl*/,TBool aEmphasis); |
|
573 |
|
574 /** |
|
575 * From MEikMenuObserver |
|
576 * This function intializes the items on the menu. It is used to disable and enable menu items and may be |
|
577 * over ridden to add new ones. |
|
578 * In addition it adds menu items which have been provided in the ConstructL in the form of a Menu Bar resource. |
|
579 * Instead of using the Menu Bar directly it extracts the menu panes and adds them to its own menu pane. |
|
580 * It must be called in the DynInitMenuPaneL() function of any derived class before anything else. |
|
581 */ |
|
582 IMPORT_C virtual void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); |
|
583 |
|
584 public: // From CCoeControl |
|
585 /** |
|
586 * Handles a change to the control's resources of type aType |
|
587 * which are shared across the environment, e.g. colors or fonts. |
|
588 * |
|
589 * @since 2.0 |
|
590 * @param aType Reason for the "resource" change, usually an system event UID |
|
591 */ |
|
592 IMPORT_C void HandleResourceChange(TInt aType); |
|
593 /** |
|
594 * Standard CCoeControl routine to return the number of componentn controls |
|
595 * |
|
596 * @param aIndex index at which to return control |
|
597 */ |
|
598 IMPORT_C TInt CountComponentControls() const; |
|
599 |
|
600 /** |
|
601 * Standard CCoeControl routine to return the control at a given index |
|
602 * |
|
603 * @param aIndex index at which to return control |
|
604 */ |
|
605 |
|
606 IMPORT_C CCoeControl* ComponentControl(TInt anIndex) const; |
|
607 |
|
608 /** |
|
609 * Handles pointer events |
|
610 */ |
|
611 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
612 /** |
|
613 * From CCoeControl. |
|
614 * Gets the control's input capabilities. |
|
615 * |
|
616 * @return The control's input capabilities. |
|
617 */ |
|
618 IMPORT_C TCoeInputCapabilities InputCapabilities() const; |
|
619 |
|
620 private: |
|
621 IMPORT_C virtual void Reserved_MtsmPosition(); |
|
622 IMPORT_C virtual void Reserved_MtsmObject(); |
|
623 |
|
624 protected: |
|
625 /** |
|
626 * Access method for the softkey resource used when there is invalid data |
|
627 * |
|
628 * @return TInt The resource Id of the softkey bindings. |
|
629 */ |
|
630 IMPORT_C TInt InvalidDataCbaResourceId() const; |
|
631 |
|
632 protected: // from MObjectProvider |
|
633 IMPORT_C TTypeUid::Ptr MopSupplyObject(TTypeUid aId); |
|
634 |
|
635 protected: |
|
636 /** |
|
637 * Hold the update mode passed in the constructor |
|
638 */ |
|
639 TInt iUpdateMode; |
|
640 |
|
641 // The following are not owned: |
|
642 |
|
643 /** |
|
644 * Pointer to setting page observer; may be NULL |
|
645 */ |
|
646 MAknSettingPageObserver* iSettingPageObserver; |
|
647 |
|
648 private: |
|
649 //From CCoeControl |
|
650 IMPORT_C void Draw(const TRect& aRect) const; |
|
651 |
|
652 private: |
|
653 /** |
|
654 * From CAknControl |
|
655 */ |
|
656 IMPORT_C void* ExtensionInterface( TUid aInterface ); |
|
657 |
|
658 protected: |
|
659 |
|
660 /** |
|
661 * Writes the internal state of the control and its components to aStream. |
|
662 * Does nothing in release mode. |
|
663 * Designed to be overidden and base called by subclasses. |
|
664 * |
|
665 * @param aWriteSteam A connected write stream |
|
666 */ |
|
667 IMPORT_C virtual void WriteInternalStateL(RWriteStream& aWriteStream) const; |
|
668 |
|
669 private: |
|
670 /** |
|
671 * Reserved method derived from CCoeControl |
|
672 */ |
|
673 IMPORT_C virtual void Reserved_2(); |
|
674 |
|
675 /** |
|
676 * Activate another level on the active scheduler |
|
677 */ |
|
678 void StartActiveScheduler(); |
|
679 /** |
|
680 * Stop current (additional) level on the active scheduler |
|
681 */ |
|
682 void StopActiveScheduler(); |
|
683 |
|
684 /** |
|
685 * Pop the navidecorator. The iNaviPane is used as a flag to show if popping is required to |
|
686 * be done or not. It is zeroed by this method. |
|
687 * |
|
688 */ |
|
689 void PopNaviDecoratorIfRequired(); |
|
690 |
|
691 private: |
|
692 |
|
693 /** |
|
694 * New reserved methods for CAknSettingPage hierarchy |
|
695 */ |
|
696 private: |
|
697 IMPORT_C virtual void CAknSettingPage_Reserved_1(); |
|
698 IMPORT_C virtual void CAknSettingPage_Reserved_2(); |
|
699 |
|
700 protected: |
|
701 /** |
|
702 * Enables / disables transparency effect, i.e. does the setting page draw its own background or not. |
|
703 * @param aDrawBackground EFalse enables transparency |
|
704 */ |
|
705 void SetDrawBackground(const TBool aDrawBackground); |
|
706 |
|
707 /** |
|
708 * Is the setting page drawing the background itself or not (= "transparency") |
|
709 */ |
|
710 TBool IsBackgroundDrawingEnabled() const; |
|
711 /** |
|
712 * Set the flag to indicate that if the function CAknSettingPage::StopActiveScheduler called or not |
|
713 *@param aStopCalled ETrue means the StopActiveScheduler is called. |
|
714 */ |
|
715 void SetStopActiveSchedulerFlag(const TBool aStopCalled ); |
|
716 |
|
717 /** |
|
718 * Is the setting page call the StopActiveScheduler or not |
|
719 */ |
|
720 TBool IsStopActiveSchudlerCalled()const; |
|
721 |
|
722 /** |
|
723 * Pointer to setting text label |
|
724 * @return pointer to the label |
|
725 * |
|
726 * @since 5.0 |
|
727 */ |
|
728 IMPORT_C CEikLabel* TextLabel() const; |
|
729 |
|
730 /** |
|
731 * Pointer to shadow text label |
|
732 * @return pointer to the label |
|
733 * |
|
734 * @since 5.0 |
|
735 */ |
|
736 IMPORT_C CEikLabel* ShadowText() const; |
|
737 |
|
738 private: |
|
739 /** |
|
740 * This member points to the setting title text that is passed as part of its more complicated constructor. |
|
741 * The descriptor pointed to is not owned, and therefor must be preserved in the client, at least until the |
|
742 * 2nd stage construction is performed (inside ExecuteLD). |
|
743 * |
|
744 * Since, however, setting pages are all waiting, the descriptor can usually be on the stack in the client. |
|
745 * |
|
746 */ |
|
747 const TDesC* iSettingTextFromConstructor; |
|
748 TInt iResourceId; |
|
749 |
|
750 TInt iSettingNumber; |
|
751 TInt iSettingId; |
|
752 TInt iMenuBarId; |
|
753 TInt iControlType; |
|
754 TInt iEditorResourceId; |
|
755 TInt iExtensionId; |
|
756 TInt iCbaResourceId; |
|
757 |
|
758 TAknLayoutRect iShadow; |
|
759 TAknLayoutRect iHighlight; |
|
760 |
|
761 // pointer to the return value from the setting page. |
|
762 // Needed when presented in waiting mode. |
|
763 TBool* iReturn; |
|
764 |
|
765 // Internal flags |
|
766 TBitFlags iFlags ; |
|
767 |
|
768 enum TFlagIndices |
|
769 { |
|
770 EMenuShowingIndex = 0, |
|
771 ENumberedStyleIndex, |
|
772 EIsBaseConstructedIndex, |
|
773 EHasValidDataIndex |
|
774 }; |
|
775 |
|
776 // Heap objects pointed to here are owned: |
|
777 CCoeControl* iEditorControl; |
|
778 CEikLabel* iNumberLabel; |
|
779 CEikLabel* iTextLabel; |
|
780 CEikButtonGroupContainer* iCba; |
|
781 CEikMenuBar* iMenuBar ; |
|
782 HBufC* iHintText; |
|
783 HBufC* iSettingText; |
|
784 CAknNavigationDecorator* iNaviDecorator; |
|
785 |
|
786 // The following are not owned: |
|
787 // For hint text support |
|
788 CAknNavigationControlContainer* iNaviPane; |
|
789 |
|
790 // Softkey resource when the data is invalid |
|
791 TInt iInvalidDataCbaResourceId; |
|
792 |
|
793 // The following object is used to contain all skinning information required |
|
794 CAknSettingPageSkinsInfo* iSkinsInfo; |
|
795 |
|
796 CActiveSchedulerWait iWait; // owned, safe to use as direct member data. |
|
797 |
|
798 // is setting page editable |
|
799 TInt iIsProtected; |
|
800 |
|
801 // extension to setting page |
|
802 CAknSettingPageExtension* iExtension; |
|
803 }; |
|
804 |
|
805 #endif |