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:
|
williamr@2
|
15 |
* Interface for Volume setting page
|
williamr@2
|
16 |
*
|
williamr@2
|
17 |
*/
|
williamr@2
|
18 |
|
williamr@2
|
19 |
|
williamr@2
|
20 |
#ifndef __AKNVOLUMESETTINGPAGE_H__
|
williamr@2
|
21 |
#define __AKNVOLUMESETTINGPAGE_H__
|
williamr@2
|
22 |
|
williamr@2
|
23 |
// For coecontrol
|
williamr@2
|
24 |
#include <coecntrl.h>
|
williamr@2
|
25 |
|
williamr@2
|
26 |
// General eikon
|
williamr@2
|
27 |
#include <eikdef.h>
|
williamr@2
|
28 |
|
williamr@2
|
29 |
// For CBA stuff
|
williamr@2
|
30 |
#include <eikbtgpc.h>
|
williamr@2
|
31 |
|
williamr@2
|
32 |
// Avkon controls
|
williamr@4
|
33 |
#include "Aknvolumecontrol.h"
|
williamr@2
|
34 |
#include "aknsettingpage.h"
|
williamr@2
|
35 |
|
williamr@2
|
36 |
|
williamr@2
|
37 |
class CAknVolumeSettingPage : public CAknSettingPage
|
williamr@2
|
38 |
{
|
williamr@2
|
39 |
public:
|
williamr@2
|
40 |
/**
|
williamr@2
|
41 |
* Simple constructor depending only on a single resource Id and a scalar reference
|
williamr@2
|
42 |
*
|
williamr@2
|
43 |
* @param aSettingPageResourceId Setting Page to use (if present)
|
williamr@2
|
44 |
* @param aVolume Reference to external integer volume
|
williamr@2
|
45 |
*/
|
williamr@2
|
46 |
IMPORT_C CAknVolumeSettingPage(TInt aResourceID, TInt& aVolume);
|
williamr@2
|
47 |
|
williamr@2
|
48 |
/**
|
williamr@2
|
49 |
* Constructor that allows separate setting page and editor resources
|
williamr@2
|
50 |
*
|
williamr@2
|
51 |
* This constructor allows the use of setting page using only the editor resource. Other combinations are also possible
|
williamr@2
|
52 |
*
|
williamr@2
|
53 |
* In all cases the number (if supplied i.e. <> 0 ) is used.
|
williamr@2
|
54 |
*
|
williamr@2
|
55 |
* Editor Resource Setting Page Resource
|
williamr@2
|
56 |
* present present Both are used (but text & number overridden)
|
williamr@2
|
57 |
* = 0 present Editor resource is used via SP resource (Effectively like the other constructor)
|
williamr@2
|
58 |
* present = 0 Default Avkon SP resource if used + this editor resource
|
williamr@2
|
59 |
* = 0 = 0 uses default resource for both SP and editor. This is OK if:
|
williamr@2
|
60 |
* i) control type is present,
|
williamr@2
|
61 |
* ii) a default resource exists ( OK for text, integer, date, time, duration )
|
williamr@2
|
62 |
*
|
williamr@2
|
63 |
* Note: THe first argument is a TDesC* (rather than TDesC&) because the other constructor
|
williamr@2
|
64 |
* cannot initialize such a member without allocation or having an internal dummy buffer.
|
williamr@2
|
65 |
*
|
williamr@2
|
66 |
* Rules for text and numbers: The rules are the same for both: (non-zero length) text or number other
|
williamr@2
|
67 |
* than EAknSettingPageNoOrdinalDisplayed if given in this constructor will not override resource
|
williamr@2
|
68 |
* (unless that is zero length or EAknSettingPageNoOrdinalDisplayed). Note, however, that text or number given via the
|
williamr@2
|
69 |
* specific API for setting them, WILL override resource.
|
williamr@2
|
70 |
* It is assumed that number from resource is very rare. Special text is somewhat more likely.
|
williamr@2
|
71 |
*
|
williamr@2
|
72 |
*
|
williamr@2
|
73 |
* @param aSettingTitleText Text at top of setting pane
|
williamr@2
|
74 |
* @param aSettingNumber Number at top left (if present)
|
williamr@2
|
75 |
* @param aControlType Determines the type constructed and how its resource is read
|
williamr@2
|
76 |
* @param aEditorResourceId Editor resource to use in the setting page (if present)
|
williamr@2
|
77 |
* @param aSettingPageResourceId Setting Page to use (if present)
|
williamr@2
|
78 |
* @param aVolume Reference to integer holding the volume
|
williamr@2
|
79 |
*/
|
williamr@2
|
80 |
|
williamr@2
|
81 |
IMPORT_C CAknVolumeSettingPage( const TDesC* aSettingTitleText,
|
williamr@2
|
82 |
TInt aSettingNumber,
|
williamr@2
|
83 |
TInt aControlType,
|
williamr@2
|
84 |
TInt aEditorResourceId,
|
williamr@2
|
85 |
TInt aSettingPageResourceId,
|
williamr@2
|
86 |
TInt& aVolume );
|
williamr@2
|
87 |
|
williamr@2
|
88 |
/**
|
williamr@2
|
89 |
* From CCoeControl
|
williamr@2
|
90 |
*/
|
williamr@2
|
91 |
IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
|
williamr@2
|
92 |
|
williamr@2
|
93 |
protected:
|
williamr@2
|
94 |
|
williamr@2
|
95 |
/**
|
williamr@2
|
96 |
* C++ destructor
|
williamr@2
|
97 |
*/
|
williamr@2
|
98 |
IMPORT_C virtual ~CAknVolumeSettingPage();
|
williamr@2
|
99 |
|
williamr@2
|
100 |
/**
|
williamr@2
|
101 |
* Normal 2-nd stage construction. Internally calls
|
williamr@2
|
102 |
* CAknSettingPage::ConstructFromResourceL and
|
williamr@2
|
103 |
* CAknSettingPage::BaseConstructL()
|
williamr@2
|
104 |
*
|
williamr@2
|
105 |
*/
|
williamr@2
|
106 |
IMPORT_C virtual void ConstructL();
|
williamr@2
|
107 |
/**
|
williamr@2
|
108 |
*
|
williamr@2
|
109 |
* Type-specific access to the editor. Returns 0 until BaseConstructL() has been called,
|
williamr@2
|
110 |
* usually from within ExecuteLD()
|
williamr@2
|
111 |
*
|
williamr@2
|
112 |
*/
|
williamr@2
|
113 |
IMPORT_C CAknVolumeControl* VolumeControl();
|
williamr@2
|
114 |
|
williamr@2
|
115 |
//
|
williamr@2
|
116 |
// CoeControl Framework methods
|
williamr@2
|
117 |
//
|
williamr@2
|
118 |
protected:
|
williamr@2
|
119 |
|
williamr@2
|
120 |
IMPORT_C virtual void SizeChanged();
|
williamr@2
|
121 |
IMPORT_C virtual void Draw(const TRect &aRect) const;
|
williamr@2
|
122 |
/**
|
williamr@2
|
123 |
* Writes the internal state of the control and its components to aStream.
|
williamr@2
|
124 |
* Does nothing in release mode.
|
williamr@2
|
125 |
* Designed to be overidden and base called by subclasses.
|
williamr@2
|
126 |
*
|
williamr@2
|
127 |
* @param aWriteSteam A connected write stream
|
williamr@2
|
128 |
*/
|
williamr@2
|
129 |
IMPORT_C virtual void WriteInternalStateL(RWriteStream& aWriteStream) const;
|
williamr@2
|
130 |
|
williamr@2
|
131 |
private:
|
williamr@2
|
132 |
/**
|
williamr@2
|
133 |
* Reserved method derived from CCoeControl
|
williamr@2
|
134 |
*/
|
williamr@2
|
135 |
IMPORT_C virtual void Reserved_2();
|
williamr@2
|
136 |
|
williamr@2
|
137 |
private:
|
williamr@2
|
138 |
/**
|
williamr@2
|
139 |
* From CAknControl
|
williamr@2
|
140 |
*/
|
williamr@2
|
141 |
IMPORT_C void* ExtensionInterface( TUid aInterface );
|
williamr@2
|
142 |
|
williamr@2
|
143 |
//
|
williamr@2
|
144 |
// Framework methods from CAknSettingPage
|
williamr@2
|
145 |
//
|
williamr@2
|
146 |
protected:
|
williamr@2
|
147 |
|
williamr@2
|
148 |
/**
|
williamr@2
|
149 |
* Called when something has changed and the client's object needs to have its value updated
|
williamr@2
|
150 |
*
|
williamr@2
|
151 |
*/
|
williamr@2
|
152 |
IMPORT_C virtual void UpdateSettingL();
|
williamr@2
|
153 |
|
williamr@2
|
154 |
/**
|
williamr@2
|
155 |
* Called when the user accepts a setting and the setting page is about to be dismissed. The latest value of the
|
williamr@2
|
156 |
* setting is written to the client's object
|
williamr@2
|
157 |
*/
|
williamr@2
|
158 |
IMPORT_C virtual void AcceptSettingL();
|
williamr@2
|
159 |
|
williamr@2
|
160 |
/**
|
williamr@2
|
161 |
* Called when the user rejects the setting. A backup copy may need to be restored if UpdateWhenChanged flag was set
|
williamr@2
|
162 |
*
|
williamr@2
|
163 |
*/
|
williamr@2
|
164 |
IMPORT_C virtual void RestoreOriginalSettingL();
|
williamr@2
|
165 |
|
williamr@2
|
166 |
/**
|
williamr@2
|
167 |
* New reserved methods for CAknSettingPage hierarchy
|
williamr@2
|
168 |
*/
|
williamr@2
|
169 |
private:
|
williamr@2
|
170 |
IMPORT_C virtual void CAknSettingPage_Reserved_1();
|
williamr@2
|
171 |
IMPORT_C virtual void CAknSettingPage_Reserved_2();
|
williamr@2
|
172 |
|
williamr@2
|
173 |
private:
|
williamr@2
|
174 |
TInt& iVolume;
|
williamr@2
|
175 |
TInt iBackupVolume;
|
williamr@2
|
176 |
};
|
williamr@2
|
177 |
|
williamr@2
|
178 |
#endif
|