epoc32/include/mw/akntextsettingpage.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@2
     2
* Copyright (c) 2002 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
*     Interface for Setting page carrying CEikEdwin editors
williamr@2
    16
*		- CAknTextSettingPage: 6 line text editor
williamr@2
    17
*		- CAknIntegerSettingPage: 1 line integer editor
williamr@2
    18
*
williamr@2
    19
*
williamr@2
    20
*/
williamr@2
    21
williamr@2
    22
williamr@2
    23
#ifndef __AKNTEXTSETTINGPAGE_H__
williamr@2
    24
#define __AKNTEXTSETTINGPAGE_H__ 
williamr@2
    25
williamr@2
    26
// For coecontrol and its observer
williamr@2
    27
#include <coecntrl.h>
williamr@2
    28
#include <coecobs.h>
williamr@2
    29
williamr@2
    30
#include <eikdef.h>
williamr@2
    31
#include <eikedwin.h>
williamr@2
    32
#include "aknsettingpage.h"
williamr@2
    33
#include "aknnumedwin.h"
williamr@2
    34
williamr@2
    35
/**
williamr@2
    36
* This class is an intermediate pure virtual class for all setting page classes that host 
williamr@2
    37
* Edwins.
williamr@2
    38
*
williamr@2
    39
* It implements type-specific access to the hosted editor and common drawing code
williamr@2
    40
*/
williamr@2
    41
class CAknEdwinSettingPage : public CAknSettingPage
williamr@2
    42
{
williamr@2
    43
williamr@2
    44
public:
williamr@2
    45
williamr@2
    46
	/**
williamr@2
    47
	*	Common access to the edwin for descendant classes
williamr@2
    48
	*
williamr@2
    49
	* @return Pointer to contained edwin control
williamr@2
    50
	*/
williamr@2
    51
	IMPORT_C CEikEdwin* TextControl();
williamr@2
    52
williamr@2
    53
    /**
williamr@2
    54
    * From CCoeControl.     
williamr@2
    55
    * Handles pointer events
williamr@2
    56
    */
williamr@2
    57
    IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
williamr@2
    58
williamr@2
    59
protected:
williamr@2
    60
	/**
williamr@2
    61
	 * Simple constructor depending only on a single resource Id.
williamr@2
    62
	 *
williamr@2
    63
	 * @param aSettingPageResourceId	Setting Page resource id to use 
williamr@2
    64
	 */
williamr@2
    65
	IMPORT_C CAknEdwinSettingPage( TInt ResourceId );
williamr@2
    66
	/**
williamr@2
    67
	 * Constructor that allows separate setting page and editor resources
williamr@2
    68
	 * 
williamr@2
    69
	 * This constructor allows the use of setting page using only the editor resource.  Other combinations are also possible
williamr@2
    70
	 *
williamr@2
    71
	 * In all cases the number (if supplied i.e. <> 0 ) is used.  
williamr@2
    72
	 *
williamr@2
    73
	 *		Editor Resource		Setting Page Resource
williamr@2
    74
	 *			present					present				Both are used (but text & number overridden)
williamr@2
    75
	 *			 = 0					present				Editor resource is used via SP resource (Effectively like the other constructor)
williamr@2
    76
	 *			present					= 0					Default Avkon SP resource if used + this editor resource
williamr@2
    77
	 *			 = 0					= 0					uses default resource for both SP and editor. This is OK if:
williamr@2
    78
	 *	 i) control type is present, 
williamr@2
    79
	 *  ii) a default resource exists ( OK for text, integer, date, time, duration )
williamr@2
    80
	 *
williamr@2
    81
	 * Note: THe first argument is a TDesC* (rather than TDesC&) because the other constructor
williamr@2
    82
	 * cannot initialize such a member without allocation or having an internal dummy buffer.  
williamr@2
    83
	 * Note that this buffer must be owned by the client until ExecuteLD has been called.
williamr@2
    84
	 *
williamr@2
    85
	 * Rules for text and numbers: The rules are the same for both:  (non-zero length) text or number other 
williamr@2
    86
	 * than EAknSettingPageNoOrdinalDisplayed if given in this constructor will not override resource 
williamr@2
    87
	 * (unless that is zero length or EAknSettingPageNoOrdinalDisplayed).  Note, however, that text or number given via the 
williamr@2
    88
	 * specific API for setting them, WILL override resource.
williamr@2
    89
	 * It is assumed that number from resource is very rare.  Special text is somewhat more likely.
williamr@2
    90
	 * 
williamr@2
    91
	 * @param aSettingTitleText	Text at top of setting pane; EXTERNALLY OWNED
williamr@2
    92
	 * @param aSettingNumber		Number at top left (if present)
williamr@2
    93
	 * @param aControlType			Determines the type constructed and how its resource is read
williamr@2
    94
	 * @param aEditorResourceId	Editor resource to use in the setting page (if present)
williamr@2
    95
	 * @param aSettingPageResourceId		Setting Page to use (if present)
williamr@2
    96
	 */
williamr@2
    97
williamr@2
    98
	IMPORT_C CAknEdwinSettingPage(
williamr@2
    99
								const TDesC* aSettingTitleText, 
williamr@2
   100
								TInt aSettingNumber, 
williamr@2
   101
								TInt aControlType,
williamr@2
   102
								TInt aEditorResourceId, 
williamr@2
   103
								TInt aSettingPageResourceId );
williamr@2
   104
williamr@2
   105
//
williamr@2
   106
// From CCoeControl
williamr@2
   107
//
williamr@2
   108
protected:
williamr@2
   109
	/**
williamr@2
   110
	* No implementation of SizeChanged is delivered with this class
williamr@2
   111
	*
williamr@2
   112
	*/
williamr@2
   113
	virtual void SizeChanged() = 0;
williamr@2
   114
williamr@2
   115
	/**
williamr@2
   116
	* Common draw function for laid-out descendent setting pages. 
williamr@2
   117
	* This should not need to be re-implemented as long as the rectangle members are
williamr@2
   118
	* all that is needed
williamr@2
   119
	*
williamr@2
   120
	* @param	aRect	rectangle within which to perform the draw
williamr@2
   121
	*/
williamr@2
   122
	IMPORT_C void Draw(const TRect& aRect) const;
williamr@2
   123
williamr@2
   124
private:
williamr@2
   125
    /**
williamr@2
   126
    * From CAknControl
williamr@2
   127
    */
williamr@2
   128
    IMPORT_C void* ExtensionInterface( TUid aInterface );
williamr@2
   129
williamr@2
   130
private:
williamr@2
   131
/**
williamr@2
   132
 * New reserved method with this class
williamr@2
   133
 *
williamr@2
   134
 */
williamr@2
   135
	IMPORT_C virtual void CAknEdwinSettingPage_Reserved_1();
williamr@2
   136
williamr@2
   137
protected:
williamr@2
   138
	/**
williamr@2
   139
	* Rectangle within which to layout the edwin. Not drawn
williamr@2
   140
	*/
williamr@2
   141
	TAknLayoutRect iEdwinLayoutRect;
williamr@2
   142
williamr@2
   143
	/**
williamr@2
   144
	* Horizontal shadow rectangle
williamr@2
   145
	*/
williamr@2
   146
	TAknLayoutRect iHorizontalShadow;
williamr@2
   147
	
williamr@2
   148
	/**
williamr@2
   149
	* Vertical shadow rectangle
williamr@2
   150
	*/
williamr@2
   151
	TAknLayoutRect iVerticalShadow;
williamr@2
   152
williamr@2
   153
	/**
williamr@2
   154
	* Rectangle drawn around the edwin
williamr@2
   155
	*/
williamr@2
   156
	TAknLayoutRect iOutlineFrame;
williamr@2
   157
williamr@2
   158
private:
williamr@2
   159
    TInt iSpare;
williamr@2
   160
};
williamr@2
   161
williamr@2
   162
/**
williamr@2
   163
* Implementation of the 6 line textual setting page. 
williamr@2
   164
* A multi-line edwin is displayed when the setting page is executing.
williamr@2
   165
* An externally held text descriptor is altered by user input
williamr@2
   166
*/
williamr@2
   167
class CAknTextSettingPageExtension;
williamr@2
   168
williamr@2
   169
class CAknTextSettingPage : public CAknEdwinSettingPage
williamr@2
   170
{
williamr@2
   171
public:
williamr@2
   172
williamr@2
   173
// Flags to modify the behaviour of the editor
williamr@2
   174
	enum TAknTextSettingPageFlags
williamr@2
   175
	{
williamr@2
   176
	EZeroLengthNotOffered = 0x0,	// DEPRECATED. This enum preserved but with value 0
williamr@2
   177
	EPutCursorAtEnd = 0x0,			// DEPRECATED. This is already default so putting flag at beginning is more useful
williamr@2
   178
	EZeroLengthAllowed = 0x0000001,
williamr@2
   179
	ENoInitialSelection = 0x0000004,	// DEPRECATED and no longer used
williamr@2
   180
	EPutCursorAtBeginning = 0x0000008,	// DEPRECATED and no longer used
williamr@2
   181
	// Instructs the TextSettingPage not to override any of the Edwin's cursor and selection flags
williamr@2
   182
	EUseEdwinCursorAndSelectionFlags = 0x0000010, // DEPRECATED
williamr@2
   183
	EPredictiveTextEntryPermitted = 0x0020
williamr@2
   184
	};
williamr@2
   185
williamr@2
   186
public:
williamr@2
   187
	/**
williamr@2
   188
	 * Simple constructor depending only on a single resource Id. Editor resource is given via
williamr@2
   189
	 * the link in the setting page resource.
williamr@2
   190
	 *
williamr@2
   191
	 * @param aSettingPageResourceId	Setting Page to use (if present)
williamr@2
   192
	 * @param aText						Reference to text for editing
williamr@2
   193
	 * @param aTextSettingPageFlags		option flags for miscellaneous things
williamr@2
   194
	 */
williamr@2
   195
	IMPORT_C CAknTextSettingPage(TInt aResourceID, TDes& aText, TInt aTextSettingPageFlags = 0 );
williamr@2
   196
	/**
williamr@2
   197
	 * Constructor that allows separate setting page and editor resources
williamr@2
   198
	 * 
williamr@2
   199
	 * This constructor allows the use of setting page using only the editor resource.  Other combinations are also possible
williamr@2
   200
	 *
williamr@2
   201
	 * In all cases the number (if supplied i.e. <> 0 ) is used.  
williamr@2
   202
	 *
williamr@2
   203
	 *		Editor Resource		Setting Page Resource
williamr@2
   204
	 *			present				present				Both are used (but text & number overridden)
williamr@2
   205
	 *			 = 0					present				Editor resource is used via SP resource (Effectively like the other constructor)
williamr@2
   206
	 *			present					= 0					Default Avkon SP resource if used + this editor resource
williamr@2
   207
	 *			 = 0					= 0					uses default resource for both SP and editor. This is OK if:
williamr@2
   208
	 *	 i) control type is present, 
williamr@2
   209
	 *  ii) a default resource exists ( OK for text, integer, date, time, duration )
williamr@2
   210
	 *
williamr@2
   211
	 * Note: The first argument is a TDesC* (rather than TDesC&) because the other constructor
williamr@2
   212
	 * cannot initialize such a member without allocation or having an internal dummy buffer.
williamr@2
   213
	 * Note that this buffer must be owned by the client until ExecuteLD has been called.
williamr@2
   214
	 *
williamr@2
   215
	 * Rules for text and numbers: The rules are the same for both:  (non-zero length) text or number other 
williamr@2
   216
	 * than EAknSettingPageNoOrdinalDisplayed if given in this constructor will not override resource 
williamr@2
   217
	 * (unless that is zero length or EAknSettingPageNoOrdinalDisplayed).  Note, however, that text or number given via the 
williamr@2
   218
	 * specific API for setting them, WILL override resource.
williamr@2
   219
	 * It is assumed that number from resource is very rare.  Special text is somewhat more likely.
williamr@2
   220
	 * 
williamr@2
   221
	 * @param aSettingTitleText	Text at top of setting pane; OWNED EXTERNALLY
williamr@2
   222
	 * @param aSettingNumber		Number at top left (if present)
williamr@2
   223
	 * @param aControlType			Determines the type constructed and how its resource is read
williamr@2
   224
	 * @param aEditorResourceId	Editor resource to use in the setting page (if present)
williamr@2
   225
	 * @param aSettingPageResourceId		Setting Page to use (if present)
williamr@2
   226
	 * @param aText					Reference to text for editing
williamr@2
   227
	 * @param aTextSettingPageFlags option flags for miscellaneous things
williamr@2
   228
	 */
williamr@2
   229
	IMPORT_C CAknTextSettingPage(	const TDesC* aSettingTitleText, 
williamr@2
   230
								TInt aSettingNumber, 
williamr@2
   231
								TInt aControlType,
williamr@2
   232
								TInt aEditorResourceId, 
williamr@2
   233
								TInt aSettingPageResourceId,
williamr@2
   234
								TDes& aText, 
williamr@2
   235
								TInt aTextSettingPageFlags = 0);
williamr@2
   236
williamr@2
   237
	/**
williamr@2
   238
	* 2nd stage construction for this specific type.  Calls BaseConstructL in 
williamr@2
   239
	* CAknSettingPage, where the object is constructed from resource.
williamr@2
   240
	* 
williamr@2
   241
	* After calling this method, the contained editor is fully constructed and has its text set, 
williamr@2
   242
	* copied from the aText parameter of the constructor. 
williamr@2
   243
	* 
williamr@2
   244
	* This constructor can be called prior to a call to ExecuteLD in order to ensure 
williamr@2
   245
	* construction of the editor if API needs to be called on it prior to setting page launch.
williamr@2
   246
	* ExecuteLD will not attempt itself to do the construction a 2nd time.
williamr@2
   247
	* 
williamr@2
   248
	*/
williamr@2
   249
	IMPORT_C virtual void ConstructL();
williamr@2
   250
williamr@2
   251
    /**
williamr@2
   252
    * From CCoeControl.     
williamr@2
   253
    * Handles pointer events
williamr@2
   254
    */
williamr@2
   255
    IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
williamr@2
   256
williamr@4
   257
public:
williamr@4
   258
    /**
williamr@4
   259
	 *  add for CAknTextSettingPageExtension to access the api fo CAknTextSettingPage
williamr@4
   260
	 */
williamr@4
   261
	void ProcessPopupStateChangesL();
williamr@2
   262
williamr@2
   263
protected:
williamr@2
   264
	/**
williamr@2
   265
	* C++ destructor
williamr@2
   266
	*
williamr@2
   267
	*/ 
williamr@2
   268
	IMPORT_C virtual ~CAknTextSettingPage();
williamr@2
   269
williamr@2
   270
//
williamr@2
   271
// CAknSettingPage Framework implementations
williamr@2
   272
//
williamr@2
   273
protected:
williamr@2
   274
williamr@2
   275
/**
williamr@2
   276
* Called immediately prior to activation of the dialog.  Framework routine for derived
williamr@2
   277
* classes.
williamr@2
   278
*
williamr@2
   279
*/
williamr@2
   280
	IMPORT_C virtual void DynamicInitL();
williamr@2
   281
williamr@2
   282
/**
williamr@2
   283
* Called when something has changed and the client's object needs to have its text updated
williamr@2
   284
*
williamr@2
   285
*/
williamr@2
   286
	IMPORT_C virtual void UpdateSettingL();
williamr@2
   287
williamr@2
   288
/**
williamr@2
   289
* Called when the user accepts the text and the setting page is about to be dismissed.  The latest value of the
williamr@2
   290
* text is written to the client's object
williamr@2
   291
*/
williamr@2
   292
	IMPORT_C virtual void AcceptSettingL();
williamr@2
   293
williamr@2
   294
/**
williamr@2
   295
* Called when the user rejects the setting.  
williamr@2
   296
* A backed up copy is used to restore the initial value
williamr@2
   297
*
williamr@2
   298
*/
williamr@2
   299
	IMPORT_C virtual void RestoreOriginalSettingL();
williamr@2
   300
williamr@2
   301
/**
williamr@2
   302
 * From MCoeControlObserver:
williamr@2
   303
 * Acts upon changes in the hosted control's state. If the EUpdateWhenChanged
williamr@2
   304
 * flag is set, this updates the setting text.
williamr@2
   305
 * 
williamr@2
   306
 * @param	aControl	The control changing its state (not used)
williamr@2
   307
 * @param	aEventType	The type of control event 
williamr@2
   308
 */
williamr@2
   309
	IMPORT_C virtual void HandleControlEventL(CCoeControl* aControl, TCoeEvent aEventType );	
williamr@2
   310
williamr@2
   311
williamr@2
   312
/**
williamr@2
   313
 * Framework method to set the validity of the data
williamr@2
   314
 * This is called when the data changes.
williamr@2
   315
 *
williamr@2
   316
 */
williamr@2
   317
	IMPORT_C virtual void CheckAndSetDataValidity();
williamr@2
   318
williamr@2
   319
/**
williamr@2
   320
* This method copies out the text from the editor into the client's descriptor
williamr@2
   321
*
williamr@2
   322
*/
williamr@2
   323
	IMPORT_C virtual void UpdateTextL();
williamr@2
   324
	
williamr@2
   325
/**
williamr@2
   326
* Update the CBA. This should be called after a control state change in case 
williamr@2
   327
* there has been a change in data validity.
williamr@2
   328
*
williamr@2
   329
*/
williamr@2
   330
	IMPORT_C virtual void UpdateCbaL();
williamr@2
   331
williamr@2
   332
/**
williamr@2
   333
* Framework method to determine if it is OK to exit the setting page.
williamr@2
   334
* Derived classes may check for valid data before allowing the dismissal of the 
williamr@2
   335
* setting page.
williamr@2
   336
* 
williamr@2
   337
*
williamr@2
   338
*
williamr@2
   339
* @param	aAccept ETrue if the user has indicated to accept the setting page; EFalse otherwise
williamr@2
   340
* @return	TBool	a value indicating whether the setting page should be dismissed
williamr@2
   341
*/
williamr@2
   342
    IMPORT_C virtual TBool OkToExitL(TBool aAccept);
williamr@2
   343
williamr@2
   344
/** 
williamr@2
   345
* This routine routes the keys to the editor. 
williamr@2
   346
* However, if the menu is showing, then events are sent to the menu. 
williamr@2
   347
*
williamr@2
   348
* @param	aKeyEvent	event information	
williamr@2
   349
* @param	aType		type of event being handled
williamr@2
   350
*
williamr@2
   351
*/
williamr@2
   352
	IMPORT_C TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType);
williamr@2
   353
williamr@2
   354
williamr@2
   355
/**
williamr@2
   356
 * Reserved methods for CAknSettingPage hierarchy
williamr@2
   357
 */ 
williamr@2
   358
private: 
williamr@2
   359
	IMPORT_C virtual void CAknSettingPage_Reserved_1();
williamr@2
   360
	IMPORT_C virtual void CAknSettingPage_Reserved_2();
williamr@2
   361
williamr@2
   362
// 
williamr@2
   363
// From CCoeControl
williamr@2
   364
//
williamr@2
   365
williamr@2
   366
protected:
williamr@2
   367
williamr@2
   368
/**
williamr@2
   369
* From CCoeControl
williamr@2
   370
* This routine is called as part of the set-up of the control.  It is the place to put
williamr@2
   371
* the layout code. 
williamr@2
   372
*
williamr@2
   373
*/
williamr@2
   374
	IMPORT_C virtual void SizeChanged();
williamr@2
   375
williamr@2
   376
/**
williamr@2
   377
 * Writes the internal state of the control and its components to aStream.
williamr@2
   378
 * Does nothing in release mode.
williamr@2
   379
 * Designed to be overidden and base called by subclasses.
williamr@2
   380
 *
williamr@2
   381
 * @param	aWriteSteam		A connected write stream
williamr@2
   382
 */	
williamr@2
   383
	IMPORT_C virtual void WriteInternalStateL(RWriteStream& aWriteStream) const;
williamr@2
   384
williamr@2
   385
private:
williamr@2
   386
/**
williamr@2
   387
 *	Reserved method derived from CCoeControl
williamr@2
   388
 */
williamr@2
   389
	IMPORT_C virtual void Reserved_2();
williamr@2
   390
williamr@2
   391
private:
williamr@2
   392
    /**
williamr@2
   393
    * From CAknControl
williamr@2
   394
    */
williamr@2
   395
    IMPORT_C void* ExtensionInterface( TUid aInterface );
williamr@2
   396
williamr@2
   397
/**
williamr@2
   398
 * Reserved method from CAknEdwinSettingPage
williamr@2
   399
 *
williamr@2
   400
 */
williamr@2
   401
	IMPORT_C virtual void CAknEdwinSettingPage_Reserved_1();
williamr@2
   402
williamr@2
   403
private: 
williamr@2
   404
    // restarts timer that blocks Ok button for the period FEP may reject the edit
williamr@2
   405
    void RestartMultitapWaitTimer();
williamr@2
   406
williamr@2
   407
private:
williamr@2
   408
	HBufC* iBackupText;
williamr@2
   409
	TDes& iText;
williamr@2
   410
	TInt iTextSettingPageFlags;
williamr@2
   411
	CAknTextSettingPageExtension* iExtension; 
williamr@2
   412
	};
williamr@2
   413
williamr@2
   414
williamr@2
   415
/**
williamr@2
   416
 * Setting page specialized for display of CAknIntegerEdwin
williamr@2
   417
 *
williamr@2
   418
 */
williamr@2
   419
class CAknIntegerSettingPage : public CAknEdwinSettingPage
williamr@2
   420
{
williamr@2
   421
public:
williamr@2
   422
williamr@2
   423
// Flags to modify the behaviour of the editor
williamr@2
   424
	enum TAknIntegerSettingPageFlags
williamr@2
   425
	{
williamr@2
   426
	EInvalidValueNotOffered = 0x0,
williamr@2
   427
	EEmptyValueAllowed = 0x0000001,
williamr@2
   428
	EInvalidValueAllowed = 0x0000002,
williamr@2
   429
	ENoInitialSelection = 0x0000004,
williamr@2
   430
	EPutCursorAtBeginning = 0x0000008
williamr@2
   431
	};
williamr@2
   432
williamr@2
   433
public:
williamr@2
   434
	IMPORT_C CAknIntegerSettingPage(TInt aResourceID, TInt& aValue, TInt aTextSettingPageFlags = 0 );
williamr@2
   435
	/**
williamr@2
   436
	 * Constructor that allows separate setting page and editor resources
williamr@2
   437
	 * 
williamr@2
   438
	 * This constructor allows the use of setting page using only the editor resource.  Other combinations are also possible
williamr@2
   439
	 *
williamr@2
   440
	 * In all cases the number (if supplied i.e. <> 0 ) is used.  
williamr@2
   441
	 *
williamr@2
   442
	 *		Editor Resource		Setting Page Resource
williamr@2
   443
	 *			present				present				Both are used (but text & number overridden)
williamr@2
   444
	 *			 = 0					present				Editor resource is used via SP resource (Effectively like the other constructor)
williamr@2
   445
	 *			present				= 0					Default Avkon SP resource if used + this editor resource
williamr@2
   446
	 *			 = 0					= 0					uses default resource for both SP and editor. This is OK if:
williamr@2
   447
	 *	 i) control type is present, 
williamr@2
   448
	 *  ii) a default resource exists ( OK for text, integer, date, time, duration )
williamr@2
   449
	 *
williamr@2
   450
	 * Note: The first argument is a TDesC* (rather than TDesC&) because the other constructor
williamr@2
   451
	 * cannot initialize such a member without allocation or having an internal dummy buffer.
williamr@2
   452
	 *
williamr@2
   453
	 * Rules for text and numbers: The rules are the same for both:  (non-zero length) text or number other 
williamr@2
   454
	 * than EAknSettingPageNoOrdinalDisplayed if given in this constructor will not override resource 
williamr@2
   455
	 * (unless that is zero length or EAknSettingPageNoOrdinalDisplayed).  Note, however, that text or number given via the 
williamr@2
   456
	 * specific API for setting them, WILL override resource.
williamr@2
   457
	 * It is assumed that number from resource is very rare.  Special text is somewhat more likely.
williamr@2
   458
	 * 
williamr@2
   459
	 * @param aSettingTitleText	Text at top of setting pane; OWNED EXTERNALLY
williamr@2
   460
	 * @param aSettingNumber		Number at top left (if present)
williamr@2
   461
	 * @param aControlType			Determines the type constructed and how its resource is read
williamr@2
   462
	 * @param aEditorResourceId	Editor resource to use in the setting page (if present)
williamr@2
   463
	 * @param aSettingPageResourceId		Setting Page to use (if present)
williamr@2
   464
	 * @param aValue					Reference to integer value for editing
williamr@2
   465
	 * @param aIntegerSettingPageFlags option flags for miscellaneous things
williamr@2
   466
	 */
williamr@2
   467
	IMPORT_C CAknIntegerSettingPage(	const TDesC* aSettingTitleText, 
williamr@2
   468
								TInt aSettingNumber, 
williamr@2
   469
								TInt aControlType,
williamr@2
   470
								TInt aEditorResourceId, 
williamr@2
   471
								TInt aSettingPageResourceId,
williamr@2
   472
								TInt& aValue, 
williamr@2
   473
								TInt aIntegerSettingPageFlags = 0);
williamr@2
   474
williamr@2
   475
	/**
williamr@2
   476
	* 2nd stage construction for this specific type.  Call BaseConstructL in 
williamr@2
   477
	* CAknSettingPage, where the object is constructed from resource.
williamr@2
   478
	*/
williamr@2
   479
	IMPORT_C virtual void ConstructL();
williamr@2
   480
williamr@2
   481
	/** 
williamr@2
   482
	* Type-specific access to the hosted editor
williamr@2
   483
	*
williamr@2
   484
	* @return CAknIntegerEdwin*		pointer to the current hosted editor
williamr@2
   485
	*/
williamr@2
   486
	IMPORT_C CAknIntegerEdwin* IntegerEditorControl();
williamr@2
   487
williamr@2
   488
    /**
williamr@2
   489
    * From CCoeControl.     
williamr@2
   490
    * Handles pointer events
williamr@2
   491
    */
williamr@2
   492
    IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
williamr@2
   493
williamr@2
   494
//
williamr@2
   495
// Framework methods from CAknSettingPage
williamr@2
   496
//
williamr@2
   497
protected:
williamr@2
   498
williamr@2
   499
/**
williamr@2
   500
* Called immediately prior to activation of the dialog.  Framework routine for derived
williamr@2
   501
* classes.
williamr@2
   502
*
williamr@2
   503
*/
williamr@2
   504
	IMPORT_C virtual void DynamicInitL();
williamr@2
   505
williamr@2
   506
/**
williamr@2
   507
* Called when something has changed and the client's object needs to have its value updated
williamr@2
   508
*
williamr@2
   509
*/
williamr@2
   510
	IMPORT_C virtual void UpdateSettingL();
williamr@2
   511
williamr@2
   512
williamr@2
   513
/**
williamr@2
   514
* Called when the user rejects the setting.  A backup copy may need to be restored if UpdateWhenChanged flag was set
williamr@2
   515
*
williamr@2
   516
*/
williamr@2
   517
	IMPORT_C virtual void RestoreOriginalSettingL();
williamr@2
   518
williamr@2
   519
/**
williamr@2
   520
 * Framework method to set the validity of the data
williamr@2
   521
 * This is called when the data changes.
williamr@2
   522
 * May be over-ridden to change the validation rules.
williamr@2
   523
 *
williamr@2
   524
 */
williamr@2
   525
	IMPORT_C virtual void CheckAndSetDataValidity();
williamr@2
   526
williamr@2
   527
/** 
williamr@2
   528
 * This framework method is used to update the contents of the CBA in a custom way.
williamr@2
   529
 * Some setting page classes implement a degree of validation and will implement this.
williamr@2
   530
 * Derived classes should ensure that this is being called frequently enough for their
williamr@2
   531
 * purposes.
williamr@2
   532
 */
williamr@2
   533
	IMPORT_C virtual void UpdateCbaL();
williamr@2
   534
williamr@2
   535
/**
williamr@2
   536
 * Reserved methods for CAknSettingPage hierarchy
williamr@2
   537
 */ 
williamr@2
   538
private: 
williamr@2
   539
	IMPORT_C virtual void CAknSettingPage_Reserved_1();
williamr@2
   540
	IMPORT_C virtual void CAknSettingPage_Reserved_2();
williamr@2
   541
williamr@2
   542
williamr@2
   543
williamr@2
   544
//
williamr@2
   545
// From MEikControlObserver
williamr@2
   546
//
williamr@2
   547
williamr@2
   548
protected:
williamr@2
   549
williamr@2
   550
/**
williamr@2
   551
 * From MCoeControlObserver:
williamr@2
   552
 * Acts upon changes in the hosted control's state. 
williamr@2
   553
 * 
williamr@2
   554
 * The implementation of this class is trivial and should be able to be
williamr@2
   555
 * safely re-implemented in directly client-derived classes. 
williamr@2
   556
 * For non-base setting page classes, a call to the base class should be made
williamr@2
   557
 *
williamr@2
   558
 * @param	aControl	The control changing its state (not used)
williamr@2
   559
 * @param	aEventType	The type of control event 
williamr@2
   560
 */
williamr@2
   561
	IMPORT_C virtual void HandleControlEventL(CCoeControl* aControl, TCoeEvent aEventType );	
williamr@2
   562
williamr@2
   563
//
williamr@2
   564
// From CCoeControl
williamr@2
   565
//
williamr@2
   566
protected:
williamr@2
   567
williamr@2
   568
/**
williamr@2
   569
* From CCoeControl
williamr@2
   570
* This routine is called as part of the set-up of the control.  It is the place to put
williamr@2
   571
* layout code. 
williamr@2
   572
*
williamr@2
   573
*/
williamr@2
   574
	IMPORT_C virtual void SizeChanged();
williamr@2
   575
williamr@2
   576
williamr@2
   577
/**
williamr@2
   578
 * Writes the internal state of the control and its components to aStream.
williamr@2
   579
 * Does nothing in release mode.
williamr@2
   580
 * Designed to be overidden and base called by subclasses.
williamr@2
   581
 *
williamr@2
   582
 * @param	aWriteSteam		A connected write stream
williamr@2
   583
 */	
williamr@2
   584
	IMPORT_C virtual void WriteInternalStateL(RWriteStream& aWriteStream) const;
williamr@2
   585
williamr@2
   586
private: 
williamr@2
   587
/**
williamr@2
   588
 *	Reserved method derived from CCoeControl
williamr@2
   589
 */
williamr@2
   590
	IMPORT_C virtual void Reserved_2();
williamr@2
   591
williamr@2
   592
private:
williamr@2
   593
    /**
williamr@2
   594
    * From CAknControl
williamr@2
   595
    */
williamr@2
   596
    IMPORT_C void* ExtensionInterface( TUid aInterface );
williamr@2
   597
williamr@2
   598
private:
williamr@2
   599
williamr@2
   600
/**
williamr@2
   601
 * Reserved method from CAknEdwinSettingPage
williamr@2
   602
 *
williamr@2
   603
 */
williamr@2
   604
	IMPORT_C virtual void CAknEdwinSettingPage_Reserved_1();
williamr@2
   605
williamr@2
   606
private:
williamr@2
   607
	TInt iBackupValue;
williamr@2
   608
	TInt& iValue;
williamr@2
   609
	TInt iIntegerSettingPageFlags;
williamr@2
   610
	TInt iSpare_1; 
williamr@2
   611
};
williamr@2
   612
williamr@2
   613
williamr@2
   614
#endif