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