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