classicui_pub/setting_pages_api/inc/AknSettingPage.h
branchRCL_3
changeset 56 d48ab3b357f1
parent 0 2f259fa3e83a
equal deleted inserted replaced
55:aecbbf00d063 56:d48ab3b357f1
       
     1 /*
       
     2 * Copyright (c) 2002-2009 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: 
       
    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  /**
       
   267  * Calculates and returns setting item content rect.
       
   268  *
       
   269  * @param  aScrollBarUsed  @c ETrue if the setting page content should have
       
   270  *                         scrollbar, @c EFalse otherwise.
       
   271  *
       
   272  * @internal
       
   273  * @since 5.2
       
   274  * @return Setting item content rectangle. 
       
   275  */
       
   276  TRect SettingItemContentRect( TBool aScrollBarUsed );
       
   277 
       
   278  /**
       
   279  * Is the setting page drawing the background itself or not (= "transparency")
       
   280  */ 
       
   281  TBool IsBackgroundDrawingEnabled() const;
       
   282 
       
   283 /**
       
   284 * Access method to the Command button array
       
   285 *
       
   286 * Must be called after full construction, or null reference will be returned.
       
   287 *
       
   288 * @return CEikButtonGroupContainer* a pointer to the cba owned by the setting page
       
   289 */
       
   290     IMPORT_C CEikButtonGroupContainer* Cba() const ;
       
   291 
       
   292 protected:
       
   293 
       
   294 /**
       
   295 * From CCoeControl
       
   296 * This routine is called as part of the set-up of the control.	It is the place to put
       
   297 * layout code. 
       
   298 *
       
   299 */
       
   300 	IMPORT_C virtual void SizeChanged();
       
   301 
       
   302 
       
   303 /**
       
   304 * From CCoeControl
       
   305 * Takes any action required when the control gains or loses focus e.g. to change its appearance.
       
   306 * The control should be redrawn depending on the value of aDrawNow. Empty by default.
       
   307 */
       
   308 	IMPORT_C virtual void FocusChanged(TDrawNow aDrawNow); 
       
   309 	
       
   310 /**
       
   311  * From MEikCommandObserver
       
   312  * Processes events from the softkeys. Responds to EAknSoftkeyOk and EAknSoftkeyBack
       
   313  * to accept or cancel the pop-up.
       
   314  *
       
   315  * @param	aCommandId	Event Id from the soft-key
       
   316  */
       
   317 	IMPORT_C virtual void ProcessCommandL(TInt aCommandId);
       
   318 
       
   319 /**
       
   320  * From MCoeControlObserver:
       
   321  * Acts upon changes in the hosted control's state. 
       
   322  * 
       
   323  * This class's implementation is trivial and should be able to be
       
   324  * safely re-implemented in directly client-derived classes. 
       
   325  * For non-base setting page classes, a call to the base class should be made
       
   326  *
       
   327  * @param	aControl	The control changing its state (not used)
       
   328  * @param	aEventType	The type of control event 
       
   329  */
       
   330 	IMPORT_C virtual void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType);
       
   331 
       
   332 //
       
   333 //
       
   334 // Framework functions. New in this class
       
   335 //
       
   336 //
       
   337 	/**
       
   338 	* Framework method to determine if it is OK to exit the setting page.
       
   339 	* Derived classes may check for valid data before allowing the dismissal of the 
       
   340 	* setting page.
       
   341 	*
       
   342 	* @param	aAccept ETrue if the user has indicated to accept the setting page; EFalse otherwise
       
   343 	* @return	TBool	a value indicating whether the setting page should be dismissed
       
   344 	*/
       
   345 	IMPORT_C virtual TBool OkToExitL(TBool aAccept);
       
   346 	
       
   347 /**
       
   348 * Called immediately prior to activation of the dialog.  Framework routine for derived
       
   349 * classes.
       
   350 *
       
   351 */
       
   352 	IMPORT_C virtual void DynamicInitL();
       
   353 
       
   354 /**
       
   355  * Called when something has changed and the client's object needs to have its value updated
       
   356  *
       
   357  */
       
   358 	IMPORT_C virtual void UpdateSettingL();
       
   359 
       
   360 /**
       
   361  * Called when the user accepts a setting and the setting page is about to be dismissed.  The latest value of the
       
   362  * setting is written to the client's object
       
   363  */
       
   364 	IMPORT_C virtual void AcceptSettingL();
       
   365 
       
   366 /**
       
   367  * Called when the user rejects the setting.  A backup copy may need to be restored if UpdateWhenChanged flag was set
       
   368  *
       
   369  */
       
   370 	IMPORT_C virtual void RestoreOriginalSettingL();
       
   371 
       
   372 /** 
       
   373  * Display the menu
       
   374  */
       
   375 	IMPORT_C virtual void DisplayMenuL() ;
       
   376 
       
   377 /**
       
   378  * Hide the menu
       
   379  */
       
   380 	IMPORT_C virtual void HideMenu() ;
       
   381 
       
   382 /** 
       
   383  * Puts the focus back on the editor. For complicated setting pages that have focus removed from them
       
   384  * at some point, then a re-implementation may have to do some work here.
       
   385  */
       
   386 	IMPORT_C virtual void SetFocusToEditor();
       
   387 
       
   388 /**
       
   389  * This method should be implemented in listbox classes to move the selection in 
       
   390  * listbox editors prior to exiting from the setting page. It is called on a 
       
   391  * CAknSettingPage* reference, and is therefore declared here.
       
   392  */
       
   393 	IMPORT_C virtual void SelectCurrentItemL();
       
   394 
       
   395 /**
       
   396  * Protected non-virtual base method for construction.	Only thing required to do in this class is 
       
   397  * call the ConstructFromResourceL routine and set the flag that says construction has occured
       
   398  *
       
   399  */
       
   400 	IMPORT_C void BaseConstructL();
       
   401 
       
   402 /**
       
   403  * Called to remove the setting page. Should not be called except from within re-implemented
       
   404  * AttemptExitL
       
   405  *
       
   406  * @param	aAccept ETrue to accept the current value; EFalse otherwise
       
   407  */
       
   408 	IMPORT_C void DismissL( TBool aAccept );  
       
   409 
       
   410 /**
       
   411  * This is used as a protected access function for the state of the menu bar
       
   412  *
       
   413  * @return TBool	ETrue if the menu is currently showing 
       
   414  */
       
   415 	IMPORT_C TBool MenuShowing() const ;
       
   416 
       
   417 /** 
       
   418 * This constructs the control based upon the id passed
       
   419 *
       
   420 */
       
   421 	IMPORT_C void ConstructFromResourceL( TInt aResourceId);
       
   422 
       
   423 /** 
       
   424 * This constructs the control based upon a constructed and positioned reader
       
   425 *
       
   426 */
       
   427 	IMPORT_C void ConstructFromResourceL(TResourceReader& aRes);
       
   428 
       
   429  /**
       
   430  * Called when the user accepts or cancels the setting. Default implementation
       
   431  * sets the return value and exists. 
       
   432  * 
       
   433  * Re-implementations must call DismissL and StopActiveScheduler() if the setting is
       
   434  * to leave.
       
   435  *
       
   436  * @param	aAccept ETrue if the user accepted. EFalse if the user cancelled.
       
   437  */
       
   438 	IMPORT_C void AttemptExitL(TBool aAccept);
       
   439 /**
       
   440 * Method to determine the current running state of the setting page's 
       
   441 * ActiveScheduler level. 
       
   442 *
       
   443 * @return	EFalse only if the CActiveSheduler level is not running
       
   444 */
       
   445 	IMPORT_C TBool Waiting(); 
       
   446 
       
   447 /**
       
   448  * This is used to access the default resource id for the cba - the one used when 
       
   449  * data is valid.
       
   450  *
       
   451  * @return TInt 	the default resource Id 
       
   452  */
       
   453 	IMPORT_C TInt DefaultCbaResourceId() const; 
       
   454 
       
   455 /** 
       
   456 * This routine routes the keys to the editor. 
       
   457 * However, if the menu is showing, then events are sent to the menu. 
       
   458 *
       
   459 * @param	aKeyEvent	event information	
       
   460 * @param	aType		type of event being handled
       
   461 *
       
   462 */
       
   463 	IMPORT_C TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType);
       
   464 
       
   465 /**
       
   466 * This routine is the base layout for CAknSettingPage. It lays out the labels and configures
       
   467 * the drawing in general.
       
   468 */	
       
   469 	IMPORT_C void StandardSettingPageLayout();
       
   470 
       
   471 /**
       
   472  * This method can be used to test if BaseConstructL() has been called yet
       
   473  * successfully
       
   474  *
       
   475  * @return TBool	ETrue if BaseContructL has been called (and not left)
       
   476  */
       
   477 	IMPORT_C TBool IsBaseConstructed();
       
   478 
       
   479 /**
       
   480  * Access method for the internally held resource Id
       
   481  *
       
   482  */
       
   483 	IMPORT_C TInt SettingPageResourceId();
       
   484 /** 
       
   485 * Perform the drawing of coded within CAknSettingPage
       
   486 * 
       
   487 */
       
   488 	IMPORT_C void BaseDraw(const TRect& aRect) const;
       
   489 
       
   490 /**
       
   491 * Set default construction values of internal state
       
   492 */
       
   493 	IMPORT_C void ResetFlags();
       
   494 
       
   495 /**
       
   496  * Framework method called as soon as the setting page is displayed, but before the new active sheduler level
       
   497  * is started.	Returning EFalse will dismiss the setting page right away
       
   498  *
       
   499  * @return TBool	ETrue if the setting page is to continue
       
   500  */
       
   501 	IMPORT_C virtual TBool PostDisplayCheckL();
       
   502 
       
   503 /** 
       
   504  * This framework method is used to update the contents of the CBA in a custom way.
       
   505  * Some setting page classes implement a degree of validation and will implement this.
       
   506  * Derived classes should ensure that this is being called frequently enough for their
       
   507  * purposes.
       
   508  */
       
   509 	IMPORT_C virtual void UpdateCbaL();
       
   510 
       
   511 /**
       
   512  * Called to access the validity state of the data
       
   513  *
       
   514  * @return TBool ETRrue if the data is valid
       
   515  */
       
   516 	IMPORT_C TBool DataValidity() const;
       
   517 
       
   518 /**
       
   519  * used to set the validity of the data
       
   520  *
       
   521  * @param TBool aValid	Sets the validity true or false
       
   522  */
       
   523 	IMPORT_C void SetDataValidity(TBool aValid);
       
   524 
       
   525 /**
       
   526  * Framework method to set the validity of the data
       
   527  * This is called when the data changes.
       
   528  *
       
   529  */
       
   530 	IMPORT_C virtual void CheckAndSetDataValidity();
       
   531 
       
   532 	/**
       
   533      * Sets the outer and inner rectangle for the frame graphics that is drawn
       
   534 	 * around the setting item.
       
   535      *
       
   536      * @param  aOuterRect  Frame outer rectangle.
       
   537      * @param  aInnerRect  Frame inner rectangle.
       
   538      *
       
   539      * @since 5.2
       
   540      */
       
   541 	void SetEditedItemFrameRects( const TRect& aOuterRect,
       
   542                                   const TRect& aInnerRect );
       
   543 	
       
   544 	/**
       
   545      * Sets the skin item ID for the frame graphics that is drawn
       
   546      * around the setting item.
       
   547      *
       
   548      * @param  aFrameIID        Skin item ID of the frame graphics.
       
   549      * @param  aFrameCenterIID  Skin item ID of the center piece of the frame
       
   550      *                          graphics
       
   551      *
       
   552      * @since 5.2
       
   553      */
       
   554     void SetEditedItemFrameIID( const TAknsItemID& aFrameIID,
       
   555                                 const TAknsItemID& aFrameCenterIID );
       
   556     
       
   557     /**
       
   558      * Sets the rectangle for the editing state indicators.
       
   559      * Should only be called by setting pages that have an editor which
       
   560      * displays the editor indicators as the editor control.
       
   561      *
       
   562      * @param  aRect  Editor indicator rectangle.
       
   563      *
       
   564      * @since 5.2
       
   565      */
       
   566     void SetEditorIndicatorRect( const TRect& aRect );
       
   567 
       
   568  /**
       
   569  * Indicates whether skin system will be able to draw the editor frame and background
       
   570  *
       
   571  * @return TBool ETrue iff the drawing of the edited item frame is going to be handled by
       
   572  *					the base CAknSettingPage class itself using Skins
       
   573  * @since 2.0
       
   574  */
       
   575 	TBool IsSkinsHandlingEditorFrameDrawing() const;
       
   576 
       
   577  /**
       
   578  * Control context for providing to the skinning for the hosted editor and its framing
       
   579  *
       
   580  * @return      A valid control context for frame drawing for a hosted editor or NULL
       
   581  * @since 2.0
       
   582  */ 
       
   583     CAknsFrameBackgroundControlContext* EditedItemControlContext() const;
       
   584 
       
   585 	/**
       
   586      * Performs base construction and takes possible flags into account.
       
   587      *
       
   588      * @param  aFlags Construction flags
       
   589      *
       
   590      * @since 5.2
       
   591      */
       
   592     void BaseConstructL( TUint aFlags );
       
   593     
       
   594     /** 
       
   595      * Stop current (additional) level on the active scheduler.
       
   596      */ 
       
   597 	void StopActiveScheduler();
       
   598 
       
   599 protected:
       
   600  /**
       
   601  * From MEikMenuObserver 
       
   602  * Called when menu is cancelled.
       
   603  */
       
   604 	IMPORT_C virtual void SetEmphasis(CCoeControl* /*aMenuControl*/,TBool aEmphasis);
       
   605 
       
   606  /**
       
   607  * From MEikMenuObserver 
       
   608  * This function intializes the items on the menu. It is used to disable and enable menu items and may be
       
   609  * over ridden to add new ones.
       
   610  * In addition it adds menu items which have been provided in the ConstructL in the form of a Menu Bar resource.
       
   611  * Instead of using the Menu Bar directly it extracts the menu panes and adds them to its own menu pane.
       
   612  * It must be called in the DynInitMenuPaneL() function of any derived class before anything else.
       
   613  */
       
   614 	IMPORT_C virtual void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); 
       
   615 
       
   616 public: // From CCoeControl
       
   617  /**
       
   618  * Handles a change to the control's resources of type aType
       
   619  * which are shared across the environment, e.g. colors or fonts.
       
   620  *
       
   621  * @since 2.0
       
   622  * @param aType  Reason for the "resource" change, usually an system event UID
       
   623  */
       
   624     IMPORT_C void HandleResourceChange(TInt aType);
       
   625 /**
       
   626  * Standard CCoeControl routine to return the number of componentn controls
       
   627  *
       
   628  * @param	aIndex	index at which to return control
       
   629  */
       
   630 	IMPORT_C TInt CountComponentControls() const;
       
   631 
       
   632 /**
       
   633  * Standard CCoeControl routine to return the control at a given index
       
   634  *
       
   635  * @param	aIndex	index at which to return control
       
   636  */ 
       
   637 
       
   638 	IMPORT_C CCoeControl* ComponentControl(TInt anIndex) const;
       
   639 
       
   640  /**
       
   641  * Handles pointer events
       
   642  */
       
   643     IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
       
   644  /**
       
   645  * From CCoeControl.
       
   646  * Gets the control's input capabilities.
       
   647  *
       
   648  * @return The control's input capabilities.
       
   649  */   
       
   650 	IMPORT_C TCoeInputCapabilities InputCapabilities() const;
       
   651 	
       
   652 private:
       
   653 	IMPORT_C virtual void Reserved_MtsmPosition();
       
   654 	IMPORT_C virtual void Reserved_MtsmObject();
       
   655 
       
   656 protected:
       
   657 /** 
       
   658 *	Access method for the softkey resource used when there is invalid data
       
   659 *
       
   660 * @return TInt The resource Id of the softkey bindings. 
       
   661 */
       
   662 	IMPORT_C TInt InvalidDataCbaResourceId() const; 
       
   663 
       
   664 protected: // from MObjectProvider
       
   665 	IMPORT_C TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
       
   666 
       
   667 protected:
       
   668 	/**
       
   669 	* Hold the update mode passed in the constructor
       
   670 	*/
       
   671 	TInt iUpdateMode;
       
   672 
       
   673 	// The following are not owned:
       
   674 
       
   675 	/**
       
   676 	* Pointer to setting page observer; may be NULL
       
   677 	*/
       
   678 	MAknSettingPageObserver* iSettingPageObserver;
       
   679 
       
   680 private:
       
   681 	//From CCoeControl
       
   682 	IMPORT_C void Draw(const TRect& aRect) const;
       
   683 	
       
   684 private:
       
   685     /**
       
   686     * From CAknControl
       
   687     */
       
   688     IMPORT_C void* ExtensionInterface( TUid aInterface );
       
   689 
       
   690 protected:
       
   691 
       
   692 /**
       
   693  * Writes the internal state of the control and its components to aStream.
       
   694  * Does nothing in release mode.
       
   695  * Designed to be overidden and base called by subclasses.
       
   696  *
       
   697  * @param	aWriteSteam		A connected write stream
       
   698  */	
       
   699 	IMPORT_C virtual void WriteInternalStateL(RWriteStream& aWriteStream) const;
       
   700 
       
   701 private:
       
   702 /**
       
   703 *	Reserved method derived from CCoeControl
       
   704 */
       
   705 	IMPORT_C virtual void Reserved_2();
       
   706 
       
   707  /** 
       
   708  * Activate another level on the active scheduler
       
   709  */ 
       
   710 	void StartActiveScheduler();
       
   711 
       
   712 /**
       
   713 * Pop the navidecorator. The iNaviPane is used as a flag to show if popping is required to 
       
   714 * be done or not. It is zeroed by this method.
       
   715 *
       
   716 */
       
   717 	void PopNaviDecoratorIfRequired();
       
   718 
       
   719 private:
       
   720 
       
   721 /**
       
   722 * New reserved methods for CAknSettingPage hierarchy
       
   723 */ 
       
   724 private: 
       
   725 	IMPORT_C virtual void CAknSettingPage_Reserved_1();
       
   726 	IMPORT_C virtual void CAknSettingPage_Reserved_2();
       
   727 
       
   728 protected:
       
   729     /**
       
   730     * Enables / disables transparency effect, i.e. does the setting page draw its own background or not.
       
   731     * @param aDrawBackground  EFalse enables transparency
       
   732     */ 
       
   733     void SetDrawBackground(const TBool aDrawBackground);    
       
   734 
       
   735     /**
       
   736     * Set the flag to indicate that if the function CAknSettingPage::StopActiveScheduler called or not
       
   737     *@param aStopCalled ETrue means the StopActiveScheduler is called.
       
   738     */
       
   739     void SetStopActiveSchedulerFlag(const TBool aStopCalled );
       
   740 
       
   741     /**
       
   742      * Is the setting page call the StopActiveScheduler or not 
       
   743      */ 
       
   744     TBool IsStopActiveSchudlerCalled()const;
       
   745 
       
   746     /**
       
   747     * Pointer to setting text label
       
   748     * @return pointer to the label
       
   749     *
       
   750 	* @since 5.0
       
   751     */    
       
   752     IMPORT_C CEikLabel* TextLabel() const;
       
   753     
       
   754     /**
       
   755     * Pointer to shadow text label
       
   756     * @return pointer to the label
       
   757     *
       
   758 	* @since 5.0
       
   759     */    
       
   760     IMPORT_C CEikLabel* ShadowText() const;
       
   761 
       
   762 private:
       
   763 /** 
       
   764 * This member points to the setting title text that is passed as part of its more complicated constructor.
       
   765 * The descriptor pointed to is not owned, and therefor must be preserved in the client, at least until the 
       
   766 * 2nd stage construction is performed (inside ExecuteLD). 
       
   767 *
       
   768 * Since, however, setting pages are all waiting, the descriptor can usually be on the stack in the client.
       
   769 *
       
   770 */
       
   771 	const TDesC* iSettingTextFromConstructor;
       
   772 	TInt iResourceId;
       
   773 
       
   774 	TInt iSettingNumber;
       
   775 	TInt iSettingId;
       
   776 	TInt iMenuBarId;
       
   777 	TInt iControlType;
       
   778 	TInt iEditorResourceId;
       
   779 	TInt iExtensionId;
       
   780 	TInt iCbaResourceId;
       
   781 
       
   782 	TAknLayoutRect iShadow;
       
   783 	TAknLayoutRect iHighlight;
       
   784 
       
   785 // pointer to the return value from the setting page.  
       
   786 // Needed when presented in waiting mode.  
       
   787 	TBool* iReturn; 
       
   788 	
       
   789 // Internal flags
       
   790 	TBitFlags iFlags ;
       
   791 
       
   792 	enum TFlagIndices
       
   793 		{
       
   794 		EMenuShowingIndex = 0,
       
   795 		ENumberedStyleIndex,
       
   796 		EIsBaseConstructedIndex,
       
   797 		EHasValidDataIndex
       
   798 		};
       
   799 
       
   800 // Heap objects pointed to here are owned:
       
   801 	CCoeControl* iEditorControl;
       
   802 	CEikLabel* iNumberLabel;
       
   803 	CEikLabel* iTextLabel;
       
   804 	CEikButtonGroupContainer* iCba;
       
   805 	CEikMenuBar* iMenuBar ;
       
   806 	HBufC* iHintText;
       
   807 	HBufC* iSettingText; 
       
   808 	CAknNavigationDecorator* iNaviDecorator;
       
   809 
       
   810 	// The following are not owned:
       
   811 	// For hint text support
       
   812 	CAknNavigationControlContainer* iNaviPane;
       
   813 
       
   814 	// Softkey resource when the data is invalid
       
   815 	TInt iInvalidDataCbaResourceId;
       
   816 	
       
   817 	// The following object is used to contain all skinning information required
       
   818 	CAknSettingPageSkinsInfo* iSkinsInfo;
       
   819 
       
   820 	CActiveSchedulerWait iWait;		// owned, safe to use as direct member data.
       
   821 
       
   822     // is setting page editable
       
   823     TInt iIsProtected;
       
   824     
       
   825     // extension to setting page
       
   826     CAknSettingPageExtension* iExtension;
       
   827 };
       
   828 
       
   829 #endif