1.1 --- a/epoc32/include/mw/aknlistboxsettingpage.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/mw/aknlistboxsettingpage.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,180 @@
1.4 -aknlistboxsettingpage.h
1.5 +/*
1.6 +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
1.7 +* All rights reserved.
1.8 +* This component and the accompanying materials are made available
1.9 +* 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
1.10 +* which accompanies this distribution, and is available
1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.12 +*
1.13 +* Initial Contributors:
1.14 +* Nokia Corporation - initial contribution.
1.15 +*
1.16 +* Contributors:
1.17 +*
1.18 +* Description:
1.19 +* Pure virtual class for a common ancestor for setting pages with listboxes
1.20 +*
1.21 +*/
1.22 +
1.23 +
1.24 +#ifndef __AKNLISTBOXSETTINGPAGE_H__
1.25 +#define __AKNLISTBOXSETTINGPAGE_H__
1.26 +
1.27 +#include <aknsettingpage.h>
1.28 +
1.29 +#include <aknutils.h>
1.30 +#include <eikslb.h>
1.31 +#include <eiklbo.h>
1.32 +#include <eiklbx.h>
1.33 +#include <eikclb.h>
1.34 +#include <eikclbd.h>
1.35 +#include <eiktxlbm.h>
1.36 +#include <coecobs.h>
1.37 +#include <aknlists.h>
1.38 +
1.39 +/**
1.40 +*
1.41 +* Intermediate setting page class to soak up common listbox setting page code
1.42 +*
1.43 +* This class has the responsibility of performing the listbox layout and setting
1.44 +* out some of the API for listbox setting pages.
1.45 +*
1.46 +*/
1.47 +class CAknListBoxSettingPage : public CAknSettingPage, public MEikListBoxObserver
1.48 + {
1.49 +
1.50 +public:
1.51 + /**
1.52 + * Type-specific control access method with a null implementation
1.53 + *
1.54 + */
1.55 + virtual CAknSetStyleListBox* ListBoxControl() const = 0;
1.56 +
1.57 + /**
1.58 + * Default empty implementation of the listbox observer handling routine
1.59 + */
1.60 + IMPORT_C virtual void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
1.61 +
1.62 +protected:
1.63 +
1.64 + /**
1.65 + * Pass-through constructor
1.66 + * @param aSettingPageResourceId resource id for CAknSettingPage::BaseConstructL()
1.67 + *
1.68 + */
1.69 + CAknListBoxSettingPage( TInt aSettingPageResourceId );
1.70 +
1.71 + /**
1.72 + * Pass-through constructor
1.73 + *
1.74 + * Generic constructor allowing either editor-resource constuction or setting page
1.75 + * resource based constuction
1.76 + * In all cases the number (if supplied i.e. <> 0 ) is used.
1.77 + *
1.78 + * Editor Resource Setting Page Resource
1.79 + * present present Both are used (but text & number overridden)
1.80 + * = 0 present Editor resource is used via SP resource
1.81 + * present = 0 Default Avkon SP resource if used
1.82 + * = 0 = 0 Not permitted
1.83 + *
1.84 + * Note: THe first argument is a TDesC* (rather than TDesC&) because the other constructor
1.85 + * cannot initialize such a member without allocation or having an internal dummy buffer.
1.86 + * Note that the setting title provided here must be owned by the client.
1.87 + *
1.88 + * Rules for text and numbers: The rules are the same for both: (non-zero length) text or number other
1.89 + * than EAknSettingPageNoOrdinalDisplayed if given in this constructor will not override resource
1.90 + * (unless that is zero length or EAknSettingPageNoOrdinalDisplayed). Note, however, that text or number given via the
1.91 + * specific API for setting them, WILL override resource.
1.92 + * It is assumed that number from resource is very rare. Special text is somewhat more likely.
1.93 + *
1.94 + * @param aSettingTitleText externally-owned title text
1.95 + * @param aSettingNumber the setting number to be displayed
1.96 + * @param aControlType control type enumeration for the control to be constructed by type
1.97 + * @param aEditorResourceId resource Id at which to read the control's resource
1.98 + * @param aSettingPageResourceId optional setting page resource Id; See notes above about resource combinations
1.99 + */
1.100 + CAknListBoxSettingPage( const TDesC* aSettingTitleText,
1.101 + TInt aSettingNumber,
1.102 + TInt aControlType,
1.103 + TInt aEditorResourceId,
1.104 + TInt aSettingPageResourceId = 0 );
1.105 +
1.106 +
1.107 + /**
1.108 + * This standard implementation uses ListBoxControl to access the listbox and
1.109 + * check the number of items. If 0, validity is set to EFalse
1.110 + *
1.111 + */
1.112 + IMPORT_C void CheckAndSetDataValidity();
1.113 +
1.114 + /**
1.115 + * Implementation to remove go to "invalid" cba when data is invalid
1.116 + */
1.117 + IMPORT_C void UpdateCbaL();
1.118 +
1.119 +
1.120 + /**
1.121 + * From CCoeControl:
1.122 + * Routine called by Cone framework whenever there has been a size change on this
1.123 + * control
1.124 + */
1.125 + IMPORT_C void SizeChanged();
1.126 +
1.127 + /**
1.128 + * From CCoeControl:
1.129 + * Common draw routine for the listboxes
1.130 + *
1.131 + * @param aRect rectangle within which to draw
1.132 + */
1.133 + IMPORT_C void Draw(const TRect& aRect) const;
1.134 +
1.135 + //
1.136 + // New methods in this class
1.137 + //
1.138 +
1.139 + /**
1.140 + * Obtain initial selection policy for popup setting item editing
1.141 + *
1.142 + * @since 2.0
1.143 + * @return TBool EFalse iff focus is not initially to be set to the selected item
1.144 + */
1.145 + static TBool FocusToSelectedItem();
1.146 +
1.147 + /**
1.148 + * Obtain initial selection policy for popup setting item editing
1.149 + *
1.150 + * @since 2.0
1.151 + * @return TBool EFalse iff focus is initially to be set to the selected item
1.152 + */
1.153 + static TBool FocusToFirstItem();
1.154 +
1.155 +
1.156 + /**
1.157 + * Create colorskinned icon and add it to icon array. Utility for
1.158 + * radiobutton, popup & checkbox setting page lists
1.159 + *
1.160 + * @since 3.1
1.161 + */
1.162 +public:
1.163 + static void CreateIconAndAddToArrayL( CArrayPtr<CGulIcon>*& aIconArray,
1.164 + const TAknsItemID& aId,
1.165 + const TInt aColorIndex,
1.166 + const TDesC& aBmpFile,
1.167 + const TInt32 aBmp,
1.168 + const TInt32 aBmpM );
1.169 +
1.170 +private:
1.171 +/**
1.172 + */
1.173 + IMPORT_C virtual void CAknListBoxSettingPage_Reserved_1();
1.174 +
1.175 +protected:
1.176 +
1.177 + /**
1.178 + * Layout for the extra piece of white (sometimes) at the bottom of the listbox
1.179 + *
1.180 + */
1.181 + TAknLayoutRect iAreaExtension;
1.182 + };
1.183 +
1.184 +#endif