|
1 /* |
|
2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * Interface for Volume setting page |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef __AKNVOLUMESETTINGPAGE_H__ |
|
21 #define __AKNVOLUMESETTINGPAGE_H__ |
|
22 |
|
23 // For coecontrol |
|
24 #include <coecntrl.h> |
|
25 |
|
26 // General eikon |
|
27 #include <eikdef.h> |
|
28 |
|
29 // For CBA stuff |
|
30 #include <eikbtgpc.h> |
|
31 |
|
32 // Avkon controls |
|
33 #include "Aknvolumecontrol.h" |
|
34 #include "aknsettingpage.h" |
|
35 |
|
36 |
|
37 class CAknVolumeSettingPage : public CAknSettingPage |
|
38 { |
|
39 public: |
|
40 /** |
|
41 * Simple constructor depending only on a single resource Id and a scalar reference |
|
42 * |
|
43 * @param aSettingPageResourceId Setting Page to use (if present) |
|
44 * @param aVolume Reference to external integer volume |
|
45 */ |
|
46 IMPORT_C CAknVolumeSettingPage(TInt aResourceID, TInt& aVolume); |
|
47 |
|
48 /** |
|
49 * Constructor that allows separate setting page and editor resources |
|
50 * |
|
51 * This constructor allows the use of setting page using only the editor resource. Other combinations are also possible |
|
52 * |
|
53 * In all cases the number (if supplied i.e. <> 0 ) is used. |
|
54 * |
|
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 ) |
|
62 * |
|
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. |
|
65 * |
|
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. |
|
71 * |
|
72 * |
|
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 |
|
79 */ |
|
80 |
|
81 IMPORT_C CAknVolumeSettingPage( const TDesC* aSettingTitleText, |
|
82 TInt aSettingNumber, |
|
83 TInt aControlType, |
|
84 TInt aEditorResourceId, |
|
85 TInt aSettingPageResourceId, |
|
86 TInt& aVolume ); |
|
87 |
|
88 /** |
|
89 * From CCoeControl |
|
90 */ |
|
91 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
92 |
|
93 protected: |
|
94 |
|
95 /** |
|
96 * C++ destructor |
|
97 */ |
|
98 IMPORT_C virtual ~CAknVolumeSettingPage(); |
|
99 |
|
100 /** |
|
101 * Normal 2-nd stage construction. Internally calls |
|
102 * CAknSettingPage::ConstructFromResourceL and |
|
103 * CAknSettingPage::BaseConstructL() |
|
104 * |
|
105 */ |
|
106 IMPORT_C virtual void ConstructL(); |
|
107 /** |
|
108 * |
|
109 * Type-specific access to the editor. Returns 0 until BaseConstructL() has been called, |
|
110 * usually from within ExecuteLD() |
|
111 * |
|
112 */ |
|
113 IMPORT_C CAknVolumeControl* VolumeControl(); |
|
114 |
|
115 // |
|
116 // CoeControl Framework methods |
|
117 // |
|
118 protected: |
|
119 |
|
120 IMPORT_C virtual void SizeChanged(); |
|
121 IMPORT_C virtual void Draw(const TRect &aRect) const; |
|
122 /** |
|
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. |
|
126 * |
|
127 * @param aWriteSteam A connected write stream |
|
128 */ |
|
129 IMPORT_C virtual void WriteInternalStateL(RWriteStream& aWriteStream) const; |
|
130 |
|
131 private: |
|
132 /** |
|
133 * Reserved method derived from CCoeControl |
|
134 */ |
|
135 IMPORT_C virtual void Reserved_2(); |
|
136 |
|
137 private: |
|
138 /** |
|
139 * From CAknControl |
|
140 */ |
|
141 IMPORT_C void* ExtensionInterface( TUid aInterface ); |
|
142 |
|
143 // |
|
144 // Framework methods from CAknSettingPage |
|
145 // |
|
146 protected: |
|
147 |
|
148 /** |
|
149 * Called when something has changed and the client's object needs to have its value updated |
|
150 * |
|
151 */ |
|
152 IMPORT_C virtual void UpdateSettingL(); |
|
153 |
|
154 /** |
|
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 |
|
157 */ |
|
158 IMPORT_C virtual void AcceptSettingL(); |
|
159 |
|
160 /** |
|
161 * Called when the user rejects the setting. A backup copy may need to be restored if UpdateWhenChanged flag was set |
|
162 * |
|
163 */ |
|
164 IMPORT_C virtual void RestoreOriginalSettingL(); |
|
165 |
|
166 /** |
|
167 * New reserved methods for CAknSettingPage hierarchy |
|
168 */ |
|
169 private: |
|
170 IMPORT_C virtual void CAknSettingPage_Reserved_1(); |
|
171 IMPORT_C virtual void CAknSettingPage_Reserved_2(); |
|
172 |
|
173 private: |
|
174 TInt& iVolume; |
|
175 TInt iBackupVolume; |
|
176 }; |
|
177 |
|
178 #endif |