2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
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
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
15 * Interface for Volume setting page
20 #ifndef __AKNVOLUMESETTINGPAGE_H__
21 #define __AKNVOLUMESETTINGPAGE_H__
33 #include "aknvolumecontrol.h"
34 #include "aknsettingpage.h"
37 class CAknVolumeSettingPage : public CAknSettingPage
41 * Simple constructor depending only on a single resource Id and a scalar reference
43 * @param aSettingPageResourceId Setting Page to use (if present)
44 * @param aVolume Reference to external integer volume
46 IMPORT_C CAknVolumeSettingPage(TInt aResourceID, TInt& aVolume);
49 * Constructor that allows separate setting page and editor resources
51 * This constructor allows the use of setting page using only the editor resource. Other combinations are also possible
53 * In all cases the number (if supplied i.e. <> 0 ) is used.
55 * Editor Resource Setting Page Resource
56 * present present Both are used (but text & number overridden)
57 * = 0 present Editor resource is used via SP resource (Effectively like the other constructor)
58 * present = 0 Default Avkon SP resource if used + this editor resource
59 * = 0 = 0 uses default resource for both SP and editor. This is OK if:
60 * i) control type is present,
61 * ii) a default resource exists ( OK for text, integer, date, time, duration )
63 * Note: THe first argument is a TDesC* (rather than TDesC&) because the other constructor
64 * cannot initialize such a member without allocation or having an internal dummy buffer.
66 * Rules for text and numbers: The rules are the same for both: (non-zero length) text or number other
67 * than EAknSettingPageNoOrdinalDisplayed if given in this constructor will not override resource
68 * (unless that is zero length or EAknSettingPageNoOrdinalDisplayed). Note, however, that text or number given via the
69 * specific API for setting them, WILL override resource.
70 * It is assumed that number from resource is very rare. Special text is somewhat more likely.
73 * @param aSettingTitleText Text at top of setting pane
74 * @param aSettingNumber Number at top left (if present)
75 * @param aControlType Determines the type constructed and how its resource is read
76 * @param aEditorResourceId Editor resource to use in the setting page (if present)
77 * @param aSettingPageResourceId Setting Page to use (if present)
78 * @param aVolume Reference to integer holding the volume
81 IMPORT_C CAknVolumeSettingPage( const TDesC* aSettingTitleText,
84 TInt aEditorResourceId,
85 TInt aSettingPageResourceId,
91 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
98 IMPORT_C virtual ~CAknVolumeSettingPage();
101 * Normal 2-nd stage construction. Internally calls
102 * CAknSettingPage::ConstructFromResourceL and
103 * CAknSettingPage::BaseConstructL()
106 IMPORT_C virtual void ConstructL();
109 * Type-specific access to the editor. Returns 0 until BaseConstructL() has been called,
110 * usually from within ExecuteLD()
113 IMPORT_C CAknVolumeControl* VolumeControl();
116 // CoeControl Framework methods
120 IMPORT_C virtual void SizeChanged();
121 IMPORT_C virtual void Draw(const TRect &aRect) const;
123 * Writes the internal state of the control and its components to aStream.
124 * Does nothing in release mode.
125 * Designed to be overidden and base called by subclasses.
127 * @param aWriteSteam A connected write stream
129 IMPORT_C virtual void WriteInternalStateL(RWriteStream& aWriteStream) const;
133 * Reserved method derived from CCoeControl
135 IMPORT_C virtual void Reserved_2();
141 IMPORT_C void* ExtensionInterface( TUid aInterface );
144 // Framework methods from CAknSettingPage
149 * Called when something has changed and the client's object needs to have its value updated
152 IMPORT_C virtual void UpdateSettingL();
155 * Called when the user accepts a setting and the setting page is about to be dismissed. The latest value of the
156 * setting is written to the client's object
158 IMPORT_C virtual void AcceptSettingL();
161 * Called when the user rejects the setting. A backup copy may need to be restored if UpdateWhenChanged flag was set
164 IMPORT_C virtual void RestoreOriginalSettingL();
167 * New reserved methods for CAknSettingPage hierarchy
170 IMPORT_C virtual void CAknSettingPage_Reserved_1();
171 IMPORT_C virtual void CAknSettingPage_Reserved_2();