epoc32/include/mw/aknslidersettingpage.h
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
     1.1 --- a/epoc32/include/mw/aknslidersettingpage.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/mw/aknslidersettingpage.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,173 @@
     1.4 -aknslidersettingpage.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:  Slider Setting Page
    1.19 +*
    1.20 +*/
    1.21 +
    1.22 +
    1.23 +#ifndef __AKNSLIDERSETTINGPAGE__
    1.24 +#define __AKNSLIDERSETTINGPAGE__ 
    1.25 +
    1.26 +// For coecontrol
    1.27 +#include <coecntrl.h>
    1.28 +
    1.29 +#include <eikdef.h>
    1.30 +#include <eikbtgpc.h>
    1.31 +#include <aknslider.h>
    1.32 +#include <aknsettingpage.h>
    1.33 +
    1.34 +class CAknSliderSettingPage : public CAknSettingPage
    1.35 +{
    1.36 +public:
    1.37 +	/**
    1.38 +	 * Simple constructor depending only on a single resource Id. Editor resource is given via
    1.39 +	 * the link in the setting page resource.
    1.40 +	 *
    1.41 +	 * @param aSettingPageResourceId		Setting Page to use (if present)
    1.42 +	 * @param aSliderValue					ref. to external slider value
    1.43 +	 */
    1.44 +	IMPORT_C CAknSliderSettingPage(TInt aResourceID, TInt& aSliderValue);
    1.45 +
    1.46 +	/**
    1.47 +	 * Constructor that allows separate setting page and editor resources
    1.48 +	 * 
    1.49 +	 * This constructor allows the use of setting page using only the editor resource.  Other combinations are also possible
    1.50 +	 *
    1.51 +	 * In all cases the number (if supplied i.e. <> 0 ) is used.  
    1.52 +	 *
    1.53 +	 *		Editor Resource		Setting Page Resource
    1.54 +	 *			present				present				Both are used (but text & number overridden)
    1.55 +	 *			 = 0					present				Editor resource is used via SP resource (Effectively like the other constructor)
    1.56 +	 *			present				= 0					Default Avkon SP resource if used + this editor resource
    1.57 +	 *			 = 0					= 0					uses default resource for both SP and editor. This is OK if:
    1.58 +	 *	 i) control type is present, 
    1.59 +	 *  ii) a default resource exists ( OK for text, integer, date, time, duration )
    1.60 +	 *
    1.61 +	 * Note: THe first argument is a TDesC* (rather than TDesC&) because the other constructor
    1.62 +	 * cannot initialize such a member without allocation or having an internal dummy buffer.
    1.63 +	 *
    1.64 +	 * Rules for text and numbers: The rules are the same for both:  (non-zero length) text or number other 
    1.65 +	 * than EAknSettingPageNoOrdinalDisplayed if given in this constructor will not override resource 
    1.66 +	 * (unless that is zero length or EAknSettingPageNoOrdinalDisplayed).  Note, however, that text or number given via the 
    1.67 +	 * specific API for setting them, WILL override resource.
    1.68 +	 * It is assumed that number from resource is very rare.  Special text is somewhat more likely.
    1.69 +	 * 
    1.70 +	 *
    1.71 +	 * @param aSettingTitleText		Text at top of setting pane (not copied to object until ExecuteLD is called)
    1.72 +	 * @param aSettingNumber		Number at top left (if present)
    1.73 +	 * @param aControlType			Determines the type constructed and how its resource is read
    1.74 +	 * @param aEditorResourceId	Editor resource to use in the setting page (if present)
    1.75 +	 * @param aSettingPageResourceId		Setting Page to use (if present)
    1.76 +	 * @param aSliderValue			Reference to integer holding the slider value
    1.77 +	 */
    1.78 +
    1.79 +	IMPORT_C CAknSliderSettingPage(	const TDesC* aSettingTitleText, 
    1.80 +								TInt aSettingNumber, 
    1.81 +								TInt aControlType,
    1.82 +								TInt aEditorResourceId, 
    1.83 +								TInt aSettingPageResourceId,
    1.84 +								TInt& aSliderValue );
    1.85 +/**
    1.86 + * Access method for the contained slider control. No transfer of ownership
    1.87 + *
    1.88 + * @return	Reference ptr to the contained CAknSlider object
    1.89 + */
    1.90 +	IMPORT_C CAknSlider* SliderControl();
    1.91 +
    1.92 +//
    1.93 +// From CAknSettingPage
    1.94 +//
    1.95 +
    1.96 +/**
    1.97 + * 2nd stage contructor
    1.98 + *
    1.99 + */
   1.100 +	IMPORT_C virtual void ConstructL();
   1.101 +
   1.102 +/**
   1.103 + *  From CCoeControl
   1.104 + */
   1.105 +    IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
   1.106 +
   1.107 +//
   1.108 +// From CCoeControl
   1.109 +//
   1.110 +protected:
   1.111 +	IMPORT_C virtual void SizeChanged();
   1.112 +	IMPORT_C virtual void Draw(const TRect &aRect) const;
   1.113 +
   1.114 +/**
   1.115 + * Writes the internal state of the control and its components to aStream.
   1.116 + * Does nothing in release mode.
   1.117 + * Designed to be overidden and base called by subclasses.
   1.118 + *
   1.119 + * @param	aWriteSteam		A connected write stream
   1.120 + */	
   1.121 +	IMPORT_C virtual void WriteInternalStateL(RWriteStream& aWriteStream) const;
   1.122 +
   1.123 +private: 
   1.124 +/**
   1.125 +*	Reserved method derived from CCoeControl
   1.126 +*/
   1.127 +	IMPORT_C virtual void Reserved_2();
   1.128 +
   1.129 +private:
   1.130 +    /**
   1.131 +    * From CAknControl
   1.132 +    */
   1.133 +    IMPORT_C void* ExtensionInterface( TUid aInterface );
   1.134 +
   1.135 +// 
   1.136 +// Framework methods derived from CAknSettingPage
   1.137 +//
   1.138 +protected:
   1.139 +/**
   1.140 + * C++ destructor
   1.141 + *
   1.142 + */
   1.143 +	IMPORT_C virtual ~CAknSliderSettingPage();
   1.144 +
   1.145 +/**
   1.146 + * Called when something has changed and the client's object needs to have its value updated
   1.147 + *
   1.148 + */
   1.149 +	IMPORT_C virtual void UpdateSettingL();
   1.150 +
   1.151 +/**
   1.152 + * Called when the user accepts a setting and the setting page is about to be dismissed.  The latest value of the
   1.153 + * setting is written to the client's object
   1.154 + */
   1.155 +	IMPORT_C virtual void AcceptSettingL();
   1.156 +
   1.157 +/**
   1.158 + * Called when the user rejects the setting.  A backup copy may need to be restored if UpdateWhenChanged flag was set
   1.159 + *
   1.160 + */
   1.161 +	IMPORT_C virtual void RestoreOriginalSettingL();
   1.162 +
   1.163 +/**
   1.164 + * New reserved methods for CAknSettingPage hierarchy
   1.165 + */ 
   1.166 +private: 
   1.167 +	IMPORT_C virtual void CAknSettingPage_Reserved_1();
   1.168 +	IMPORT_C virtual void CAknSettingPage_Reserved_2();
   1.169 +
   1.170 +private:
   1.171 +	TInt& iSliderValue;
   1.172 +	TInt iBackupSliderValue;
   1.173 +};
   1.174 +
   1.175 +#endif 
   1.176 +
   1.177 +