epoc32/include/mw/aknslidersettingpage.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
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@4
     5
* under the terms of "Eclipse Public License v1.0"
williamr@2
     6
* which accompanies this distribution, and is available
williamr@4
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.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:  Slider Setting Page
williamr@2
    15
*
williamr@2
    16
*/
williamr@2
    17
williamr@2
    18
williamr@2
    19
#ifndef __AKNSLIDERSETTINGPAGE__
williamr@2
    20
#define __AKNSLIDERSETTINGPAGE__ 
williamr@2
    21
williamr@2
    22
// For coecontrol
williamr@2
    23
#include <coecntrl.h>
williamr@2
    24
williamr@2
    25
#include <eikdef.h>
williamr@2
    26
#include <eikbtgpc.h>
williamr@2
    27
#include <aknslider.h>
williamr@2
    28
#include <aknsettingpage.h>
williamr@2
    29
williamr@2
    30
class CAknSliderSettingPage : public CAknSettingPage
williamr@2
    31
{
williamr@2
    32
public:
williamr@2
    33
	/**
williamr@2
    34
	 * Simple constructor depending only on a single resource Id. Editor resource is given via
williamr@2
    35
	 * the link in the setting page resource.
williamr@2
    36
	 *
williamr@2
    37
	 * @param aSettingPageResourceId		Setting Page to use (if present)
williamr@2
    38
	 * @param aSliderValue					ref. to external slider value
williamr@2
    39
	 */
williamr@2
    40
	IMPORT_C CAknSliderSettingPage(TInt aResourceID, TInt& aSliderValue);
williamr@2
    41
williamr@2
    42
	/**
williamr@2
    43
	 * Constructor that allows separate setting page and editor resources
williamr@2
    44
	 * 
williamr@2
    45
	 * This constructor allows the use of setting page using only the editor resource.  Other combinations are also possible
williamr@2
    46
	 *
williamr@2
    47
	 * In all cases the number (if supplied i.e. <> 0 ) is used.  
williamr@2
    48
	 *
williamr@2
    49
	 *		Editor Resource		Setting Page Resource
williamr@2
    50
	 *			present				present				Both are used (but text & number overridden)
williamr@2
    51
	 *			 = 0					present				Editor resource is used via SP resource (Effectively like the other constructor)
williamr@2
    52
	 *			present				= 0					Default Avkon SP resource if used + this editor resource
williamr@2
    53
	 *			 = 0					= 0					uses default resource for both SP and editor. This is OK if:
williamr@2
    54
	 *	 i) control type is present, 
williamr@2
    55
	 *  ii) a default resource exists ( OK for text, integer, date, time, duration )
williamr@2
    56
	 *
williamr@2
    57
	 * Note: THe first argument is a TDesC* (rather than TDesC&) because the other constructor
williamr@2
    58
	 * cannot initialize such a member without allocation or having an internal dummy buffer.
williamr@2
    59
	 *
williamr@2
    60
	 * Rules for text and numbers: The rules are the same for both:  (non-zero length) text or number other 
williamr@2
    61
	 * than EAknSettingPageNoOrdinalDisplayed if given in this constructor will not override resource 
williamr@2
    62
	 * (unless that is zero length or EAknSettingPageNoOrdinalDisplayed).  Note, however, that text or number given via the 
williamr@2
    63
	 * specific API for setting them, WILL override resource.
williamr@2
    64
	 * It is assumed that number from resource is very rare.  Special text is somewhat more likely.
williamr@2
    65
	 * 
williamr@2
    66
	 *
williamr@2
    67
	 * @param aSettingTitleText		Text at top of setting pane (not copied to object until ExecuteLD is called)
williamr@2
    68
	 * @param aSettingNumber		Number at top left (if present)
williamr@2
    69
	 * @param aControlType			Determines the type constructed and how its resource is read
williamr@2
    70
	 * @param aEditorResourceId	Editor resource to use in the setting page (if present)
williamr@2
    71
	 * @param aSettingPageResourceId		Setting Page to use (if present)
williamr@2
    72
	 * @param aSliderValue			Reference to integer holding the slider value
williamr@2
    73
	 */
williamr@2
    74
williamr@2
    75
	IMPORT_C CAknSliderSettingPage(	const TDesC* aSettingTitleText, 
williamr@2
    76
								TInt aSettingNumber, 
williamr@2
    77
								TInt aControlType,
williamr@2
    78
								TInt aEditorResourceId, 
williamr@2
    79
								TInt aSettingPageResourceId,
williamr@2
    80
								TInt& aSliderValue );
williamr@2
    81
/**
williamr@2
    82
 * Access method for the contained slider control. No transfer of ownership
williamr@2
    83
 *
williamr@2
    84
 * @return	Reference ptr to the contained CAknSlider object
williamr@2
    85
 */
williamr@2
    86
	IMPORT_C CAknSlider* SliderControl();
williamr@2
    87
williamr@2
    88
//
williamr@2
    89
// From CAknSettingPage
williamr@2
    90
//
williamr@2
    91
williamr@2
    92
/**
williamr@2
    93
 * 2nd stage contructor
williamr@2
    94
 *
williamr@2
    95
 */
williamr@2
    96
	IMPORT_C virtual void ConstructL();
williamr@2
    97
williamr@2
    98
/**
williamr@2
    99
 *  From CCoeControl
williamr@2
   100
 */
williamr@2
   101
    IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
williamr@2
   102
williamr@2
   103
//
williamr@2
   104
// From CCoeControl
williamr@2
   105
//
williamr@2
   106
protected:
williamr@2
   107
	IMPORT_C virtual void SizeChanged();
williamr@2
   108
	IMPORT_C virtual void Draw(const TRect &aRect) const;
williamr@2
   109
williamr@2
   110
/**
williamr@2
   111
 * Writes the internal state of the control and its components to aStream.
williamr@2
   112
 * Does nothing in release mode.
williamr@2
   113
 * Designed to be overidden and base called by subclasses.
williamr@2
   114
 *
williamr@2
   115
 * @param	aWriteSteam		A connected write stream
williamr@2
   116
 */	
williamr@2
   117
	IMPORT_C virtual void WriteInternalStateL(RWriteStream& aWriteStream) const;
williamr@2
   118
williamr@2
   119
private: 
williamr@2
   120
/**
williamr@2
   121
*	Reserved method derived from CCoeControl
williamr@2
   122
*/
williamr@2
   123
	IMPORT_C virtual void Reserved_2();
williamr@2
   124
williamr@2
   125
private:
williamr@2
   126
    /**
williamr@2
   127
    * From CAknControl
williamr@2
   128
    */
williamr@2
   129
    IMPORT_C void* ExtensionInterface( TUid aInterface );
williamr@2
   130
williamr@2
   131
// 
williamr@2
   132
// Framework methods derived from CAknSettingPage
williamr@2
   133
//
williamr@2
   134
protected:
williamr@2
   135
/**
williamr@2
   136
 * C++ destructor
williamr@2
   137
 *
williamr@2
   138
 */
williamr@2
   139
	IMPORT_C virtual ~CAknSliderSettingPage();
williamr@2
   140
williamr@2
   141
/**
williamr@2
   142
 * Called when something has changed and the client's object needs to have its value updated
williamr@2
   143
 *
williamr@2
   144
 */
williamr@2
   145
	IMPORT_C virtual void UpdateSettingL();
williamr@2
   146
williamr@2
   147
/**
williamr@2
   148
 * Called when the user accepts a setting and the setting page is about to be dismissed.  The latest value of the
williamr@2
   149
 * setting is written to the client's object
williamr@2
   150
 */
williamr@2
   151
	IMPORT_C virtual void AcceptSettingL();
williamr@2
   152
williamr@2
   153
/**
williamr@2
   154
 * Called when the user rejects the setting.  A backup copy may need to be restored if UpdateWhenChanged flag was set
williamr@2
   155
 *
williamr@2
   156
 */
williamr@2
   157
	IMPORT_C virtual void RestoreOriginalSettingL();
williamr@2
   158
williamr@2
   159
/**
williamr@2
   160
 * New reserved methods for CAknSettingPage hierarchy
williamr@2
   161
 */ 
williamr@2
   162
private: 
williamr@2
   163
	IMPORT_C virtual void CAknSettingPage_Reserved_1();
williamr@2
   164
	IMPORT_C virtual void CAknSettingPage_Reserved_2();
williamr@2
   165
williamr@2
   166
private:
williamr@2
   167
	TInt& iSliderValue;
williamr@2
   168
	TInt iBackupSliderValue;
williamr@2
   169
};
williamr@2
   170
williamr@2
   171
#endif 
williamr@2
   172
williamr@2
   173