epoc32/include/mw/aknradiobuttonsettingpage.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
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@2
     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
williamr@2
     6
* which accompanies this distribution, and is available
williamr@2
     7
* at the URL "http://www.symbianfoundation.org/legal/licencesv10.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
*	  Support for Radio Button setting page 
williamr@2
    16
*
williamr@2
    17
*/
williamr@2
    18
williamr@2
    19
williamr@2
    20
#ifndef __AKNRADIOBUTTONSETTINGPAGE_H__
williamr@2
    21
#define __AKNRADIOBUTTONSETTINGPAGE_H__ 
williamr@2
    22
williamr@2
    23
// For coecontrol
williamr@2
    24
#include <coecntrl.h>
williamr@2
    25
#include <eikdef.h>
williamr@2
    26
williamr@2
    27
#include <aknlistboxsettingpage.h>
williamr@2
    28
williamr@2
    29
class CAknRadioButtonSettingPageExtension;
williamr@2
    30
williamr@2
    31
/** 
williamr@2
    32
*  This class sets out a radio button listbox within a setting page.
williamr@2
    33
*  
williamr@2
    34
*/
williamr@2
    35
class CAknRadioButtonSettingPage : public CAknListBoxSettingPage
williamr@2
    36
{
williamr@2
    37
public:
williamr@2
    38
	IMPORT_C CAknRadioButtonSettingPage(
williamr@2
    39
		TInt aResourceID, 
williamr@2
    40
		TInt& aCurrentSelectionIndex, 
williamr@2
    41
		const MDesCArray* aItemArray );
williamr@2
    42
 /**
williamr@2
    43
 * Constructor that allows separate setting page and editor resources
williamr@2
    44
 *
williamr@2
    45
 * In all cases the number (if supplied i.e. <> 0 ) is used.  
williamr@2
    46
 *
williamr@2
    47
 *		Editor Resource 	Setting Page Resource
williamr@2
    48
 *			present 			present 			Both are used (but text & number overridden)
williamr@2
    49
 *			 = 0				present 			Editor resource is used via SP resource
williamr@2
    50
 *			present 			= 0 				Default Avkon SP resource if used
williamr@2
    51
 *			 = 0				= 0 				Not permitted 
williamr@2
    52
 *
williamr@2
    53
 * Note: The first argument is a TDesC* (rather than TDesC&) because the other constructor
williamr@2
    54
 * cannot initialize such a member without allocation or having an internal dummy buffer.
williamr@2
    55
 * Note that the setting title provided here must be owned by the client.
williamr@2
    56
 *
williamr@2
    57
 * Rules for text and numbers: The rules are the same for both: (non-zero length) text or number other 
williamr@2
    58
 * than EAknSettingPageNoOrdinalDisplayed if given in this constructor will not override resource 
williamr@2
    59
 * (unless that is zero length or EAknSettingPageNoOrdinalDisplayed). Note, however, that text or number given via the 
williamr@2
    60
 * specific API for setting them, WILL override resource.
williamr@2
    61
 * It is assumed that number from resource is very rare.  Special text is somewhat more likely.
williamr@2
    62
 * 
williamr@2
    63
 * @param aSettingTitleText Text at top of setting pane; EXTERNALLY OWNED
williamr@2
    64
 * @param aSettingNumber		Number at top left (if present)
williamr@2
    65
 * @param aControlType			Determines the type constructed and how its resource is read
williamr@2
    66
 * @param aEditorResourceId Editor resource to use in the setting page (if present)
williamr@2
    67
 * @param aSettingPageResourceId		Setting Page to use (if present)
williamr@2
    68
 * @param aCurrentSelectionIndex	The currently selected index
williamr@2
    69
 * @param aItemArray			List of option texts and their selection states
williamr@2
    70
 */
williamr@2
    71
	IMPORT_C CAknRadioButtonSettingPage(	const TDesC* aSettingTitleText, 
williamr@2
    72
								TInt aSettingNumber, 
williamr@2
    73
								TInt aControlType,
williamr@2
    74
								TInt aEditorResourceId, 
williamr@2
    75
								TInt aSettingPageResourceId,
williamr@2
    76
								TInt& aCurrentSelectionIndex, 
williamr@2
    77
								const MDesCArray* aItemArray );
williamr@2
    78
williamr@2
    79
	/** 
williamr@2
    80
	* 2nd stage contruction for this type.  Calls CAknSettingPage::BaseConstuctL() where the object is constructed
williamr@2
    81
	* from resource.
williamr@2
    82
	*/
williamr@2
    83
	IMPORT_C virtual void ConstructL();
williamr@2
    84
williamr@2
    85
	/** 
williamr@2
    86
	* Type specific access to the hosted "editor"
williamr@2
    87
	*
williamr@2
    88
	* @return	pointer to contained listbox
williamr@2
    89
	*/
williamr@2
    90
	IMPORT_C CAknSetStyleListBox* ListBoxControl() const; 
williamr@2
    91
williamr@2
    92
	/** 
williamr@2
    93
	* From MEikListBoxObserver
williamr@2
    94
	* @param	listbox generating the event
williamr@2
    95
	* @param	type of listbox event
williamr@2
    96
	*/
williamr@2
    97
	IMPORT_C virtual void HandleListBoxEventL(CEikListBox* aListBox,
williamr@2
    98
				 MEikListBoxObserver::TListBoxEvent aEventType);
williamr@2
    99
williamr@2
   100
	/**
williamr@2
   101
	* Method to update the item array after a change in content and to re-select 
williamr@2
   102
	* the "pushed in" index
williamr@2
   103
	* @param CDesCArrayFlat*	aItemArray	The new item array; array of texts
williamr@2
   104
	* @param TInt					aPushed		A valid 0-based index.  -1 is also legal
williamr@2
   105
	* indicating nothing is pushed
williamr@2
   106
	*/
williamr@2
   107
	IMPORT_C void SetItemArrayAndSelectionL( const MDesCArray* aItemArray, TInt aPushed );
williamr@2
   108
williamr@2
   109
    /**
williamr@2
   110
    * From CCoeControl 
williamr@2
   111
    * Handles Radiobuttonlist's PointerEvent 
williamr@2
   112
    *    
williamr@2
   113
    * @param aPointerEvent PointerEvent to be handled
williamr@2
   114
    */     
williamr@2
   115
    IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
williamr@2
   116
    
williamr@2
   117
    IMPORT_C void HandleResourceChange(TInt aType);
williamr@2
   118
williamr@2
   119
protected:
williamr@2
   120
/**
williamr@2
   121
* C++ destructor
williamr@2
   122
*/
williamr@2
   123
	IMPORT_C virtual ~CAknRadioButtonSettingPage();
williamr@2
   124
williamr@2
   125
/**
williamr@2
   126
* Called when the external setting is to be updated
williamr@2
   127
*/
williamr@2
   128
	IMPORT_C virtual void UpdateSettingL();
williamr@2
   129
williamr@2
   130
/**
williamr@2
   131
* Called immediately prior to activation, but after all construction
williamr@2
   132
*/
williamr@2
   133
	IMPORT_C void DynamicInitL();
williamr@2
   134
williamr@2
   135
/**
williamr@2
   136
 * This method overrides the default implementation in order to do the special 
williamr@2
   137
 * processing of selecting an item
williamr@2
   138
 *
williamr@2
   139
 */
williamr@2
   140
	IMPORT_C virtual void SelectCurrentItemL();
williamr@2
   141
williamr@2
   142
private:
williamr@2
   143
	/**
williamr@2
   144
	* Method to move the selection to position aPushed
williamr@2
   145
	*
williamr@2
   146
	*/
williamr@2
   147
	void SetRadioButtonSelectionL( TInt aPushed );
williamr@2
   148
williamr@2
   149
	/**
williamr@2
   150
	* Internal method to re-generate the internal, "decorated" text array used in the
williamr@2
   151
	* real listbox. 
williamr@2
   152
	*/
williamr@2
   153
	void GenerateInternalArrayAndGiveToListBoxL();
williamr@2
   154
williamr@2
   155
    void InitialiseRadioButtonBitmapsL();
williamr@2
   156
williamr@2
   157
//
williamr@2
   158
// CoeControl Framework and reserved methods
williamr@2
   159
//
williamr@2
   160
protected:
williamr@2
   161
williamr@2
   162
/**
williamr@2
   163
 * Writes the internal state of the control and its components to aStream.
williamr@2
   164
 * Does nothing in release mode.
williamr@2
   165
 * Designed to be overidden and base called by subclasses.
williamr@2
   166
 *
williamr@2
   167
 * @param	aWriteSteam		A connected write stream
williamr@2
   168
 */	
williamr@2
   169
	IMPORT_C virtual void WriteInternalStateL(RWriteStream& aWriteStream) const;
williamr@2
   170
williamr@2
   171
private: 
williamr@2
   172
/**
williamr@2
   173
 *	Reserved method derived from CCoeControl
williamr@2
   174
 */
williamr@2
   175
	IMPORT_C virtual void Reserved_2();
williamr@2
   176
williamr@2
   177
private:
williamr@2
   178
    /**
williamr@2
   179
    * From CAknControl
williamr@2
   180
    */
williamr@2
   181
    IMPORT_C void* ExtensionInterface( TUid aInterface );
williamr@2
   182
williamr@2
   183
/**
williamr@2
   184
 * New reserved methods for CAknSettingPage hierarchy
williamr@2
   185
 */ 
williamr@2
   186
private: 
williamr@2
   187
	IMPORT_C virtual void CAknSettingPage_Reserved_1();
williamr@2
   188
	IMPORT_C virtual void CAknSettingPage_Reserved_2();
williamr@2
   189
williamr@2
   190
private:
williamr@2
   191
/**
williamr@2
   192
 * New reserved method from CAknListBoxSettingPage 
williamr@2
   193
 *
williamr@2
   194
 */
williamr@2
   195
	IMPORT_C virtual void CAknListBoxSettingPage_Reserved_1();
williamr@2
   196
williamr@2
   197
williamr@2
   198
private:
williamr@2
   199
	// Back up copy of the selection index
williamr@2
   200
	TInt iOldSelectionIndex;
williamr@2
   201
	
williamr@2
   202
	// Extension, replaces CDesCArrayFlat* iInternalItemArray
williamr@2
   203
	CAknRadioButtonSettingPageExtension* iExtension;
williamr@2
   204
williamr@2
   205
	// The objects pointed to or referenced by these are not owned
williamr@2
   206
	TInt& iCurrentSelectionIndex; 
williamr@2
   207
	const MDesCArray* iItemArray; 
williamr@2
   208
williamr@2
   209
};
williamr@2
   210
williamr@2
   211
#endif