epoc32/include/mw/aknlistboxsettingpage.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
*  Pure virtual class for a common ancestor for setting pages with listboxes
williamr@2
    16
*
williamr@2
    17
*/
williamr@2
    18
williamr@2
    19
williamr@2
    20
#ifndef __AKNLISTBOXSETTINGPAGE_H__
williamr@2
    21
#define __AKNLISTBOXSETTINGPAGE_H__ 
williamr@2
    22
williamr@2
    23
#include <aknsettingpage.h>
williamr@2
    24
williamr@2
    25
#include <aknutils.h>
williamr@2
    26
#include <eikslb.h>
williamr@2
    27
#include <eiklbo.h>
williamr@2
    28
#include <eiklbx.h>
williamr@2
    29
#include <eikclb.h>
williamr@2
    30
#include <eikclbd.h>
williamr@2
    31
#include <eiktxlbm.h>
williamr@2
    32
#include <coecobs.h>
williamr@2
    33
#include <aknlists.h>
williamr@2
    34
williamr@2
    35
/**
williamr@2
    36
*
williamr@2
    37
* Intermediate setting page class to soak up common listbox setting page code
williamr@2
    38
* 
williamr@2
    39
* This class has the responsibility of performing the listbox layout and setting
williamr@2
    40
* out some  of the API for listbox setting pages.
williamr@2
    41
*
williamr@2
    42
*/
williamr@2
    43
class CAknListBoxSettingPage : public CAknSettingPage, public MEikListBoxObserver
williamr@2
    44
	{
williamr@2
    45
williamr@2
    46
public: 
williamr@2
    47
	/**
williamr@2
    48
	* Type-specific control access method with a null implementation
williamr@2
    49
	*
williamr@2
    50
	*/
williamr@2
    51
	virtual CAknSetStyleListBox* ListBoxControl() const = 0;
williamr@2
    52
williamr@2
    53
	/**
williamr@2
    54
	* Default empty implementation of the listbox observer handling routine
williamr@2
    55
	*/
williamr@2
    56
	IMPORT_C virtual void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
williamr@2
    57
williamr@2
    58
protected:
williamr@2
    59
williamr@2
    60
	/**
williamr@2
    61
	* Pass-through constructor
williamr@2
    62
	* @param aSettingPageResourceId		resource id for CAknSettingPage::BaseConstructL()
williamr@2
    63
	*
williamr@2
    64
	*/
williamr@2
    65
	CAknListBoxSettingPage( TInt aSettingPageResourceId );
williamr@2
    66
williamr@2
    67
	/**
williamr@2
    68
	* Pass-through constructor 
williamr@2
    69
	*
williamr@2
    70
	* Generic constructor allowing either editor-resource constuction or setting page
williamr@2
    71
	* resource based constuction
williamr@2
    72
	* In all cases the number (if supplied i.e. <> 0 ) is used.  
williamr@2
    73
	*
williamr@2
    74
	*		Editor Resource 	Setting Page Resource
williamr@2
    75
	*			present 			present 			Both are used (but text & number overridden)
williamr@2
    76
	*			 = 0				present 			Editor resource is used via SP resource
williamr@2
    77
	*			present 			= 0 				Default Avkon SP resource if used
williamr@2
    78
	*			 = 0				= 0 				Not permitted 
williamr@2
    79
	*
williamr@2
    80
	* Note: THe first argument is a TDesC* (rather than TDesC&) because the other constructor
williamr@2
    81
	* cannot initialize such a member without allocation or having an internal dummy buffer.
williamr@2
    82
	* Note that the setting title provided here must be owned by the client.
williamr@2
    83
	*
williamr@2
    84
	* Rules for text and numbers: The rules are the same for both:  (non-zero length) text or number other 
williamr@2
    85
	* than EAknSettingPageNoOrdinalDisplayed if given in this constructor will not override resource 
williamr@2
    86
	* (unless that is zero length or EAknSettingPageNoOrdinalDisplayed).  Note, however, that text or number given via the 
williamr@2
    87
	* specific API for setting them, WILL override resource.
williamr@2
    88
	* It is assumed that number from resource is very rare.  Special text is somewhat more likely.
williamr@2
    89
	* 
williamr@2
    90
	* @param aSettingTitleText	externally-owned title text
williamr@2
    91
	* @param aSettingNumber		the setting number to be displayed
williamr@2
    92
	* @param aControlType		control type enumeration for the control to be constructed by type
williamr@2
    93
	* @param aEditorResourceId	resource Id at which to read the control's resource
williamr@2
    94
	* @param aSettingPageResourceId optional setting page resource Id; See notes above about resource combinations
williamr@2
    95
	*/
williamr@2
    96
	CAknListBoxSettingPage(	const TDesC* aSettingTitleText, 
williamr@2
    97
								TInt aSettingNumber, 
williamr@2
    98
								TInt aControlType,
williamr@2
    99
								TInt aEditorResourceId, 
williamr@2
   100
								TInt aSettingPageResourceId = 0 );
williamr@2
   101
williamr@2
   102
williamr@2
   103
   /**
williamr@2
   104
	* This standard implementation uses ListBoxControl to access the listbox and 
williamr@2
   105
	* check the number of items.  If 0, validity is set to EFalse
williamr@2
   106
	*
williamr@2
   107
	*/
williamr@2
   108
	IMPORT_C void CheckAndSetDataValidity();
williamr@2
   109
williamr@2
   110
	/**
williamr@2
   111
	* Implementation to remove go to "invalid" cba when data is invalid
williamr@2
   112
	*/
williamr@2
   113
	IMPORT_C void UpdateCbaL();
williamr@2
   114
williamr@2
   115
williamr@2
   116
	/**
williamr@2
   117
	* From CCoeControl:
williamr@2
   118
	* Routine called by Cone framework whenever there has been a size change on this 
williamr@2
   119
	* control
williamr@2
   120
	*/
williamr@2
   121
	IMPORT_C void SizeChanged();
williamr@2
   122
williamr@2
   123
	/** 
williamr@2
   124
	* From CCoeControl:
williamr@2
   125
	* Common draw routine for the listboxes
williamr@2
   126
	*
williamr@2
   127
	* @param aRect	rectangle within which to draw
williamr@2
   128
	*/
williamr@2
   129
	IMPORT_C void Draw(const TRect& aRect) const;
williamr@2
   130
williamr@2
   131
    //
williamr@2
   132
    // New methods in this class
williamr@2
   133
    //
williamr@2
   134
    
williamr@2
   135
    /**
williamr@2
   136
    * Obtain initial selection policy for popup setting item editing
williamr@2
   137
    *
williamr@2
   138
    * @since 2.0
williamr@2
   139
    * @return TBool EFalse iff focus is not initially to be set to the selected item
williamr@2
   140
    */
williamr@2
   141
    static TBool FocusToSelectedItem();
williamr@2
   142
williamr@2
   143
    /**
williamr@2
   144
    * Obtain initial selection policy for popup setting item editing
williamr@2
   145
    *
williamr@2
   146
    * @since 2.0
williamr@2
   147
    * @return TBool EFalse iff focus is initially to be set to the selected item
williamr@2
   148
    */
williamr@2
   149
    static TBool FocusToFirstItem();
williamr@2
   150
            
williamr@2
   151
williamr@2
   152
    /**
williamr@2
   153
    * Create colorskinned icon and add it to icon array. Utility for
williamr@2
   154
    * radiobutton, popup & checkbox setting page lists
williamr@2
   155
    *
williamr@2
   156
    * @since 3.1
williamr@2
   157
    */
williamr@2
   158
public:
williamr@2
   159
    static void CreateIconAndAddToArrayL( CArrayPtr<CGulIcon>*& aIconArray,
williamr@2
   160
                                          const TAknsItemID& aId,
williamr@2
   161
                                          const TInt aColorIndex,
williamr@2
   162
                                          const TDesC& aBmpFile,
williamr@2
   163
                                          const TInt32 aBmp,
williamr@2
   164
                                          const TInt32 aBmpM );        
williamr@2
   165
williamr@2
   166
private:
williamr@2
   167
/**
williamr@2
   168
 */
williamr@2
   169
	IMPORT_C virtual void CAknListBoxSettingPage_Reserved_1();
williamr@2
   170
williamr@2
   171
protected:
williamr@2
   172
williamr@2
   173
	/**
williamr@2
   174
	* Layout for the extra piece of white (sometimes) at the bottom of the listbox
williamr@2
   175
	*
williamr@2
   176
	*/
williamr@2
   177
	TAknLayoutRect iAreaExtension;
williamr@2
   178
	};
williamr@2
   179
williamr@2
   180
#endif