epoc32/include/mw/aknsettingitemlist.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
permissions -rw-r--r--
Final list of Symbian^2 public API header files
     1 /*
     2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     5 * under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description: 
    15 *     Support for Setting Item Lists (See Selection Service specification)
    16 *		Contains setting item classes (whole hierarchy) and the 
    17 *		array classes used to set up the setting item listbox
    18 *
    19 */
    20 
    21 
    22 #if !defined(__AKNSETTINGITEMLIST_H__)
    23 #define __AKNSETTINGITEMLIST_H__
    24 
    25 #include <in_sock.h>
    26 
    27 #include <AknControl.h>
    28 
    29 // For graphics API
    30 #include <gulicon.h>
    31 
    32 // For CEikFormattedListBox
    33 #include <eikfrlb.h>
    34 
    35 // For setting page
    36 #include <aknsettingpage.h>
    37 
    38 // For query stuff
    39 #include <aknqueryvaluetext.h>
    40 
    41 
    42 // Maximum length of the blanking text
    43 const TInt KMaxPasswordBlankingTextLength = 10;
    44 
    45 class CAknSettingItemExtension;
    46 
    47 
    48 /**
    49 * CAknSettingItem is the base class for all setting items. The abstracted functionality
    50 * is implemented in this class if possible.  
    51 *
    52 * All array of setting items is held in CAknSettingItemArray, which in turn is owned by
    53 * CAknSettingItemList, a listbox type.
    54 * 
    55 */
    56 class CAknSettingItem : public CBase, public MAknSettingPageObserver
    57 	{
    58 
    59 friend class CAknSettingItemArray;
    60 
    61 public:
    62 	enum TFlags
    63 		{
    64 		EIsHidden = 0x1,
    65 		EHasIcon = 0x2,
    66 		EIsNumberedStyle = 0x4,
    67         ENoProtection = 0x8,
    68         EViewOnly = 0x10,
    69         EProtected = 0x20
    70         };
    71         
    72         // Setting item protection states
    73    enum TSettingItemProtection
    74         {
    75         ENoSettingItemProtection,
    76         ESettingItemViewOnly,
    77         ESettingItemProtected
    78         };
    79 public:
    80 	/**
    81 	* Constructor
    82 	*
    83 	* @param the unique identifier fo the setting item (not its number)
    84 	*/
    85 	IMPORT_C CAknSettingItem( TInt identifier );
    86 
    87 	/**
    88 	* Destructor
    89 	*/
    90 	IMPORT_C ~CAknSettingItem();
    91 
    92 	/**
    93 	* 
    94 	* 2nd-stage constuctor.  Resource for setting item is read externally in setting item list
    95 	* and the values are passed here.
    96 	*/
    97 	IMPORT_C void ConstructL( 
    98 		const TBool aIsNumberedStyle,
    99 		const TInt aOrdinal, 
   100 		const TDesC& aSettingTitle, 
   101 		CArrayPtr<CGulIcon>* aIconArray,
   102 		const TInt aSettingPageResource, 
   103 		const TInt aEditorControlType,
   104 		const TInt aSettingEditorResource = 0, 
   105 		const TInt aAssociatedResource = 0 );
   106 	
   107 	/**
   108 	* This command externalizes the current setting.  The displayed (internal) copy
   109 	* is transferred to the external copy (the one referenced in the constructor).
   110 	*
   111 	* This must be called by the client if he wants this to happen.  Note that StoreAllL() 
   112 	* on the setting item list will call this for each setting item.
   113 	*/
   114 	IMPORT_C virtual void StoreL();
   115 	/*
   116 	* The external value is transferred to the internal value
   117 	* This occurs at construction, but may be called by client code when required.
   118 	*/
   119 	IMPORT_C virtual void LoadL(); 
   120 	/**
   121 	*
   122 	* This launches the setting page 
   123 	*
   124 	* @param		aCalledFromMenu - ignored in this class
   125 	*
   126 	*/
   127 	IMPORT_C virtual void EditItemL( TBool aCalledFromMenu );
   128 	/**
   129 	*
   130 	* This method is called by framework in order to update the text in the setting
   131 	* item. It may be called by the client.
   132 	*
   133 	*/
   134 	IMPORT_C virtual void UpdateListBoxTextL();
   135 
   136 	/**
   137 	* Access to the setting Name 
   138 	*.@return	the setting name
   139 	*/
   140 	IMPORT_C TPtrC SettingName();
   141 	/**
   142 	* Access to the setting number
   143 	* @return the setting number
   144 	*/
   145 	IMPORT_C TInt SettingNumber() const;
   146 	/**
   147 	* Access to the setting visibility
   148 	* @return ETrue if the setting item is hidden
   149 	*/
   150 	IMPORT_C TBool IsHidden() const;
   151 	/**
   152 	* Access to the numbering style of the setting item
   153 	* @return	ETrue if it is numbered
   154 	*/
   155 	IMPORT_C TBool IsNumberedStyle() const;
   156 	/**
   157 	* Set the visibility 
   158 	* @param		Set to ETrue to hide the item; EFalse to make it visible
   159 	*
   160 	*				Note that the setting item array must have be notified of this
   161 	*				by calling CAknSettingItemList::HandleChangeInItemArrayOrVisibility
   162 	*/
   163 	IMPORT_C void SetHidden(TBool aHidden );
   164 	/*
   165 	* This method obtains the current value's setting text
   166 	*
   167 	* @return	Reference to descriptor with the text 
   168 	*/
   169 	IMPORT_C virtual const TDesC& SettingTextL();
   170 	/**
   171 	* This gives access to the listbox text content at this item (fully decorated)
   172 	*
   173 	* @return	pointer to listboxtext. No allocation is performed and no change of ownership
   174 	*/
   175 	IMPORT_C HBufC* ListBoxText();
   176 	/**
   177 	* Access to the setting item's identifier. This is set in the setting item's constructor
   178 	* but usually comes via resource in the setting item list read of its resource structure
   179 	*
   180 	* @return The identifier of this setting item
   181 	*/
   182 	IMPORT_C TInt Identifier() const;
   183 	/**
   184 	* Checks if the setting item has a bitmap in its setting contents 
   185 	* @return	ETrue if it has a bitmap
   186 	*/
   187 	IMPORT_C TBool HasIcon() const;
   188 	/**
   189 	* This sets the text to display if the current setting is empty. 
   190 	*
   191 	* @param		text to make display when there is empty setting. A copy is made in the setting item
   192 	*/
   193 	IMPORT_C void SetEmptyItemTextL( const TDesC& aEmptyItemText );
   194 	IMPORT_C void SetCompulsoryIndTextL( const TDesC& aCompulsoryInd );
   195 
   196 	// From MAknSettingPageObserver
   197 	IMPORT_C virtual void HandleSettingPageEventL(CAknSettingPage* aSettingPage,TAknSettingPageEvent aEventType );
   198 	/**
   199 	* Get the index at which this item appears in the listbox
   200 	*
   201 	* @return index in listbox
   202 	*/
   203 	IMPORT_C TInt VisibleIndex();
   204 
   205 	/**
   206 	* Set the flags that are required for some of the setting page constructors
   207 	*
   208 	* @param aFlagPattern	Flag pattern to set
   209 	*/
   210 	IMPORT_C void SetSettingPageFlags( TInt aFlagPattern);
   211 
   212 	/**
   213 	* Access method for the setting page specific flags
   214 	* @return the flag pattern
   215 	*/
   216 	IMPORT_C TInt SettingPageFlags( ) const;
   217 
   218     /**
   219     * Set the parent lisbox into the setting item
   220     *
   221     * @since 2.0
   222     * @param aListBox   listbox with which the setting item is associated.
   223     */
   224     void SetParentListBox( const CEikFormattedCellListBox* aListBox );
   225 
   226     /**
   227     * Set the protection state of the setting item
   228     *
   229     * The protection state is for protecting selected settings from editing. 
   230     * The protection can be set to:
   231     *   - prohibit opening of the setting page
   232     *   - allow access to the setting page, but prohibit editing of it
   233     *
   234     * The protected item is indicated in the setting item list with a lock icon. 
   235     * If a user tries to open a protected setting item, a notification is shown 
   236     * to the user.
   237     *
   238     * The "view only" -mode is only possible for pop-up setting page.
   239     *
   240     * @since 3.1
   241     * @param aProtected Sets the protection state of the setting item
   242     */
   243     IMPORT_C void SetProtectionState( CAknSettingItem::TSettingItemProtection aProtected );
   244 
   245     /**
   246     * Get the protection state
   247     *
   248     * See SetProtected for details for the different states.
   249     *
   250     * @since 3.1
   251     * @return Protection state of the setting item
   252     */
   253     IMPORT_C CAknSettingItem::TSettingItemProtection ProtectionState();
   254 
   255 protected:
   256 
   257 
   258 	/**
   259 	* Method called by framework to complete the construction.  Extra allocations of
   260 	* memory or extra resource reading can happen here.
   261 	*
   262 	*/
   263 	IMPORT_C virtual void CompleteConstructionL();
   264 	/**
   265 	*
   266 	* Method to obtain a new bitmap for the setting content
   267 	*
   268 	* This method is usually empty in setting items classes except for volume and slider.
   269     * Any derived implementations of this method should call SetIconMask().
   270 	*
   271 	*/
   272 	IMPORT_C virtual CFbsBitmap* CreateBitmapL();
   273 
   274 // Utilities
   275 	/**
   276 	*
   277 	* A setting page should know when it is "Editing". This is set in EditItemL
   278 	* and cleared to 0 when the dialog is finished.
   279 	*
   280 	* @param		pointer to the currently executing settting page dialog
   281 	*
   282 	*/
   283 	IMPORT_C void SetSettingPage( CAknSettingPage* aSettingPage );
   284 	/*
   285 	* Access to the current setting page
   286 	*
   287 	* @return	pointer to the currently executing setting page. 0 if there is none
   288 	*/
   289 	IMPORT_C CAknSettingPage* SettingPage() const;
   290 	/**
   291 	* Performs standard setup on a setting page
   292 	*
   293 	*/
   294 	IMPORT_C void SetUpStandardSettingPageL();
   295 	/**
   296 	* Access to the empty text that has been set, or is default
   297 	*
   298 	* @return	ref to empty text descriptor
   299 	*/
   300 	IMPORT_C TDesC& EmptyItemText() const; // Assumed only needs to be used by SettingTextL
   301 
   302 	/**
   303 	* Access to the setting page resource id that might have been read by
   304 	* the setting item resource.
   305 	* 
   306 	* @return	0 or the setting page resource id
   307 	*/
   308 	IMPORT_C TInt SettingPageResourceId() const;
   309 	/**
   310 	* Access to the setting page editor's resource id that might have been read by
   311 	* the setting item resource.
   312 	* 
   313 	* @return	0 or the setting page editor's id
   314 	*/
   315 	IMPORT_C TInt SettingEditorResourceId() const;
   316 	/**
   317 	* Returns the associate editor resource.  This is an LLINK in the seting item 
   318 	* resource that subclasses can use in CompleteContstructionL
   319 	*
   320 	* @return	0 or the extra resource id
   321 	*/
   322 	IMPORT_C TInt AssociatedResourceId() const;
   323 	/**
   324 	* 
   325 	* @return the control type of the settin page editor
   326 	*
   327 	*/
   328 	TInt EditorControlType() const;
   329 
   330     /**
   331     * This sets the mask of this setting item's icon array, if it exists.
   332     * The normal usage of this routine is inside a re-implementation of CAknSettingItem::CreateBitmapL.
   333     * It is used to set the mask of the setting item's setting icon as a side effect of a 
   334     * framework call to CreateBitmapL
   335     *
   336     * The return value may need to be looked at to decide how to dispose of, for example, an
   337     * a CGulIcon that may be holding the mask.
   338     * 
   339     * @since 2.0
   340     * @param aMask  bitmap to set as a mask for the CGulIcon in the setting listbox's icon array
   341     * @return TBool ETrue if the ownership of aMask has been passed
   342     */
   343     IMPORT_C TBool SetIconMask( CFbsBitmap* aMask );
   344 
   345     /**
   346     * This sets the mask of this setting item's icon array, if it exists, using the mask from the
   347     * passed icon.
   348     * It returns the bitmap from the aIcon. 
   349     * The method also takes ownership of aIcon and may delete it (but not its bitmap).
   350     * 
   351     * @since 2.0
   352     * @param aIcon  icon of which the mask is passed through to SetIconMask() and bitmap is returned
   353     * @return CFbsBitmap* bitmap from aIcon. Ownership of the bitmap is transfered to the caller
   354     */
   355     CFbsBitmap* SetIconMaskAndReturnBitmap( CGulIcon* aIcon );
   356 private:
   357 	/**
   358 	* This routine causes any bitmaps that are extracted from setting pages to be updated
   359 	* according to the current (internal) setting value
   360 	*/
   361 	void UpdateBitmapL();
   362 
   363 	/**
   364 	* Set the index at which the item is to appear in the setting item list 
   365 	* Only needed by CAknSettingItemArray
   366 	*/
   367 	void SetVisibleIndex( TInt aVisibleIndex );
   368 
   369 	/**
   370 	* Set the ordinal value. This is used for dynamic changing of the ordinal by 
   371 	* CAknSettingItemArray
   372 	*
   373 	*/
   374 	void SetOrdinal( TInt aOrdinal );
   375 
   376 	/**
   377 	*
   378 	* Clean up a setting text for display by replacing all non printing characters 
   379 	* by spaces
   380 	*
   381 	*/
   382 	TPtrC ReplaceNonPrintingCharacters( TDes& aTextToClean );
   383 private:
   384 	IMPORT_C void CAknSettingItem_Reserved();
   385 
   386 private:
   387 	TUint iFlags;
   388 	TInt iIdentifier;
   389 	TInt iOrdinal;
   390 	TInt iSettingIdentifier;
   391 	TInt iSettingPageResourceId;
   392 	TInt iEditorControlType;
   393 	TInt iSettingEditorResourceId;
   394 	TInt iAssociatedResourceId;
   395 	TInt iIconIndex; // Only valid if relevant bit is set in iFlags
   396 	HBufC* iEmptyItemText; // Owned 
   397 
   398 	HBufC* iSettingName;  // Owned
   399 	HBufC* iListBoxText;  // Owned
   400 	HBufC* iCompulsoryText; // Owned
   401 
   402 
   403 	// Following are not owned
   404 	CAknSettingPage* iSettingPage; // This is a ref that is valid when non-0 - when the SP is "up"
   405 	CArrayPtr<CGulIcon>* iIconArray;	// Reference to the array only !
   406 
   407 	TInt iVisibleIndex;
   408 	// Set flags that are in the Setting pages' constructors 
   409 	TInt iSettingPageFlags;
   410 
   411     // Pointer to the listbox that the setting item is providing data to
   412     const CEikFormattedCellListBox* iParentListBox; // Not owned
   413 
   414 	CAknSettingItemExtension* iExtension;
   415 	};
   416 
   417 /**
   418 * Support for abstact text setting type. Corresponds to CAknTextSettingPage
   419 *
   420 */
   421 class CAknTextSettingItem : public CAknSettingItem
   422 {
   423 public:
   424 	/*
   425 	* Constructor 
   426 	*
   427 	* @param		resource identifier for this setting item
   428 	* @param		Setting text
   429 	*
   430 	*/
   431 	IMPORT_C CAknTextSettingItem( TInt aIdentifier, TDes& aText );
   432 
   433 	/**
   434 	* Destructor
   435 	*/ 
   436 	IMPORT_C ~CAknTextSettingItem();
   437 
   438 	/**
   439 	* This command externalizes the current setting. The displayed (internal) copy
   440 	* is transferred to the external copy (the one referenced in the constructor).
   441 	*
   442 	* This must be called by the client if he wants this to happen. Note that StoreAllL() 
   443 	* on the setting item list will call this for each setting item.
   444 	*/
   445 	IMPORT_C virtual void StoreL();
   446 
   447 	/*
   448 	* The external value is transferred to the internal value
   449 	* This occurs at construction, but may be called by client code when required.
   450 	*/
   451 	IMPORT_C virtual void LoadL(); // Called from 2nd stage constructors
   452 
   453 	/*
   454 	* This method obtains the current value's setting text.
   455 	* 
   456 	* The reference is returned and is not a copy of the text, but refers to the current
   457 	* internal text value. This is the value that would be externalized if StoreL were called. 
   458 	* An exception to this is if the current text is zero length. In that case a reference to the 
   459 	* empty text is returned (which would not be externalized if StoreL is called).
   460 	*
   461 	* @return	Reference to descriptor with the current internal text 
   462 	*/
   463 	IMPORT_C virtual const TDesC& SettingTextL();
   464 
   465 	/**
   466 	*
   467 	* This launches the setting page for text editing
   468 	*
   469 	* @param		aCalledFromMenu - ignored in this class
   470 	*
   471 	*/
   472 	IMPORT_C virtual void EditItemL( TBool aCalledFromMenu );
   473 
   474 protected:
   475 
   476 	/**
   477 	*  Access for re-implementors to the internal text 
   478 	*
   479 	* @return	reference to a TPtr holding the internal text
   480 	*/
   481 	IMPORT_C TPtr& InternalTextPtr();
   482 
   483 	/**
   484 	*  Access for re-implementors to the external text
   485 	*
   486 	* @return	TPtrC pointing to the external text
   487 	*/
   488 	IMPORT_C TPtrC ExternalText();
   489 
   490 	/**
   491 	* Allows re-implementors to set the external text
   492 	* No change of ownership is implied.
   493 	*
   494 	* @param	 a reference to the external text
   495 	*
   496 	*/
   497 	IMPORT_C void SetExternalText( TDesC& aNewExternalText );
   498 private:
   499 	IMPORT_C void CAknSettingItem_Reserved();
   500 
   501 private:
   502 	TDes& iExternalText;
   503 	HBufC* iInternalText;	// Owned
   504 	TPtr iInternalTextPtr;
   505 	TInt iSpare_Text_1;
   506 };
   507 
   508 
   509 /**
   510 *
   511 * Abstract setting item for integer editing. 
   512 * 
   513 * This class is not disposed toward any particular type of setting page
   514 *
   515 */
   516 class CAknIntegerSettingItem : public CAknSettingItem 
   517 	{
   518 	public:
   519 	/*
   520 	* Constructor 
   521 	*
   522 	* @param		resource identifier for this setting item
   523 	* @param		integer value to edit. 
   524 	*
   525 	*/
   526 	IMPORT_C CAknIntegerSettingItem( TInt aIdentifier, TInt& aValue );
   527 	IMPORT_C ~CAknIntegerSettingItem();
   528 	
   529 	/**
   530 	* This command externalizes the current setting. The displayed (internal) copy
   531 	* is transferred to the external copy (the one referenced in the constructor).
   532 	*
   533 	* This must be called by the client if he wants this to happen. Note that StoreAllL() 
   534 	* on the setting item list will call this for each setting item.
   535 	*/
   536 	IMPORT_C virtual void StoreL();
   537 	/*
   538 	* The external value is transferred to the internal value
   539 	* This occurs at construction, but may be called by client code when required.
   540 	*/
   541 	IMPORT_C virtual void LoadL();
   542 
   543 	/*
   544 	* This method obtains the current value's setting text
   545 	*
   546 	* @return	Reference to descriptor with the text 
   547 	*/
   548 	IMPORT_C virtual const TDesC& SettingTextL();
   549 
   550 	/**
   551 	*
   552 	* Pure virtual editItemL
   553 	*
   554 	* @param		aCalledFromMenu - ignored in this class
   555 	*
   556 	*/
   557 	virtual void EditItemL( TBool aCalledFromMenu ) = 0;
   558 
   559 	protected:
   560 	/**
   561 	* Method called by framework to complete the construction. Extra allocations of
   562 	* memory or extra resource reading can happen here.
   563 	*
   564 	*/
   565 	IMPORT_C virtual void CompleteConstructionL();
   566 
   567 	/**
   568 	* Method to access the internal value. 
   569 	*
   570 	* @return	 a reference to the internal integer value
   571 	*/
   572 	IMPORT_C TInt& InternalValueRef();
   573 
   574 	/**
   575 	* Method to access the external reference to the external value. Note that this class
   576 	* only accesses the external integer via a copy of a reference to it.
   577 	*
   578 	* @return	 a reference to the external integer value
   579 	*/
   580 	IMPORT_C TInt& ExternalValueRef();
   581 	
   582 	/**
   583 	* Sets the external value's reference.  The external vlue is externally owned, so
   584 	* this does not make a copy.
   585 	* @param	TInt& aValue	a reference to the external value	
   586 	*/
   587 	IMPORT_C void SetExternalValue( TInt& aValue );
   588 private:
   589 	IMPORT_C void CAknSettingItem_Reserved();
   590 
   591 	private:
   592 	TInt iInternalValue;
   593 	TInt& iExternalValue;
   594 	HBufC* iInternalText;	// Owned
   595 	TPtr iInternalTextPtr;
   596 	};
   597 
   598 
   599 class CAknIntegerEdwinSettingItem : public CAknIntegerSettingItem 
   600 	{
   601 	public:
   602 	IMPORT_C CAknIntegerEdwinSettingItem( TInt aIdentifier, TInt& aValue );
   603 	/**
   604 	*
   605 	* This launches the setting page for editing using the integer edwin class
   606 	*
   607 	* @param		aCalledFromMenu - ignored in this class
   608 	*
   609 	*/
   610 	IMPORT_C virtual void EditItemL( TBool aCalledFromMenu );
   611 private:
   612 	IMPORT_C void CAknSettingItem_Reserved();
   613 	};
   614 
   615 /**
   616 *
   617 * Class for holding a password setting item
   618 *
   619 */
   620 class CAknPasswordSettingItem : public CAknTextSettingItem
   621 {
   622 public:
   623 	enum TAknPasswordSettingItemMode
   624 		{
   625 		EAlpha,		// password held is alphanumeric
   626 		ENumeric	// password is numeric ( digits 0 - 9 only used )
   627 		};
   628 
   629 	/*
   630 	* Constructor 
   631 	*
   632 	* @param		resource identifier for this setting item
   633 	* @param		password mode; text or numeric
   634 	* @param		password to change
   635 	*/
   636 	IMPORT_C CAknPasswordSettingItem( TInt aIdentifier, enum TAknPasswordSettingItemMode aMode, TDes& aPassword );
   637 
   638 	/*
   639 	* This method obtains the current value's setting text
   640 	*
   641 	* @return	Reference to descriptor with the text 
   642 	*/
   643 	IMPORT_C virtual const TDesC& SettingTextL();
   644 	/**
   645 	*
   646 	* This launches the setting page for password editing
   647 	*
   648 	* @param		aCalledFromMenu - ignored in this class
   649 	*
   650 	*/
   651 	IMPORT_C virtual void EditItemL( TBool aCalledFromMenu );
   652 
   653 protected:
   654 
   655 	/**
   656 	* Method called by framework to complete the construction.  Extra allocations of
   657 	* memory or extra resource reading can happen here.
   658 	*
   659 	*/
   660 	IMPORT_C virtual void CompleteConstructionL();
   661 private:
   662 	IMPORT_C void CAknSettingItem_Reserved();
   663 
   664 private:
   665 	TAknPasswordSettingItemMode iPasswordMode;
   666 	// For holding the text to blank the setting item text
   667 	TBuf<KMaxPasswordBlankingTextLength> iBlankingText;
   668 	// For holding the resouce for a password query
   669 	TInt iOldPasswordQueryResourceId;
   670 };
   671 
   672 
   673 /**
   674 * An abstract integer setting that uses the volume control as its editor
   675 *
   676 */
   677 class CAknVolumeSettingItem : public CAknSettingItem
   678 	{
   679 public:
   680 	/*
   681 	* Constructor 
   682 	*
   683 	* @param		resource identifier for this setting item
   684 	* @param		volume value. Must be in range 0 to 10, inclusive
   685 	*
   686 	*/
   687 	IMPORT_C CAknVolumeSettingItem( TInt aIdentifier, TInt& aExternalVolume );
   688 	
   689 	/**
   690 	* This command externalizes the current setting. The displayed (internal) copy
   691 	* is transferred to the external copy (the one referenced in the constructor).
   692 	*
   693 	* This must be called by the client if he wants this to happen. Note that StoreAllL() 
   694 	* on the setting item list will call this for each setting item.
   695 	*/
   696 	IMPORT_C virtual void StoreL();
   697 	/*
   698 	* The external value is transferred to the internal value
   699 	* This occurs at construction, but may be called by client code when required.
   700 	*/
   701 	IMPORT_C virtual void LoadL();
   702 	/*
   703 	* This method obtains the current value's setting text
   704 	*
   705 	* @return	Reference to descriptor with the text 
   706 	*/
   707 	IMPORT_C virtual const TDesC& SettingTextL();
   708 	/**
   709 	*
   710 	* This launches the setting page for volume editing
   711 	*
   712 	* @param		aCalledFromMenu - ignored in this class
   713 	*
   714 	*/
   715 	IMPORT_C virtual void EditItemL( TBool aCalledFromMenu );
   716 
   717 protected:
   718 	/**
   719 	* Protected access to the volume value
   720 	*
   721 	* @return	Reference to the internal volume value
   722 	*/
   723 	IMPORT_C TInt& InternalVolumeValue(); // For access to internal value for derived classes
   724 
   725 	//From CAknSettingItem
   726 	/**
   727 	*
   728 	* Obtain a bitmap from the CAknVolume
   729 	*
   730 	*/
   731 	IMPORT_C virtual CFbsBitmap* CreateBitmapL();
   732 private:
   733 	IMPORT_C void CAknSettingItem_Reserved();
   734 
   735 private:
   736 	TInt& iExternalVolume;
   737 	TInt iInternalVolume;
   738 
   739 	};
   740 
   741 /**
   742 * Slider control setting item
   743 *
   744 *
   745 */
   746 
   747 class CAknSliderSettingItem : public CAknSettingItem
   748 	{
   749 public:
   750 	/*
   751 	* Constructor 
   752 	*
   753 	* @param		resource identifier for this setting item
   754 	* @param		Slider value; must be within the minimum and maximum values in resource
   755 	*
   756 	*/
   757 	IMPORT_C CAknSliderSettingItem( TInt aIdentifier, TInt& aExternalSliderValue );
   758 
   759 	/**
   760 	* This command externalizes the current setting. The displayed (internal) copy
   761 	* is transferred to the external copy (the one referenced in the constructor).
   762 	*
   763 	* This must be called by the client if he wants this to happen. Note that StoreAllL() 
   764 	* on the setting item list will call this for each setting item.
   765 	*/
   766 	IMPORT_C virtual void StoreL();
   767 	/*
   768 	* The external value is transferred to the internal value
   769 	* This occurs at construction, but may be called by client code when required.
   770 	*/
   771 	IMPORT_C virtual void LoadL(); 
   772 	/*
   773 	* This method obtains the current value's setting text
   774 	*
   775 	* @return	Reference to descriptor with the text 
   776 	*/
   777 	IMPORT_C virtual const TDesC& SettingTextL();
   778 	/**
   779 	*
   780 	* This launches the setting page for slider editing
   781 	*
   782 	* @param		aCalledFromMenu - ignored in this class
   783 	*
   784 	*/
   785 	IMPORT_C virtual void EditItemL( TBool aCalledFromMenu );
   786 
   787 protected:
   788 	/**
   789 	* Method to create a setting page 
   790 	*/
   791 	IMPORT_C virtual CAknSettingPage* CreateSettingPageL();
   792 
   793 	/**
   794 	* Method to contruct the setting page (via CreateSettingPageL), and execute it
   795 	*/
   796 	IMPORT_C virtual void CreateAndExecuteSettingPageL();
   797 
   798 	/**
   799 	* For access to internal value for derived classes
   800 	*
   801 	* @return	A ref to the internal value
   802 	*/
   803 	IMPORT_C TInt& InternalSliderValue();
   804 
   805 	// From CAknSettingItem
   806 	/**
   807 	*
   808 	* Obtain a bitmap from the CAknSlider
   809 	*
   810 	*/
   811 	IMPORT_C virtual CFbsBitmap* CreateBitmapL();
   812 private:
   813 	IMPORT_C void CAknSettingItem_Reserved();
   814 
   815 private:
   816 	TInt& iExternalSliderValue;
   817 	TInt iInternalSliderValue; // required for use in derived classes
   818 
   819 	};
   820 
   821 	
   822 /**
   823 *
   824 * Time or Date Setting Item
   825 *
   826 * This class combines the time and the date functionality, as determined by a mode
   827 * passed to the constructor.
   828 *
   829 * Time or Date setting pages are launched from here, which use Time or date editor 
   830 * MFNEs to do the editing.
   831 *
   832 */
   833 class CAknTimeOrDateSettingItem : public CAknSettingItem
   834 	{
   835 public:
   836 	enum TAknTimeOrDateSettingItemMode
   837 		{
   838 		ETime,
   839 		EDate
   840 		};
   841 	/*
   842 	* Constructor 
   843 	*
   844 	* @param		resource identifier for this setting item
   845 	* @param		construct a Time or a Date setting item
   846 	* @param		IP address to be controlled by the setting editing
   847 	*
   848 	*/
   849 	IMPORT_C CAknTimeOrDateSettingItem( TInt aIdentifier, enum TAknTimeOrDateSettingItemMode aMode, TTime& aTime );
   850 	/**
   851 	* Destructor
   852 	*/
   853 	IMPORT_C ~CAknTimeOrDateSettingItem();
   854 	/**
   855 	* Method called by framework to complete the construction.  Extra allocations of
   856 	* memory or extra resource reading can happen here.
   857 	*
   858 	*/
   859 	IMPORT_C void CompleteConstructionL( );
   860 	
   861 	/**
   862 	* This command externalizes the current setting.  The displayed (internal) copy
   863 	* is transferred to the external copy (the one referenced in the constructor).
   864 	*
   865 	* This must be called by the client if he wants this to happen.  Note that StoreAllL() 
   866 	* on the setting item list will call this for each setting item.
   867 	*/
   868 	IMPORT_C virtual void StoreL();
   869 	/*
   870 	* The external value is transferred to the internal value
   871 	* This occurs at construction, but may be called by client code when required.
   872 	*/
   873 	IMPORT_C virtual void LoadL(); 
   874 	/*
   875 	* This method obtains the current value's setting text
   876 	*
   877 	* @return	Reference to descriptor with the text 
   878 	*/
   879 	IMPORT_C virtual const TDesC& SettingTextL();
   880 	/**
   881 	*
   882 	* This launches the setting page for Time or Date editing
   883 	*
   884 	* @param		aCalledFromMenu - ignored in this class
   885 	*
   886 	*/
   887 	IMPORT_C virtual void EditItemL( TBool aCalledFromMenu );
   888 	/**
   889 	*
   890 	* Set the time or date format string.  If this is not called, then a 
   891 	* localized, default string is used
   892 	*
   893 	*/
   894 	IMPORT_C void SetTimeFormatStringL( const TDesC& aTimeFormat );
   895 	/**
   896 	*
   897 	* Obtain the time format string
   898 	*
   899 	* @return	A pointer descriptor to the date/time format string
   900 	*/
   901 	IMPORT_C const TPtrC TimeFormatString();
   902 private:
   903 	IMPORT_C void CAknSettingItem_Reserved();
   904 private:
   905 	TTime& iExternalTime;
   906 	TTime iInternalTime;
   907 	HBufC* iInternalText; // Owned
   908 	TPtr iInternalTextPtr;
   909 	HBufC* iTimeFormat;
   910 	TPtr iTimeFormatPtr;
   911 	TAknTimeOrDateSettingItemMode iTimeOrDateMode;
   912 	};
   913 
   914 
   915 	
   916 /**
   917 *
   918 * Time Offset Setting Item
   919 *
   920 * Time Offset page as launched from here, which use Offset editor 
   921 * MFNEs to do the editing.
   922 *
   923 *  @lib avkon
   924 *  @since 2.0
   925 
   926 */
   927 class CAknTimeOffsetSettingItem : public CAknSettingItem
   928 	{
   929 public:
   930 	/*
   931 	* Constructor 
   932 	*
   933 	* @param		resource identifier for this setting item
   934 	* @param		construct a Time offset setting item
   935 	*
   936 	*/
   937 	IMPORT_C CAknTimeOffsetSettingItem( TInt aIdentifier, TTimeIntervalSeconds& aTime );
   938 	/**
   939 	* Destructor
   940 	*/
   941 	IMPORT_C ~CAknTimeOffsetSettingItem();
   942 	/**
   943 	* Method called by framework to complete the construction.  Extra allocations of
   944 	* memory or extra resource reading can happen here.
   945 	*
   946     * @since 2.0
   947 	*/
   948 	IMPORT_C void CompleteConstructionL( );
   949 	
   950 	/**
   951 	* This command externalizes the current setting.  The displayed (internal) copy
   952 	* is transferred to the external copy (the one referenced in the constructor).
   953 	*
   954 	* This must be called by the client if he wants this to happen.  Note that StoreAllL() 
   955 	* on the setting item list will call this for each setting item.
   956     *
   957     * @since 2.0
   958 	*/
   959 	IMPORT_C virtual void StoreL();
   960 	/*
   961 	* The external value is transferred to the internal value
   962 	* This occurs at construction, but may be called by client code when required.
   963     *
   964     * @since 2.0
   965 	*/
   966 	IMPORT_C virtual void LoadL(); 
   967 	/*
   968 	* This method obtains the current value's setting text
   969 	*
   970     * @since 2.0
   971 	* @return	Reference to descriptor with the text 
   972 	*/
   973 	IMPORT_C virtual const TDesC& SettingTextL();
   974 	/**
   975 	*
   976 	* This launches the setting page for Time or Date editing
   977 	*
   978     * @since 2.0
   979 	* @param		aCalledFromMenu - ignored in this class
   980 	*
   981 	*/
   982 	IMPORT_C virtual void EditItemL( TBool aCalledFromMenu );
   983 	/**
   984 	*
   985 	* Set the time or date format string. If this is not called, then a 
   986 	* localized, default string is used
   987 	*
   988     * @since 2.0
   989 	*/
   990 	IMPORT_C void SetTimeFormatStringL( const TDesC& aTimeFormat );
   991 	/**
   992 	*
   993 	* Obtain the time format string
   994 	*
   995     * @since 2.0
   996 	* @return	A pointer descriptor to the date/time format string
   997 	*/
   998 	IMPORT_C const TPtrC TimeFormatString();
   999 private:
  1000 	IMPORT_C void CAknSettingItem_Reserved();
  1001 private:
  1002 	TTimeIntervalSeconds iExternalTime;
  1003 	TTimeIntervalSeconds iInternalTime;
  1004 	HBufC* iInternalText; // Owned
  1005 	TPtr iInternalTextPtr;
  1006 	HBufC* iTimeFormat;
  1007 	TPtr iTimeFormatPtr;
  1008 
  1009 	TInt iSpare;
  1010 	};
  1011 
  1012 
  1013 /**
  1014 *
  1015 * IP Address setting item
  1016 *
  1017 * Abstract data type for IP address setting. Launches a CAknIpFieldSettingPage 
  1018 * that in turn uses the CAknIpFieldEditor
  1019 *
  1020 */
  1021 class CAknIpFieldSettingItem : public CAknSettingItem
  1022 	{
  1023 public:
  1024 	/*
  1025 	* Constructor 
  1026 	*
  1027 	* @param		resource identifier for this setting item
  1028 	* @param		IP address to be controlled by the setting editing
  1029 	*
  1030 	*/
  1031 	IMPORT_C CAknIpFieldSettingItem( TInt aIdentifier, TInetAddr& aIpAddress );
  1032 	/**
  1033 	*
  1034 	* Destructor
  1035 	*
  1036 	*/
  1037 	IMPORT_C ~CAknIpFieldSettingItem();
  1038 	
  1039 	/**
  1040 	* Method called by framework to complete the construction. Extra allocations of
  1041 	* memory or extra resource reading can happen here.
  1042 	*
  1043 	*/
  1044 	IMPORT_C void CompleteConstructionL( );
  1045 	
  1046 	/**
  1047 	* This command externalizes the current setting. The displayed (internal) copy
  1048 	* is transferred to the external copy (the one referenced in the constructor).
  1049 	*
  1050 	* This must be called by the client if he wants this to happen. Note that StoreAllL() 
  1051 	* on the setting item list will call this for each setting item.
  1052 	*/
  1053 	IMPORT_C virtual void StoreL();
  1054 	/*
  1055 	* The external value is transferred to the internal value
  1056 	* This occurs at construction, but may be called by client code when required.
  1057 	*
  1058 	*/
  1059 	IMPORT_C virtual void LoadL(); // Called from 2nd stage constructors
  1060 	/*
  1061 	* This method obtains the current value's setting text
  1062 	*
  1063 	* @return	Reference to descriptor with the text 
  1064 	*/
  1065 	IMPORT_C virtual const TDesC& SettingTextL();
  1066 	/**
  1067 	*
  1068 	* This launches the setting page for IP address editing
  1069 	*
  1070 	* @param		aCalledFromMenu - ignored in this class
  1071 	*
  1072 	*/
  1073 	IMPORT_C virtual void EditItemL( TBool aCalledFromMenu );
  1074 private:
  1075 	IMPORT_C void CAknSettingItem_Reserved();
  1076 
  1077 private:
  1078 	TInetAddr& iExternalIpAddress;
  1079 	TInetAddr iInternalIpAddress;
  1080 	HBufC* iInternalText; // Owned
  1081 	TPtr iInternalTextPtr;
  1082 	};
  1083 
  1084 /**
  1085 * Base class for a data object to hold a pointer and a corresponding integer value.
  1086 * This is used to make a template class by CAknEnumeratedItem
  1087 *
  1088 */
  1089 class CAknEnumeratedItemBase : public CBase
  1090 	{
  1091 public:
  1092 	/**
  1093 	* Construct an item consisting of an integer value and its co-ordinate pointer
  1094 	*/
  1095 	IMPORT_C CAknEnumeratedItemBase( TInt aEnumeratedValue, TAny* aValue );
  1096 	/**
  1097 	* Destructor
  1098 	*/
  1099 	IMPORT_C ~CAknEnumeratedItemBase();
  1100 	/** 
  1101 	* Access the integer value
  1102 	*
  1103 	* @return the integer value of this item
  1104 	*/
  1105 	IMPORT_C TInt EnumerationValue() const;
  1106 	/**
  1107 	* Set the integer part of the object
  1108 	*
  1109 	* @param aNewValue	Value to set
  1110 	*/
  1111 	IMPORT_C void SetEnumerationValue( TInt aNewValue );
  1112 	/**
  1113 	* Access the pointer part of the object
  1114 	*
  1115 	* @return TAny* pointer to any type
  1116 	*/
  1117 	IMPORT_C TAny* Value() const;
  1118 	/**
  1119 	* Set the pointer part of the object
  1120 	*
  1121 	* @param	pointer to store in the object; no copy model, no ownership transfer
  1122 	*/
  1123 	IMPORT_C void SetValue( TAny* aPtr );
  1124 private:
  1125 	TInt iEnumerationValue;
  1126 	TAny* iValue;
  1127 	};
  1128 
  1129 
  1130 /**
  1131 * Makes a template class from CAknEnumeratedItemBase
  1132 *
  1133 */
  1134 template <class T>
  1135 class CAknEnumeratedItem : public CAknEnumeratedItemBase
  1136 	{
  1137 public:
  1138 	inline CAknEnumeratedItem( TInt aEnumeratedValue, T* aValue );
  1139 	inline ~CAknEnumeratedItem();
  1140 	inline T* Value();
  1141 	inline void SetValue( T* );
  1142 	};
  1143 
  1144 
  1145 template <class T>
  1146 inline CAknEnumeratedItem<T>::CAknEnumeratedItem( TInt aEnumValue, T* aValue ) : 
  1147 	CAknEnumeratedItemBase( aEnumValue, (TAny*)aValue)
  1148 	{
  1149 	}
  1150 
  1151 template <class T>
  1152 inline CAknEnumeratedItem<T>::~CAknEnumeratedItem()
  1153 	{
  1154 	delete (T*)Value();
  1155 	}
  1156 
  1157 template <class T>
  1158 inline T* CAknEnumeratedItem<T>::Value()
  1159 	{
  1160 	return ( ( T* ) CAknEnumeratedItemBase::Value() );
  1161 	}
  1162 
  1163 template <class T>
  1164 inline void CAknEnumeratedItem<T>::SetValue( T* aNewValue )
  1165 	{
  1166 	CAknEnumeratedItemBase::SetValue( aNewValue );
  1167 	}
  1168 
  1169 
  1170 
  1171 /**
  1172 * Definition of CAknEnumeratedText
  1173 */
  1174 typedef CAknEnumeratedItem<HBufC> CAknEnumeratedText;
  1175 
  1176 
  1177 
  1178 /**
  1179 * CAknEnumeratedTextSettingItem
  1180 * 
  1181 * Abstract Base class for deriving listbox setting page related setting items
  1182 * 
  1183 * The class provides standard array support for these setting items and their
  1184 * listboxes. Then approach is centred upon the CAknEnumeratedText type. 
  1185 *
  1186 * The texts are exposed to the user, and appear in two versions, if desired - the text shown
  1187 * in the setting list when not being edited, and the "popped-up" version of the texts.
  1188 * 
  1189 */
  1190 class CAknEnumeratedTextSettingItem : public CAknSettingItem
  1191 	{
  1192 public:
  1193 	/**
  1194 	* Constructor.  Resource Id for the setting item
  1195 	*
  1196 	*/
  1197 	IMPORT_C CAknEnumeratedTextSettingItem( TInt aResourceId );
  1198 
  1199 	/**
  1200 	* Destructor
  1201 	*/
  1202 	IMPORT_C ~CAknEnumeratedTextSettingItem();
  1203 
  1204 //
  1205 // From CAknSettingItem
  1206 //
  1207 protected:
  1208 
  1209 	/**
  1210 	*
  1211 	* Virtual method called by framework to complete the construction.  
  1212 	* In this class, the two arrays, pointers to which can be obtained by calling 
  1213 	* EnumeratedTextArray() and PoppedUpTextArray() are created.
  1214 	*
  1215 	*/
  1216 	IMPORT_C void CompleteConstructionL();
  1217 
  1218 private:
  1219 	IMPORT_C void CAknSettingItem_Reserved();
  1220 
  1221 public:
  1222 
  1223 	/**
  1224 	* Access to the enumerated text array. Texts here are used in the setting item list
  1225 	* display.
  1226 	* No ownership of the array or its contents is transferred
  1227 	*
  1228 	* @return a pointer to an array of HBufC*s
  1229 	*/
  1230 	IMPORT_C CArrayPtr<CAknEnumeratedText>* EnumeratedTextArray() const;
  1231 
  1232 	/**
  1233 	* Access to the "popped up" array of texts. They may be defined differently from 
  1234 	* those in the enumerated text array so that the setting page items can be different
  1235 	* from those displayed in the setting item editing list
  1236 	* No ownership of the array or its contents is transferred
  1237 	*
  1238 	* @return a pointer to an array of HBufC*s
  1239 	*/
  1240 	IMPORT_C CArrayPtr<HBufC>* PoppedUpTextArray() const;
  1241 
  1242 	/**
  1243 	* Set the enumerated arrays. 
  1244 	* Ownership of these arrays and their contents is wholly given over to the setting item 
  1245 	* object. The client must call HandleTextArrayUpdateL() after making this call.
  1246 	* 
  1247 	* After calling SetEnumeratedTextArrays(), it is the client code's responsibility to ensure that 
  1248 	* the current value of the external Tint value corresponds to one of the enumerated texts. This can
  1249 	* be done, for instance, after calling SetEnumeratedTextArrays() by calling IndexFromValue() and
  1250 	* ensuring a return value of a valid index (not -1 ). Otherwise, there will be a panic in 
  1251 	* HandleTextArrayUpdateL() when it is called.
  1252 	* 
  1253 	* This call transfers the ownership of the arrays, and the items pointed to by the arrays
  1254 	* 
  1255 	* @param	aEnumeratedTextArray	array of Integer-Text pairs to be the new basis for display
  1256 	*			This is the master array, and its Count() determines the number of entries to display
  1257 	* @param	aPoppedUpTextArray		array of Text descriptors that provide versions of the text
  1258 	*			to display in the setting page listbox. The array pointer must be valid, but the 
  1259 	*			array need not contain any entries. Only those entries that need to be different
  1260 	*			from those in aEnumeratedTextArray needs be present; 
  1261 	*/
  1262 	IMPORT_C void SetEnumeratedTextArrays( CArrayPtr<CAknEnumeratedText>* aEnumeratedTextArray,
  1263 													CArrayPtr<HBufC>* PoppedUpTextArray );
  1264 	/**
  1265 	* Called to execute any code that might need to run when the text arrays are replaced.
  1266 	* This class has a null implementation
  1267 	*
  1268 	*/
  1269 	IMPORT_C virtual void HandleTextArrayUpdateL();
  1270 	
  1271 	/** 
  1272 	* Access to the number of items in the arrays
  1273 	*
  1274 	* @return	The number of items in the array returned by EnumeratedTextArray()
  1275 	*/
  1276 	IMPORT_C TInt NumberOfItems() const;
  1277 
  1278 	/**
  1279 	* Routine to find the index in the enumerated text list that corresponds to the value
  1280 	* passed in. 
  1281 	*
  1282 	* @param	aInputValue		value to search for in the enumerated items
  1283 	* @return	0 - based index in the item found. -1 if not found.
  1284 	*
  1285 	*/
  1286 	IMPORT_C TInt IndexFromValue( TInt aInputValue ) const;
  1287 
  1288 protected:
  1289 
  1290 	/**
  1291 	* Implementors of subclasses can call this non-virtual method to set up the list of texts
  1292 	* to be used for the setting page. (Although it is not useful for CAknCheckBoxSettingPage)
  1293 	* The list is constructed from the contents of the two 
  1294 	* text arrays, EnumeratedTextArray() and PoppedUpTextArray(). This is usually to be done 
  1295 	* "On the fly" immediately prior to the raising of a setting page. 
  1296 	*/
  1297 	IMPORT_C void SetSettingPageTextL();
  1298 
  1299 	/** 
  1300 	* Accessor for the setting page text array
  1301 	*/
  1302 	IMPORT_C CDesCArray* SettingPageTextArray() const;
  1303 
  1304 private:
  1305 
  1306 	/**
  1307 	* The primary text arrays (those set by SetEnumeratedTextArrays) are deleted and their 
  1308 	* references zeroed.
  1309 	*/
  1310 	void DeleteAndZeroPrimaryArrays();
  1311 
  1312 private:
  1313 	TInt iTextPopupFlags;
  1314 	CArrayPtr<CAknEnumeratedText>* iEnumeratedTextArray; // Owned and pointed to objects are owned
  1315 	CArrayPtr<HBufC>* iPoppedUpTextArray; // Owned and the HBufCs are owned here
  1316 	TInt iEnumeratedTextArrayResourceId;
  1317 	TInt iPoppedUpTextArrayResourceId;
  1318 	CDesCArrayFlat* iSettingPageText; // Owned
  1319 	HBufC* iSpare; // Formerly space was used by iEmptyText;
  1320 	};
  1321 
  1322 
  1323 
  1324 /**
  1325 * Setting item type for CAknEnumeratedItems. 
  1326 * 
  1327 * The main use case for this is for list of texts that are being manipulated in the 
  1328 * client source code as a set of enumerations, while the texts, read from resource, 
  1329 * are not strongly exposed to the client.
  1330 *
  1331 * They are exposed to the user, and appear in two versions, if desired - the text shown
  1332 * in the setting list when not being edited, and the "popped-up" version of the texts.
  1333 *
  1334 */
  1335 class CAknEnumeratedTextPopupSettingItem : public CAknEnumeratedTextSettingItem
  1336 	{
  1337 public:
  1338 	/**
  1339 	* Construct a list, storing in it a resource (to be read at 2nd stage construction)
  1340 	* and a reference to na externally owned integer - the value to be manipulated
  1341 	*
  1342 	*/
  1343 	IMPORT_C CAknEnumeratedTextPopupSettingItem( TInt aResourceId, TInt& aValue );
  1344 
  1345 	/**
  1346 	* Destructor
  1347 	*/
  1348 	IMPORT_C ~CAknEnumeratedTextPopupSettingItem();
  1349 	
  1350 	/**
  1351 	* This command externalizes the current setting.  The displayed (internal) copy
  1352 	* is transferred to the external copy (the one referenced in the constructor).
  1353 	*
  1354 	* This must be called by the client if he wants this to happen. Note that StoreAllL() 
  1355 	* on the setting item list will call this for each setting item.
  1356 	*/
  1357 	IMPORT_C virtual void StoreL();
  1358 
  1359 	/*
  1360 	* The external value is transferred to the internal value
  1361 	* This occurs at construction, but may be called by client code when required.
  1362 	*/
  1363 	IMPORT_C virtual void LoadL(); 
  1364 
  1365 	/*
  1366 	* This method obtains the current value's setting text
  1367 	*
  1368 	* @return	Reference to descriptor with the text 
  1369 	*/
  1370 	IMPORT_C virtual const TDesC& SettingTextL();
  1371 	/**
  1372 	*
  1373 	* This launches the setting page for popup list setting page 
  1374 	*
  1375 	* @param		aCalledFromMenu - ignored in this class
  1376 	*
  1377 	*/
  1378 	IMPORT_C virtual void EditItemL( TBool aCalledFromMenu );
  1379 
  1380 public:
  1381 	/**
  1382 	* Access to the enumerated text array. Texts here are used in the setting item list
  1383 	* display.
  1384 	*
  1385 	* @return a pointer to an array of HBufC*s
  1386 	*/
  1387 	IMPORT_C CArrayPtr<CAknEnumeratedText>* EnumeratedTextArray() const;
  1388 
  1389 	/**
  1390 	* Access to the "popped up" array of texts. They may be defined differently from 
  1391 	* those in the enumerated text arry
  1392 	*
  1393 	* @return a pointer to an array of HBufC*s
  1394 	*/
  1395 	IMPORT_C CArrayPtr<HBufC>* PoppedUpTextArray() const;
  1396 
  1397 protected:
  1398 	/**
  1399 	* Framework method for constructing the launching setting page
  1400 	* @return	a constructed CAknSettingPage object on the heap
  1401 	*/
  1402 	IMPORT_C virtual CAknSettingPage* CreateSettingPageL();
  1403 
  1404 	/**
  1405 	* Framework method to create and execute setting page
  1406 	*/
  1407 	IMPORT_C virtual void CreateAndExecuteSettingPageL();
  1408 
  1409 	/**
  1410 	* Method called by framework to complete the construction. Extra allocations of
  1411 	* memory or extra resource reading can happen here.
  1412 	*
  1413 	*/
  1414 	IMPORT_C virtual void CompleteConstructionL();
  1415 
  1416 	/**
  1417 	* Sets the value of the (unowned) external value using the reference to it held 
  1418 	* internally. 
  1419 	* Note that this does not change the value of the reference itself.  
  1420 	* That is, aNewValue's address is not copied in to be used as the external reference.
  1421 	* @param	aNewValue	Value to be copied via the external reference.  
  1422 	*/
  1423 	IMPORT_C void SetExternalValue( TInt aNewValue );
  1424 	/** 
  1425 	* Sets the internal value. The value of aNewValue is copied into the internal storage
  1426 	* holding the internal value
  1427 	* @param aNewValue
  1428 	*/ 
  1429 	IMPORT_C void SetInternalValue( TInt aNewValue );
  1430 
  1431 	/**
  1432 	* Set the item that is selected in the associated popup. This should be done so
  1433 	* as to keep the selected index consistent with the internal value
  1434 	*
  1435 	* @param aNewIndex
  1436 	*/
  1437 	IMPORT_C void SetSelectedIndex( TInt aNewIndex );
  1438 
  1439 	/**
  1440 	* Returns the index in the enumerated item array, given the value of the enumeration 
  1441 	*
  1442 	* @param aInputValue	Value to look up; Returns -1 if value is not found
  1443 	*/
  1444 	IMPORT_C TInt IndexFromValue( TInt aInputValue ) const ;
  1445 	
  1446 	/**
  1447 	* Get the external value 
  1448 	* @return	TInt
  1449 	*/
  1450 	IMPORT_C TInt ExternalValue() const;
  1451 	/**
  1452 	* Access the internal value
  1453 	* @return	TInt
  1454 	*/
  1455 	IMPORT_C TInt InternalValue() const;
  1456 	/**
  1457 	* Return a reference to the MAknQueryValue that is constructed for the CAknPopupListSettingPage
  1458 	* @return MAknQueryValue
  1459 	*/
  1460 	IMPORT_C MAknQueryValue* QueryValue() const;
  1461 private:
  1462 	IMPORT_C void CAknSettingItem_Reserved();
  1463 
  1464 private:
  1465 	void SetSettingPageTextL();
  1466 	void CreateTextArrayL();
  1467 	void CreateQueryValueL();
  1468 	void UpdateInternalValuesL();
  1469 	/**
  1470 	*
  1471 	* This routine looks at the current enumeration values and returns the next integer
  1472 	* higher than the highest enumeration. For internal use only, although it is possible
  1473 	* that clients or derivers might want to use somthing like it.
  1474 	*
  1475 	* @return a new unique value that can be used for extending the enumeration
  1476 	*/
  1477 	TInt FindNextEnumerationValue() const;
  1478 
  1479 private:
  1480 	TInt& iExternalValue;
  1481 	TInt iInternalValue;
  1482 	TInt iNumberOfItems;
  1483 	TInt iSelectedIndex;
  1484 	CAknQueryValueText* iQueryValue;
  1485 	CAknQueryValueTextArray* iQueryTextArray; 
  1486 	TInt iSpare_EnumeratedTextPopup_1;
  1487 	};
  1488 
  1489 
  1490 class CAknBinaryPopupSettingItem : public CAknEnumeratedTextPopupSettingItem
  1491 	{
  1492 public:
  1493 	/**
  1494 	* Constructs a binary setting value, given a resource id and a reference to
  1495 	* an externally owned external boolen setting item.
  1496 	* Resource supplied is just as for CAknEnumeratedTextPopupSettingItem
  1497 	*
  1498 	* @param aIdentifier	Resource id for the associated values and texts; 
  1499 	*
  1500 	*/
  1501 	IMPORT_C CAknBinaryPopupSettingItem( TInt aIdentifier, TBool& aBinaryValue );
  1502 
  1503 	/**
  1504 	* This command externalizes the current setting. The displayed (internal) copy
  1505 	* is transferred to the external copy (the one referenced in the constructor).
  1506 	*
  1507 	* This must be called by the client if he wants this to happen.  Note that StoreAllL() 
  1508 	* on the setting item list will call this for each setting item.
  1509 	*/
  1510 	IMPORT_C virtual void StoreL();
  1511 	/*
  1512 	* The external value is transferred to the internal value
  1513 	* This occurs at construction, but may be called by client code when required.
  1514 	*/
  1515 	IMPORT_C virtual void LoadL(); 
  1516 	/**
  1517 	*
  1518 	* This launches the setting page (or just toggles) the binary setting
  1519 	*
  1520 	* @param		aCalledFromMenu - This flag determines if the setting page actually
  1521 	*				launches or not. It does not if this flag is EFalse - the value is just toggled
  1522 	*
  1523 	*/
  1524 	IMPORT_C virtual void EditItemL( TBool aCalledFromMenu );
  1525 
  1526 protected:
  1527 	/**
  1528 	* Method called by framework to complete the construction. Extra allocations of
  1529 	* memory or extra resource reading can happen here.
  1530 	*
  1531 	*/
  1532 	IMPORT_C virtual void CompleteConstructionL();
  1533 private:
  1534 	IMPORT_C void CAknSettingItem_Reserved();
  1535 private:
  1536 	TAny* iUnused;
  1537 	};
  1538 
  1539 
  1540 /**
  1541  * This class can be used as a base class for "Big Settings". The additional 
  1542  * functionality is small - merely to ensure that there is an empty string
  1543  * in the list box text.
  1544  * 
  1545  * To derive from this class, the client code is usually expected to add a new constructor,
  1546  * re-implement StoreL, LoadL() and EditItemL().
  1547  *
  1548  */
  1549 class CAknBigSettingItemBase : public CAknSettingItem
  1550 	{
  1551 public:
  1552 	/**
  1553 	* Contruct the "Big" setting item. The passed resource identifier all that is needed
  1554 	* There is no external value to reference.
  1555 	*/
  1556 	IMPORT_C CAknBigSettingItemBase( TInt aIdentifier );
  1557 
  1558 protected: 
  1559 	/*
  1560 	* This method obtains the current value's setting text
  1561 	*
  1562 	* @return	Reference to descriptor with the text 
  1563 	*/
  1564 	IMPORT_C virtual const TDesC& SettingTextL();
  1565 private:
  1566 	IMPORT_C void CAknSettingItem_Reserved();
  1567 
  1568 private:
  1569 	const TDesC& iEmptyString;
  1570 
  1571 	};
  1572 
  1573 
  1574 /**
  1575  * This class holds the setting items themselves and also manages the bitmap array
  1576  */
  1577 class CAknSettingItemArray : public CArrayPtrFlat<CAknSettingItem>, public MDesCArray
  1578 	{
  1579 public:
  1580 	/**
  1581 	* CAknSettingItemArray is constructed as a numbered or unnumbered array.
  1582 	* @param aGranularity	- number of items to extend when the aarray needs extention
  1583 	* @param aIsNumbered	- flags the array as numbered or not
  1584 	* @param aInitialOrdinal - value to start the numbering at
  1585 	*/
  1586 	IMPORT_C CAknSettingItemArray( TInt aGranularity, TBool aIsNumbered, TInt aInitialOrdinal );
  1587 	/**
  1588 	* Destructor
  1589 	*/
  1590 	IMPORT_C virtual ~CAknSettingItemArray();
  1591 
  1592 	// from MDesC16Array
  1593 	/**
  1594 	* Method by which the CAknSetStyleListBox accesses the number of items in the array
  1595 	* @return	number of items in the array
  1596 	*/ 
  1597 	IMPORT_C TInt MdcaCount() const;
  1598 	/**
  1599 	* Method by which the setting item list accesses the text for the aIndex-th item in the 
  1600 	* array.
  1601 	*
  1602 	* @param	aIndex	index at which to access the listbox text
  1603 	* @return	Descriptor for this item to be used by the listbox.
  1604 	*/
  1605 	IMPORT_C TPtrC16 MdcaPoint(TInt aIndex) const;
  1606 	// For hidden item support
  1607 	/**
  1608 	* This method returns the true index in the array given the index as would be 
  1609 	* calculated by looking at the visible items. 
  1610 	*
  1611 	* @param aVisibleIndex	- index among the visible items
  1612 	* @return the corresponding "true" index in the array
  1613 	*/
  1614 	IMPORT_C TInt ItemIndexFromVisibleIndex( TInt aVisibleIndex ) const;
  1615 	/**
  1616 	* Update date the mapping of visible indices. To be called when an item is made
  1617 	* visible or invisible.
  1618 	* 
  1619 	*/
  1620 	IMPORT_C virtual void RecalculateVisibleIndicesL();
  1621 	/**
  1622 	* This is used to update the initial setting number for the top index.  The number set 
  1623 	* is the for the 0-th "true" or data index. That is, this numbered item may not show up
  1624 	*
  1625 	*/
  1626 	IMPORT_C void SetInitialOrdinal( TInt aInitialOrdinal );
  1627 	/*
  1628 	* Method used to transfer flags from the CAknSettingItemList to this array
  1629 	*/
  1630 	IMPORT_C void SetFlags( TInt aFlags );
  1631 protected:
  1632 
  1633 	/** 
  1634 	* Set the number of visible items. 
  1635 	* @param aCount	number of items that are visible.
  1636 	*/
  1637 	IMPORT_C void SetVisibleCount( TInt aCount );
  1638 	/**
  1639 	* Returns the number of visible items
  1640 	*
  1641 	* @return the number of visible items
  1642 	*/
  1643 	IMPORT_C TInt VisibleCount() const;
  1644 
  1645 private:
  1646 	TBool iIsNumbered;
  1647 	TInt iInitialOrdinal;
  1648 	TInt iVisibleCount;
  1649 	TInt iFlags;
  1650 	};
  1651 
  1652 
  1653 class CAknSettingItemList : public CAknControl , public MEikListBoxObserver
  1654     {
  1655 public:
  1656 	enum TAknSettingItemStyle
  1657 	{
  1658 	ENumberedStyle,		// The setting item list displays number
  1659 	EUnnumberedStyle	// The setting item list does not disply number
  1660 	};
  1661 
  1662 public:
  1663 	/**
  1664 	* Constructs the setting item list
  1665 	*/
  1666 	IMPORT_C CAknSettingItemList();
  1667 	/**
  1668 	* Destructor
  1669 	*/
  1670 	IMPORT_C ~CAknSettingItemList();
  1671 
  1672 	// From CCoeControl
  1673 	/**
  1674 	* 2nd-stage construction from resource id
  1675 	*/
  1676 	IMPORT_C void ConstructFromResourceL(TInt aResourceId );
  1677 	/**
  1678 	* 2nd-stage construction from constructed resource reader
  1679 	*/
  1680 	IMPORT_C void ConstructFromResourceL( TResourceReader& aReader );
  1681 
  1682 	/**
  1683 	* @return the number of component controls
  1684 	*/ 
  1685 	IMPORT_C TInt CountComponentControls() const;
  1686 	/**
  1687 	* @param TInt aId
  1688 	* @return  a reference to the component control at index aId
  1689 	*/
  1690 	IMPORT_C CCoeControl* ComponentControl(TInt aId ) const;
  1691 
  1692 	/**
  1693 	* Handles keys sent to this control
  1694 	*/
  1695 	IMPORT_C virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
  1696 	/**
  1697 	* Take action necessary when the focus is change
  1698 	*/
  1699 	IMPORT_C virtual void FocusChanged(TDrawNow aDrawNow);
  1700 
  1701     /**
  1702     * Handles a change to the control's resources of type aType
  1703     * which are shared across the environment, e.g. colors or fonts.
  1704     *
  1705     * @since 2.0
  1706     * @param aType  Reason for the "resource" change, usually an system event UID
  1707     */
  1708 	IMPORT_C void HandleResourceChange(TInt aType);
  1709 
  1710 // from MEikListBoxObserver
  1711 	IMPORT_C virtual void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
  1712 
  1713 public:
  1714 	// Framework methods
  1715 	/**
  1716 	*
  1717 	* This launches the setting page for the current item by calling EditItemL on it
  1718 	*
  1719 	* @param		aIndex			- current item's (Visible) index in the list
  1720 	*				aCalledFromMenu- ignored in most classes; may alter the behaviour
  1721 	*									of the setting page
  1722 	*/
  1723 	IMPORT_C virtual void EditItemL(TInt aIndex, TBool aCalledFromMenu);
  1724 	/**
  1725 	*
  1726 	* Calls LoadL() on each item in the MAknSettingItemArray. 
  1727 	*
  1728 	*/
  1729 	IMPORT_C virtual void LoadSettingsL();
  1730 	/**
  1731 	* This command calls StoreL on all the setting items (hidden or not)
  1732 	*
  1733 	* This must be called by the client if he wants it to occur
  1734 	*/
  1735 	IMPORT_C virtual void StoreSettingsL(); //  call StoreL() on each item in MAknSettingItemArray
  1736 
  1737 	/**
  1738 	* @param	aInclude	If EFalse, numbering does not include hidden items
  1739 	*						Otherwise, they are
  1740 	*/
  1741 	IMPORT_C void SetIncludeHiddenInOrdinal( TBool aInclude );
  1742 
  1743 	/** 
  1744 	* @return	EFalse if the listbox is not numbered style; Not EFalse otherwise
  1745 	*/
  1746 	IMPORT_C TBool IsNumberedStyle();
  1747 	/**
  1748 	* @return	the listbox used by setting item list
  1749 	*/
  1750 	IMPORT_C CEikFormattedCellListBox* ListBox(); // get the listbox
  1751 	/**
  1752 	* @return	a pointer to the setting item array; No ownership is transferred
  1753 	*/
  1754 	IMPORT_C CAknSettingItemArray* SettingItemArray() const;
  1755 	/**
  1756 	* Method to be called when the client code has added or removed items or their visibility;
  1757 	* This should be called when a single event's batch of array or visibility changes
  1758 	* is complete in order to avoid more re-draws than is necessary
  1759 	*/
  1760 	IMPORT_C void HandleChangeInItemArrayOrVisibilityL();
  1761     /**
  1762      * From CCoeControl.     
  1763      * Handles pointer events
  1764      */
  1765     IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
  1766 
  1767 protected:
  1768 	/**
  1769 	* Framework method to create a setting item based upon the user id aSettingId. The 
  1770 	* client code decides what type to contruct. new (ELeave) must then be used and the resulting 
  1771 	* pointer returned. Ownership is thereafter base class's responsiblity.
  1772 	*
  1773 	* @param aSettingId	ID to use to determine the type of the setting item
  1774 	* @return a constructed (not 2nd-stage constructed) setting item.
  1775 	*/
  1776 	IMPORT_C virtual CAknSettingItem* CreateSettingItemL( TInt aSettingId );
  1777 private:
  1778     /**
  1779     * From CAknControl
  1780     */
  1781     IMPORT_C void* ExtensionInterface( TUid aInterface );
  1782 
  1783 private:
  1784     void UpdateAllListBoxTextsL() const;
  1785 
  1786 private:
  1787 
  1788 	// Owned objects:
  1789 	CEikFormattedCellListBox* iSettingItemListBox;
  1790 	CAknSettingItemArray* iSettingItemArray;
  1791 
  1792 	// Other non-CBase classes 
  1793 	HBufC* iSettingItemListTitle;	// Owned
  1794 
  1795 	// Internal information
  1796 	TInt iFlags;
  1797 	TInt iInitialOrdinal;
  1798 
  1799 	TInt iSpare_1;
  1800 	TInt iSpare_2;
  1801 };
  1802 
  1803 
  1804 
  1805 
  1806 #endif