|
1 /* |
|
2 * Copyright (c) 2007 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: Setting page for Image/Video quality.* |
|
15 */ |
|
16 |
|
17 |
|
18 |
|
19 #ifndef GSCAMQUALITYSETTINGPAGE_H |
|
20 #define GSCAMQUALITYSETTINGPAGE_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <aknsettingpage.h> |
|
24 #include "CamSettingsInternal.hrh" |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class CGSCamQualitySettingContainer; |
|
28 class MAknQueryValue; |
|
29 class MCamAppController; |
|
30 |
|
31 // CLASS DECLARATION |
|
32 |
|
33 /** |
|
34 * Setting page for the quality control. This setting page is customised |
|
35 * so that it contains a custom control and not the editor control |
|
36 * supplied by CAknSettingPage. The base class doesn't allow for custom |
|
37 * controls to be used in settings pages, so this class provides this |
|
38 * functionality. |
|
39 * |
|
40 * @since 2.8 |
|
41 */ |
|
42 |
|
43 class CGSCamQualitySettingPage : public CAknSettingPage |
|
44 { |
|
45 public: // Constructors, etc. |
|
46 /** |
|
47 * Construct the quality setting page |
|
48 * @since 2.8 |
|
49 * @param aMode The current capture mode |
|
50 * @param aSettingTitleText Text at top of setting pane |
|
51 * @param aSettingNumber Number at top left (if present) |
|
52 * @param aControlType Determines the type constructed and how its resource is read |
|
53 * @param aEditorResourceId Editor resource to use in the setting page (if present) |
|
54 * @param aSettingPageResourceId Setting Page to use (if present) |
|
55 * @param aQueryValue reference to a query value object |
|
56 */ |
|
57 CGSCamQualitySettingPage( TCamCameraMode aMode, |
|
58 TDesC& aSettingTitleText, |
|
59 TInt aSettingNumber, |
|
60 TInt aControlType, |
|
61 TInt aEditorResourceId, |
|
62 TInt aSettingPageResourceId, |
|
63 MAknQueryValue& aQueryValue ); |
|
64 |
|
65 /** |
|
66 * Destructor |
|
67 * @since 2.8 |
|
68 */ |
|
69 ~CGSCamQualitySettingPage(); |
|
70 |
|
71 /** |
|
72 * Symbian 2nd phase constructor. |
|
73 * @since 2.8 |
|
74 */ |
|
75 void ConstructL(); |
|
76 |
|
77 public: // Functions from base classes |
|
78 |
|
79 /** |
|
80 * From CAknSettingPage |
|
81 * Called when the state of the quality control changes. |
|
82 * Used to preview the new setting value |
|
83 * @since 2.8 |
|
84 */ |
|
85 void UpdateSettingL(); |
|
86 |
|
87 /** |
|
88 * From CAknSettingPage |
|
89 * Processes events from the softkeys. Responds to EAknSoftkeyOk and EAknSoftkeyBack |
|
90 * to accept or cancel the pop-up. |
|
91 * @since 2.8 |
|
92 * @param aCommandId Event Id from the soft-key |
|
93 */ |
|
94 void ProcessCommandL( TInt aCommandId ); |
|
95 |
|
96 /** |
|
97 * From CAknSettingPage |
|
98 * Puts up a constructed dialog. Part of the non-waiting API calls. |
|
99 * Activity to perform as soon as the setting page is displayed |
|
100 * @since 2.8 |
|
101 * @return Whether check succeeded |
|
102 */ |
|
103 TBool PostDisplayCheckL(); |
|
104 |
|
105 /** |
|
106 * From CAknSettingPage |
|
107 * Used to inform the setting item that a new value has been selected |
|
108 * @since 2.8 |
|
109 */ |
|
110 void SelectCurrentItemL(); |
|
111 |
|
112 /** |
|
113 * From CCoeControl |
|
114 * Standard Constructs the control from the resource |
|
115 * @since 2.8 |
|
116 * @param aReader The resource reader |
|
117 */ |
|
118 void ConstructFromResourceL( TResourceReader& aReader ); |
|
119 |
|
120 /** |
|
121 * From CCoeControl |
|
122 * Standard CCoeControl routine to return the number of component controls |
|
123 * @since 2.8 |
|
124 * @return the number of component controls |
|
125 */ |
|
126 TInt CountComponentControls() const; |
|
127 |
|
128 /** |
|
129 * From CCoeControl |
|
130 * Standard CCoeControl routine to return the control at a given index |
|
131 * @since 2.8 |
|
132 * @param anIndex index at which to return control |
|
133 * @return the control at the given index |
|
134 */ |
|
135 CCoeControl* ComponentControl( TInt anIndex ) const; |
|
136 |
|
137 /** |
|
138 * From CCoeControl |
|
139 * Used the draw the setting page |
|
140 * @since 2.8 |
|
141 * @param aRect the invalid rect to draw |
|
142 */ |
|
143 void Draw( const TRect& aRect ) const; |
|
144 |
|
145 /** |
|
146 * From CCoeControl |
|
147 * Called when the size of the setting page changes |
|
148 * @since 2.8 |
|
149 */ |
|
150 void SizeChanged(); |
|
151 |
|
152 /** |
|
153 * From CCoeControl |
|
154 * Used to handle key events |
|
155 * @since 2.8 |
|
156 * @param aKeyEvent the key event to handle |
|
157 * @param aType the type of key event |
|
158 * @return whether the key was handled |
|
159 */ |
|
160 TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); |
|
161 |
|
162 private: |
|
163 /** |
|
164 * Called when the setting value is to be previewed |
|
165 * @since 2.8 |
|
166 * @param aPtr pointer to the object that called the timer |
|
167 * @return Error code |
|
168 */ |
|
169 static TInt PreviewSettingChange( TAny* aPtr ); |
|
170 |
|
171 private: // data |
|
172 // used to inform the setting item of a change in setting page |
|
173 MAknQueryValue& iQueryValue; |
|
174 // the app controller |
|
175 MCamAppController& iController; |
|
176 // the current capture mode |
|
177 TCamCameraMode iMode; |
|
178 // Used to perform the preview setting change |
|
179 CPeriodic* iTimer; |
|
180 // the custom control (quality container ) used in this setting page |
|
181 CGSCamQualitySettingContainer* iQualityContainer; |
|
182 // the setting item |
|
183 TInt iSettingItemId; |
|
184 // the current value of the setting item |
|
185 TInt iCurrentVal; |
|
186 }; |
|
187 |
|
188 #endif // GSCAMQUALITYSETTINGPAGE_H |
|
189 |
|
190 // End of File |