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@2
|
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
|
williamr@2
|
6 |
* which accompanies this distribution, and is available
|
williamr@2
|
7 |
* at the URL "http://www.symbianfoundation.org/legal/licencesv10.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 |
* Base class for setting page (setting item editing) UI
|
williamr@2
|
16 |
*
|
williamr@2
|
17 |
*/
|
williamr@2
|
18 |
|
williamr@2
|
19 |
|
williamr@2
|
20 |
#ifndef __AKNSETTINGPAGE_H__
|
williamr@2
|
21 |
#define __AKNSETTINGPAGE_H__
|
williamr@2
|
22 |
|
williamr@2
|
23 |
#include <AknControl.h>
|
williamr@2
|
24 |
|
williamr@2
|
25 |
#include <eikdef.h>
|
williamr@2
|
26 |
#include <eikbtgpc.h>
|
williamr@2
|
27 |
|
williamr@2
|
28 |
// For menu support
|
williamr@2
|
29 |
#include <eikmenub.h>
|
williamr@2
|
30 |
#include <eikmenup.h>
|
williamr@2
|
31 |
#include <eikmobs.h>
|
williamr@2
|
32 |
|
williamr@2
|
33 |
// for layout support
|
williamr@2
|
34 |
#include <aknutils.h>
|
williamr@2
|
35 |
|
williamr@2
|
36 |
// for navipane support (hint text)
|
williamr@2
|
37 |
#include <aknnavi.h>
|
williamr@2
|
38 |
|
williamr@2
|
39 |
//
|
williamr@2
|
40 |
// Forward declarations
|
williamr@2
|
41 |
//
|
williamr@2
|
42 |
class CEikLabel;
|
williamr@2
|
43 |
class CAknSettingPageSkinsInfo;
|
williamr@2
|
44 |
class MAknsControlContext;
|
williamr@2
|
45 |
class CAknsFrameBackgroundControlContext;
|
williamr@2
|
46 |
class CAknSettingPageExtension;
|
williamr@2
|
47 |
|
williamr@2
|
48 |
|
williamr@2
|
49 |
// Used as the return value of SettingId() if not yet set.
|
williamr@2
|
50 |
// This because the Id might want to be the index of a 0-based array
|
williamr@2
|
51 |
|
williamr@2
|
52 |
const TInt KAknSettingPageNoIdSet = -1;
|
williamr@2
|
53 |
|
williamr@2
|
54 |
class CAknSettingPage;
|
williamr@2
|
55 |
|
williamr@2
|
56 |
// This class is used as a means of notifying change in settings.
|
williamr@2
|
57 |
|
williamr@2
|
58 |
class MAknSettingPageObserver
|
williamr@2
|
59 |
{
|
williamr@2
|
60 |
public:
|
williamr@2
|
61 |
enum TAknSettingPageEvent
|
williamr@2
|
62 |
{
|
williamr@2
|
63 |
EEventSettingChanged,
|
williamr@2
|
64 |
EEventSettingCancelled,
|
williamr@2
|
65 |
EEventSettingOked
|
williamr@2
|
66 |
};
|
williamr@2
|
67 |
public:
|
williamr@2
|
68 |
|
williamr@2
|
69 |
/**
|
williamr@2
|
70 |
* Handles an event of type aEventType reported by the Setting Page to this observer.
|
williamr@2
|
71 |
*/
|
williamr@2
|
72 |
virtual void HandleSettingPageEventL(CAknSettingPage* aSettingPage,TAknSettingPageEvent aEventType )=0;
|
williamr@2
|
73 |
|
williamr@2
|
74 |
};
|
williamr@2
|
75 |
|
williamr@2
|
76 |
class CAknSettingPage : public CAknControl, public MCoeControlObserver, public MEikMenuObserver
|
williamr@2
|
77 |
{
|
williamr@2
|
78 |
public:
|
williamr@2
|
79 |
|
williamr@2
|
80 |
/**
|
williamr@2
|
81 |
* This enumeration is passed in the ExecuteLD() method to control how often the setting page
|
williamr@2
|
82 |
* updates the externally held client object
|
williamr@2
|
83 |
*/
|
williamr@2
|
84 |
enum TAknSettingPageUpdateMode
|
williamr@2
|
85 |
{
|
williamr@2
|
86 |
EUpdateWhenChanged,
|
williamr@2
|
87 |
EUpdateWhenAccepted
|
williamr@2
|
88 |
};
|
williamr@2
|
89 |
|
williamr@2
|
90 |
/**
|
williamr@2
|
91 |
* This enumeration is used to select the type and IIDs for the various classes defined in the
|
williamr@2
|
92 |
* Skins LAF spec for "Opened Setting Items"
|
williamr@2
|
93 |
*/
|
williamr@2
|
94 |
enum TEditedItemSkinClass
|
williamr@2
|
95 |
{
|
williamr@2
|
96 |
ESettingPageSkinEditedItemClassValueItemList,
|
williamr@2
|
97 |
ESettingPageSkinEditedItemClassVolume,
|
williamr@2
|
98 |
ESettingPageSkinEditedItemClassSlider,
|
williamr@2
|
99 |
ESettingPageSkinEditedItemClassTextEntry,
|
williamr@2
|
100 |
ESettingPageSkinEditedItemClassCodeDateTimeEntry
|
williamr@2
|
101 |
};
|
williamr@2
|
102 |
/**
|
williamr@2
|
103 |
* Simple contructor for using a single setting page resource which itself gives all
|
williamr@2
|
104 |
* the setup
|
williamr@2
|
105 |
*/
|
williamr@2
|
106 |
IMPORT_C CAknSettingPage( TInt aSettingPageResourceId );
|
williamr@2
|
107 |
/**
|
williamr@2
|
108 |
* Constructor that allows separate setting page and editor resources
|
williamr@2
|
109 |
*
|
williamr@2
|
110 |
* In all cases the number (if supplied i.e. <> 0 ) is used.
|
williamr@2
|
111 |
*
|
williamr@2
|
112 |
* Editor Resource Setting Page Resource
|
williamr@2
|
113 |
* present present Both are used (but text & number overridden)
|
williamr@2
|
114 |
* = 0 present Editor resource is used via SP resource
|
williamr@2
|
115 |
* present = 0 Default Avkon SP resource if used
|
williamr@2
|
116 |
* = 0 = 0 Not permitted
|
williamr@2
|
117 |
*
|
williamr@2
|
118 |
* Note: The first argument is a TDesC* (rather than TDesC&) because the other constructor
|
williamr@2
|
119 |
* cannot initialize such a member without allocation or having an internal dummy buffer.
|
williamr@2
|
120 |
*
|
williamr@2
|
121 |
* Rules for text and numbers: The rules are the same for both: (non-zero length) text or number other
|
williamr@2
|
122 |
* than EAknSettingPageNoOrdinalDisplayed if given in this constructor will not override resource
|
williamr@2
|
123 |
* (unless that is zero length or EAknSettingPageNoOrdinalDisplayed). Note, however, that text or number given via the
|
williamr@2
|
124 |
* specific API for setting them, WILL override resource.
|
williamr@2
|
125 |
* It is assumed that number from resource is very rare. Special text is somewhat more likely.
|
williamr@2
|
126 |
*
|
williamr@2
|
127 |
* @param aSettingTitleText Text at top of setting pane (not copied; must be owned externally until ExecuteLD is called)
|
williamr@2
|
128 |
* @param aSettingNumber Number at top left (if present)
|
williamr@2
|
129 |
* @param aControlType Determines the type constructed and how its resource is read
|
williamr@2
|
130 |
* @param aEditorResourceId Editor resource to use in the setting page (if present)
|
williamr@2
|
131 |
* @param aSettingPageResourceId Setting Page to use (if present)
|
williamr@2
|
132 |
*/
|
williamr@2
|
133 |
IMPORT_C CAknSettingPage( const TDesC* aSettingTitleText,
|
williamr@2
|
134 |
TInt aSettingNumber,
|
williamr@2
|
135 |
TInt aControlType,
|
williamr@2
|
136 |
TInt aEditorResourceId,
|
williamr@2
|
137 |
TInt aSettingPageResourceId = 0 );
|
williamr@2
|
138 |
/**
|
williamr@2
|
139 |
* C++ destructor
|
williamr@2
|
140 |
*/
|
williamr@2
|
141 |
IMPORT_C virtual ~CAknSettingPage();
|
williamr@2
|
142 |
|
williamr@2
|
143 |
/**
|
williamr@2
|
144 |
* Executes a waiting dialog-like setting page
|
williamr@2
|
145 |
*
|
williamr@2
|
146 |
* The passed mode determines if the editor's value is updated continuously, or just
|
williamr@2
|
147 |
* when it is accepted.
|
williamr@2
|
148 |
*
|
williamr@2
|
149 |
* @param aMode The update mode of the class
|
williamr@2
|
150 |
*/
|
williamr@2
|
151 |
IMPORT_C TBool ExecuteLD( enum CAknSettingPage::TAknSettingPageUpdateMode aMode=EUpdateWhenAccepted );
|
williamr@2
|
152 |
|
williamr@2
|
153 |
/**
|
williamr@2
|
154 |
* public method for construction. Only thing required to do in this class is to call the
|
williamr@2
|
155 |
* BaseConstructL(). Derived classes may be required to do more
|
williamr@2
|
156 |
*
|
williamr@2
|
157 |
*/
|
williamr@2
|
158 |
IMPORT_C virtual void ConstructL();
|
williamr@2
|
159 |
|
williamr@2
|
160 |
/**
|
williamr@2
|
161 |
* Returns reference to the hosted "editor" control as a CCoeControl.
|
williamr@2
|
162 |
* This routine is used in derived classes, which may then cast to the specific run-time type
|
williamr@2
|
163 |
* Note also that derived classes may provide type-specific access that performs these casts already
|
williamr@2
|
164 |
*
|
williamr@2
|
165 |
* @return CCoeControl* pointer to the hosted editor control
|
williamr@2
|
166 |
*/
|
williamr@2
|
167 |
IMPORT_C CCoeControl* EditorControl() const;
|
williamr@2
|
168 |
|
williamr@2
|
169 |
/**
|
williamr@2
|
170 |
* Returns the setting Id.
|
williamr@2
|
171 |
*
|
williamr@2
|
172 |
* @return TInt the setting Id
|
williamr@2
|
173 |
*/
|
williamr@2
|
174 |
IMPORT_C TInt SettingId() const;
|
williamr@2
|
175 |
|
williamr@2
|
176 |
/**
|
williamr@2
|
177 |
* Sets the setting Id. The Id may be used to unabiguously number a setting in some context.
|
williamr@2
|
178 |
* It would be useful to call SettingId() on aSettingPageControl in handling an observer
|
williamr@2
|
179 |
* callback. The Id is not used internally.
|
williamr@2
|
180 |
*
|
williamr@2
|
181 |
* @param aSettingId An id to provide to the observer in the callback
|
williamr@2
|
182 |
*/
|
williamr@2
|
183 |
IMPORT_C void SetSettingId( TInt aSettingId );
|
williamr@2
|
184 |
/**
|
williamr@2
|
185 |
* Substitutes the new setting number.
|
williamr@2
|
186 |
*
|
williamr@2
|
187 |
* @param aSettingNumber The new setting number to display
|
williamr@2
|
188 |
*/
|
williamr@2
|
189 |
IMPORT_C void SetSettingNumberL( const TInt aSettingNumber );
|
williamr@2
|
190 |
|
williamr@2
|
191 |
/**
|
williamr@2
|
192 |
* Substitutes the new setting text. Memory is allocated for a copy.
|
williamr@2
|
193 |
* If already constructed, the label is reformatted.
|
williamr@2
|
194 |
*
|
williamr@2
|
195 |
* Note that calling this will over-ride text in Setting Page resource
|
williamr@2
|
196 |
*
|
williamr@2
|
197 |
* @param aSettingText The new setting text to display
|
williamr@2
|
198 |
*/
|
williamr@2
|
199 |
IMPORT_C void SetSettingTextL( const TDesC& aSettingText );
|
williamr@2
|
200 |
|
williamr@2
|
201 |
/**
|
williamr@2
|
202 |
* Sets the observer for the setting page.
|
williamr@2
|
203 |
*
|
williamr@2
|
204 |
* @param aObserver The observer for changes to the setting
|
williamr@2
|
205 |
*/
|
williamr@2
|
206 |
IMPORT_C void SetSettingPageObserver( MAknSettingPageObserver* aObserver);
|
williamr@2
|
207 |
|
williamr@2
|
208 |
/**
|
williamr@2
|
209 |
* Access method for the number of the setting page
|
williamr@2
|
210 |
*
|
williamr@2
|
211 |
*/
|
williamr@2
|
212 |
IMPORT_C TInt SettingNumber() const;
|
williamr@2
|
213 |
|
williamr@2
|
214 |
/**
|
williamr@2
|
215 |
* Access method for whether the setting page is numbered or not
|
williamr@2
|
216 |
*
|
williamr@2
|
217 |
*/
|
williamr@2
|
218 |
IMPORT_C TBool IsNumbered() const;
|
williamr@2
|
219 |
|
williamr@2
|
220 |
/**
|
williamr@2
|
221 |
* Set method for whether the setting page is numbered or not
|
williamr@2
|
222 |
*
|
williamr@2
|
223 |
*/
|
williamr@2
|
224 |
IMPORT_C void SetNumbered( TBool aNumbered );
|
williamr@2
|
225 |
|
williamr@2
|
226 |
/**
|
williamr@2
|
227 |
* Reads the passed-in setting page resource in order to read the contained editor control
|
williamr@2
|
228 |
* resource information
|
williamr@2
|
229 |
* @param aSettingPageResoruceId This is used to specifiy what resource to read
|
williamr@2
|
230 |
* @param aControlType Returns the control type (MAY return 0 - that's a valid control type!
|
williamr@2
|
231 |
* @param aEditorResourceId Returns the setting page's LLINK editor resource, but returns 0 if not present
|
williamr@2
|
232 |
*
|
williamr@2
|
233 |
* This will leave if an invalid resource ID is passed
|
williamr@2
|
234 |
*/
|
williamr@2
|
235 |
IMPORT_C static void GetEditorResourceInfoL(
|
williamr@2
|
236 |
TInt aSettingPageResourceId,
|
williamr@2
|
237 |
TInt& aControlType,
|
williamr@2
|
238 |
TInt& aEditorResourceId );
|
williamr@2
|
239 |
|
williamr@2
|
240 |
|
williamr@2
|
241 |
/**
|
williamr@2
|
242 |
* Set the edit-state of the setting page. The setting page can be edited or
|
williamr@2
|
243 |
* it can be only viewed by the user.
|
williamr@2
|
244 |
*
|
williamr@2
|
245 |
* @since 3.1
|
williamr@2
|
246 |
* @param aEditable If false, the setting page cannot be modified by the user
|
williamr@2
|
247 |
*/
|
williamr@2
|
248 |
IMPORT_C void SetEditState(const TBool aEditable);
|
williamr@2
|
249 |
|
williamr@2
|
250 |
/**
|
williamr@2
|
251 |
* Is the setting page possible to edit by the user.
|
williamr@2
|
252 |
*
|
williamr@2
|
253 |
* @since 3.1
|
williamr@2
|
254 |
* @return Can user modify the setting page. True if can, false if cannot.
|
williamr@2
|
255 |
*/
|
williamr@2
|
256 |
IMPORT_C TBool IsEditable() const;
|
williamr@2
|
257 |
|
williamr@2
|
258 |
/**
|
williamr@2
|
259 |
* Used for aknsettingpage's extenstion corresponding function
|
williamr@2
|
260 |
*
|
williamr@2
|
261 |
* @since 5.0
|
williamr@2
|
262 |
* @param aCaption On return, this should be set to the caption of the target control.
|
williamr@2
|
263 |
*/
|
williamr@2
|
264 |
void GetCaptionForFep(TDes& aCaption) const;
|
williamr@2
|
265 |
|
williamr@2
|
266 |
protected:
|
williamr@2
|
267 |
|
williamr@2
|
268 |
/**
|
williamr@2
|
269 |
* From CCoeControl
|
williamr@2
|
270 |
* This routine is called as part of the set-up of the control. It is the place to put
|
williamr@2
|
271 |
* layout code.
|
williamr@2
|
272 |
*
|
williamr@2
|
273 |
*/
|
williamr@2
|
274 |
IMPORT_C virtual void SizeChanged();
|
williamr@2
|
275 |
|
williamr@2
|
276 |
|
williamr@2
|
277 |
/**
|
williamr@2
|
278 |
* From CCoeControl
|
williamr@2
|
279 |
* Takes any action required when the control gains or loses focus e.g. to change its appearance.
|
williamr@2
|
280 |
* The control should be redrawn depending on the value of aDrawNow. Empty by default.
|
williamr@2
|
281 |
*/
|
williamr@2
|
282 |
IMPORT_C virtual void FocusChanged(TDrawNow aDrawNow);
|
williamr@2
|
283 |
|
williamr@2
|
284 |
/**
|
williamr@2
|
285 |
* From MEikCommandObserver
|
williamr@2
|
286 |
* Processes events from the softkeys. Responds to EAknSoftkeyOk and EAknSoftkeyBack
|
williamr@2
|
287 |
* to accept or cancel the pop-up.
|
williamr@2
|
288 |
*
|
williamr@2
|
289 |
* @param aCommandId Event Id from the soft-key
|
williamr@2
|
290 |
*/
|
williamr@2
|
291 |
IMPORT_C virtual void ProcessCommandL(TInt aCommandId);
|
williamr@2
|
292 |
|
williamr@2
|
293 |
/**
|
williamr@2
|
294 |
* From MCoeControlObserver:
|
williamr@2
|
295 |
* Acts upon changes in the hosted control's state.
|
williamr@2
|
296 |
*
|
williamr@2
|
297 |
* This class's implementation is trivial and should be able to be
|
williamr@2
|
298 |
* safely re-implemented in directly client-derived classes.
|
williamr@2
|
299 |
* For non-base setting page classes, a call to the base class should be made
|
williamr@2
|
300 |
*
|
williamr@2
|
301 |
* @param aControl The control changing its state (not used)
|
williamr@2
|
302 |
* @param aEventType The type of control event
|
williamr@2
|
303 |
*/
|
williamr@2
|
304 |
IMPORT_C virtual void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType);
|
williamr@2
|
305 |
|
williamr@2
|
306 |
//
|
williamr@2
|
307 |
//
|
williamr@2
|
308 |
// Framework functions. New in this class
|
williamr@2
|
309 |
//
|
williamr@2
|
310 |
//
|
williamr@2
|
311 |
/**
|
williamr@2
|
312 |
* Framework method to determine if it is OK to exit the setting page.
|
williamr@2
|
313 |
* Derived classes may check for valid data before allowing the dismissal of the
|
williamr@2
|
314 |
* setting page.
|
williamr@2
|
315 |
*
|
williamr@2
|
316 |
* @param aAccept ETrue if the user has indicated to accept the setting page; EFalse otherwise
|
williamr@2
|
317 |
* @return TBool a value indicating whether the setting page should be dismissed
|
williamr@2
|
318 |
*/
|
williamr@2
|
319 |
IMPORT_C virtual TBool OkToExitL(TBool aAccept);
|
williamr@2
|
320 |
|
williamr@2
|
321 |
/**
|
williamr@2
|
322 |
* Called immediately prior to activation of the dialog. Framework routine for derived
|
williamr@2
|
323 |
* classes.
|
williamr@2
|
324 |
*
|
williamr@2
|
325 |
*/
|
williamr@2
|
326 |
IMPORT_C virtual void DynamicInitL();
|
williamr@2
|
327 |
|
williamr@2
|
328 |
/**
|
williamr@2
|
329 |
* Called when something has changed and the client's object needs to have its value updated
|
williamr@2
|
330 |
*
|
williamr@2
|
331 |
*/
|
williamr@2
|
332 |
IMPORT_C virtual void UpdateSettingL();
|
williamr@2
|
333 |
|
williamr@2
|
334 |
/**
|
williamr@2
|
335 |
* Called when the user accepts a setting and the setting page is about to be dismissed. The latest value of the
|
williamr@2
|
336 |
* setting is written to the client's object
|
williamr@2
|
337 |
*/
|
williamr@2
|
338 |
IMPORT_C virtual void AcceptSettingL();
|
williamr@2
|
339 |
|
williamr@2
|
340 |
/**
|
williamr@2
|
341 |
* Called when the user rejects the setting. A backup copy may need to be restored if UpdateWhenChanged flag was set
|
williamr@2
|
342 |
*
|
williamr@2
|
343 |
*/
|
williamr@2
|
344 |
IMPORT_C virtual void RestoreOriginalSettingL();
|
williamr@2
|
345 |
|
williamr@2
|
346 |
/**
|
williamr@2
|
347 |
* Display the menu
|
williamr@2
|
348 |
*/
|
williamr@2
|
349 |
IMPORT_C virtual void DisplayMenuL() ;
|
williamr@2
|
350 |
|
williamr@2
|
351 |
/**
|
williamr@2
|
352 |
* Hide the menu
|
williamr@2
|
353 |
*/
|
williamr@2
|
354 |
IMPORT_C virtual void HideMenu() ;
|
williamr@2
|
355 |
|
williamr@2
|
356 |
/**
|
williamr@2
|
357 |
* Puts the focus back on the editor. For complicated setting pages that have focus removed from them
|
williamr@2
|
358 |
* at some point, then a re-implementation may have to do some work here.
|
williamr@2
|
359 |
*/
|
williamr@2
|
360 |
IMPORT_C virtual void SetFocusToEditor();
|
williamr@2
|
361 |
|
williamr@2
|
362 |
/**
|
williamr@2
|
363 |
* This method should be implemented in listbox classes to move the selection in
|
williamr@2
|
364 |
* listbox editors prior to exiting from the setting page. It is called on a
|
williamr@2
|
365 |
* CAknSettingPage* reference, and is therefore declared here.
|
williamr@2
|
366 |
*/
|
williamr@2
|
367 |
IMPORT_C virtual void SelectCurrentItemL();
|
williamr@2
|
368 |
|
williamr@2
|
369 |
/**
|
williamr@2
|
370 |
* Protected non-virtual base method for construction. Only thing required to do in this class is
|
williamr@2
|
371 |
* call the ConstructFromResourceL routine and set the flag that says construction has occured
|
williamr@2
|
372 |
*
|
williamr@2
|
373 |
*/
|
williamr@2
|
374 |
IMPORT_C void BaseConstructL();
|
williamr@2
|
375 |
|
williamr@2
|
376 |
/**
|
williamr@2
|
377 |
* Called to remove the setting page. Should not be called except from within re-implemented
|
williamr@2
|
378 |
* AttemptExitL
|
williamr@2
|
379 |
*
|
williamr@2
|
380 |
* @param aAccept ETrue to accept the current value; EFalse otherwise
|
williamr@2
|
381 |
*/
|
williamr@2
|
382 |
IMPORT_C void DismissL( TBool aAccept );
|
williamr@2
|
383 |
|
williamr@2
|
384 |
/**
|
williamr@2
|
385 |
* This is used as a protected access function for the state of the menu bar
|
williamr@2
|
386 |
*
|
williamr@2
|
387 |
* @return TBool ETrue if the menu is currently showing
|
williamr@2
|
388 |
*/
|
williamr@2
|
389 |
IMPORT_C TBool MenuShowing() const ;
|
williamr@2
|
390 |
|
williamr@2
|
391 |
/**
|
williamr@2
|
392 |
* This constructs the control based upon the id passed
|
williamr@2
|
393 |
*
|
williamr@2
|
394 |
*/
|
williamr@2
|
395 |
IMPORT_C void ConstructFromResourceL( TInt aResourceId);
|
williamr@2
|
396 |
|
williamr@2
|
397 |
/**
|
williamr@2
|
398 |
* This constructs the control based upon a constructed and positioned reader
|
williamr@2
|
399 |
*
|
williamr@2
|
400 |
*/
|
williamr@2
|
401 |
IMPORT_C void ConstructFromResourceL(TResourceReader& aRes);
|
williamr@2
|
402 |
|
williamr@2
|
403 |
/**
|
williamr@2
|
404 |
* Called when the user accepts or cancels the setting. Default implementation
|
williamr@2
|
405 |
* sets the return value and exists.
|
williamr@2
|
406 |
*
|
williamr@2
|
407 |
* Re-implementations must call DismissL and StopActiveScheduler() if the setting is
|
williamr@2
|
408 |
* to leave.
|
williamr@2
|
409 |
*
|
williamr@2
|
410 |
* @param aAccept ETrue if the user accepted. EFalse if the user cancelled.
|
williamr@2
|
411 |
*/
|
williamr@2
|
412 |
IMPORT_C void AttemptExitL(TBool aAccept);
|
williamr@2
|
413 |
/**
|
williamr@2
|
414 |
* Method to determine the current running state of the setting page's
|
williamr@2
|
415 |
* ActiveScheduler level.
|
williamr@2
|
416 |
*
|
williamr@2
|
417 |
* @return EFalse only if the CActiveSheduler level is not running
|
williamr@2
|
418 |
*/
|
williamr@2
|
419 |
IMPORT_C TBool Waiting();
|
williamr@2
|
420 |
|
williamr@2
|
421 |
/**
|
williamr@2
|
422 |
* Access method to the Command button array
|
williamr@2
|
423 |
*
|
williamr@2
|
424 |
* Must be called after full construction, or null reference will be returned.
|
williamr@2
|
425 |
*
|
williamr@2
|
426 |
* @return CEikButtonGroupContainer* a pointer to the cba owned by the setting page
|
williamr@2
|
427 |
*/
|
williamr@2
|
428 |
IMPORT_C CEikButtonGroupContainer* Cba() const ;
|
williamr@2
|
429 |
|
williamr@2
|
430 |
/**
|
williamr@2
|
431 |
* This is used to access the default resource id for the cba - the one used when
|
williamr@2
|
432 |
* data is valid.
|
williamr@2
|
433 |
*
|
williamr@2
|
434 |
* @return TInt the default resource Id
|
williamr@2
|
435 |
*/
|
williamr@2
|
436 |
IMPORT_C TInt DefaultCbaResourceId() const;
|
williamr@2
|
437 |
|
williamr@2
|
438 |
/**
|
williamr@2
|
439 |
* This routine routes the keys to the editor.
|
williamr@2
|
440 |
* However, if the menu is showing, then events are sent to the menu.
|
williamr@2
|
441 |
*
|
williamr@2
|
442 |
* @param aKeyEvent event information
|
williamr@2
|
443 |
* @param aType type of event being handled
|
williamr@2
|
444 |
*
|
williamr@2
|
445 |
*/
|
williamr@2
|
446 |
IMPORT_C TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType);
|
williamr@2
|
447 |
|
williamr@2
|
448 |
/**
|
williamr@2
|
449 |
* This routine is the base layout for CAknSettingPage. It lays out the labels and configures
|
williamr@2
|
450 |
* the drawing in general.
|
williamr@2
|
451 |
*/
|
williamr@2
|
452 |
IMPORT_C void StandardSettingPageLayout();
|
williamr@2
|
453 |
|
williamr@2
|
454 |
/**
|
williamr@2
|
455 |
* This method can be used to test if BaseConstructL() has been called yet
|
williamr@2
|
456 |
* successfully
|
williamr@2
|
457 |
*
|
williamr@2
|
458 |
* @return TBool ETrue if BaseContructL has been called (and not left)
|
williamr@2
|
459 |
*/
|
williamr@2
|
460 |
IMPORT_C TBool IsBaseConstructed();
|
williamr@2
|
461 |
|
williamr@2
|
462 |
/**
|
williamr@2
|
463 |
* Access method for the internally held resource Id
|
williamr@2
|
464 |
*
|
williamr@2
|
465 |
*/
|
williamr@2
|
466 |
IMPORT_C TInt SettingPageResourceId();
|
williamr@2
|
467 |
/**
|
williamr@2
|
468 |
* Perform the drawing of coded within CAknSettingPage
|
williamr@2
|
469 |
*
|
williamr@2
|
470 |
*/
|
williamr@2
|
471 |
IMPORT_C void BaseDraw(const TRect& aRect) const;
|
williamr@2
|
472 |
|
williamr@2
|
473 |
/**
|
williamr@2
|
474 |
* Set default construction values of internal state
|
williamr@2
|
475 |
*/
|
williamr@2
|
476 |
IMPORT_C void ResetFlags();
|
williamr@2
|
477 |
|
williamr@2
|
478 |
/**
|
williamr@2
|
479 |
* Framework method called as soon as the setting page is displayed, but before the new active sheduler level
|
williamr@2
|
480 |
* is started. Returning EFalse will dismiss the setting page right away
|
williamr@2
|
481 |
*
|
williamr@2
|
482 |
* @return TBool ETrue if the setting page is to continue
|
williamr@2
|
483 |
*/
|
williamr@2
|
484 |
IMPORT_C virtual TBool PostDisplayCheckL();
|
williamr@2
|
485 |
|
williamr@2
|
486 |
/**
|
williamr@2
|
487 |
* This framework method is used to update the contents of the CBA in a custom way.
|
williamr@2
|
488 |
* Some setting page classes implement a degree of validation and will implement this.
|
williamr@2
|
489 |
* Derived classes should ensure that this is being called frequently enough for their
|
williamr@2
|
490 |
* purposes.
|
williamr@2
|
491 |
*/
|
williamr@2
|
492 |
IMPORT_C virtual void UpdateCbaL();
|
williamr@2
|
493 |
|
williamr@2
|
494 |
/**
|
williamr@2
|
495 |
* Called to access the validity state of the data
|
williamr@2
|
496 |
*
|
williamr@2
|
497 |
* @return TBool ETRrue if the data is valid
|
williamr@2
|
498 |
*/
|
williamr@2
|
499 |
IMPORT_C TBool DataValidity() const;
|
williamr@2
|
500 |
|
williamr@2
|
501 |
/**
|
williamr@2
|
502 |
* used to set the validity of the data
|
williamr@2
|
503 |
*
|
williamr@2
|
504 |
* @param TBool aValid Sets the validity true or false
|
williamr@2
|
505 |
*/
|
williamr@2
|
506 |
IMPORT_C void SetDataValidity(TBool aValid);
|
williamr@2
|
507 |
|
williamr@2
|
508 |
/**
|
williamr@2
|
509 |
* Framework method to set the validity of the data
|
williamr@2
|
510 |
* This is called when the data changes.
|
williamr@2
|
511 |
*
|
williamr@2
|
512 |
*/
|
williamr@2
|
513 |
IMPORT_C virtual void CheckAndSetDataValidity();
|
williamr@2
|
514 |
|
williamr@2
|
515 |
/**
|
williamr@2
|
516 |
* Method to be called by CAknSettingPage descendents when they have laid themselves out.
|
williamr@2
|
517 |
* This tells the base class how big the layout spec rectangle hosting the editor is.
|
williamr@2
|
518 |
* The second rectangle is the size of the area that the base class does not have to
|
williamr@2
|
519 |
* draw to for skins. Usually, this is the area actually inhabited by the editor control.
|
williamr@2
|
520 |
*
|
williamr@2
|
521 |
* Coordinates are to be given in pixels relative to the main_pane.
|
williamr@2
|
522 |
*
|
williamr@2
|
523 |
* @param aFrameRect Layout rectangle in which to host the editor.
|
williamr@2
|
524 |
* @param aRealEditorRect Layout rectangle actually occupied by the editor control
|
williamr@2
|
525 |
*
|
williamr@2
|
526 |
* @since 2.0
|
williamr@2
|
527 |
*/
|
williamr@2
|
528 |
void SetEditedItemLayoutRect( const TRect& aFrameRect, const TRect& aRealEditorRect);
|
williamr@2
|
529 |
|
williamr@2
|
530 |
/**
|
williamr@2
|
531 |
* Method to cause this class to construct a control context or type and IID, selected according to
|
williamr@2
|
532 |
* the value of enumeration TEditedItemSkinClass, set its coordinate system
|
williamr@2
|
533 |
*
|
williamr@2
|
534 |
* This must be called after a call to SetEditedItemLayoutRect has been made on CAknSettingPage.
|
williamr@2
|
535 |
* This is becasue this routine must set the control context's origin to the top left of the value
|
williamr@2
|
536 |
* given to SetEditedItemLayoutRect. Since SetEditeItemLayoutRect is to be called in a SizeChanged
|
williamr@2
|
537 |
* method, this means that the this should be called after the SizeChanged in the child class.
|
williamr@2
|
538 |
|
williamr@2
|
539 |
* @param aClass enumeration specifying which class of editor (according to LAF spec) is being
|
williamr@2
|
540 |
* constructed.
|
williamr@2
|
541 |
* @param aParentAbsolute ETrue if there is an intervening Window between CAknSettingPage's window
|
williamr@2
|
542 |
* and any control that is to draw skin items with this component.
|
williamr@2
|
543 |
*
|
williamr@2
|
544 |
* since 2.0
|
williamr@2
|
545 |
*
|
williamr@2
|
546 |
*/
|
williamr@2
|
547 |
void CreateEditedItemControlContextL( TEditedItemSkinClass aSkinClass, TBool aParentAbsolute);
|
williamr@2
|
548 |
|
williamr@2
|
549 |
/**
|
williamr@2
|
550 |
* Indicates whether skin system will be able to draw the editor frame and background
|
williamr@2
|
551 |
*
|
williamr@2
|
552 |
* @return TBool ETrue iff the drawing of the edited item frame is going to be handled by
|
williamr@2
|
553 |
* the base CAknSettingPage class itself using Skins
|
williamr@2
|
554 |
* @since 2.0
|
williamr@2
|
555 |
*/
|
williamr@2
|
556 |
TBool IsSkinsHandlingEditorFrameDrawing() const;
|
williamr@2
|
557 |
|
williamr@2
|
558 |
/**
|
williamr@2
|
559 |
* Control context for providing to the skinning for the hosted editor and its framing
|
williamr@2
|
560 |
*
|
williamr@2
|
561 |
* @return A valid control context for frame drawing for a hosted editor or NULL
|
williamr@2
|
562 |
* @since 2.0
|
williamr@2
|
563 |
*/
|
williamr@2
|
564 |
CAknsFrameBackgroundControlContext* EditedItemControlContext() const;
|
williamr@2
|
565 |
|
williamr@2
|
566 |
|
williamr@2
|
567 |
protected:
|
williamr@2
|
568 |
/**
|
williamr@2
|
569 |
* From MEikMenuObserver
|
williamr@2
|
570 |
* Called when menu is cancelled.
|
williamr@2
|
571 |
*/
|
williamr@2
|
572 |
IMPORT_C virtual void SetEmphasis(CCoeControl* /*aMenuControl*/,TBool aEmphasis);
|
williamr@2
|
573 |
|
williamr@2
|
574 |
/**
|
williamr@2
|
575 |
* From MEikMenuObserver
|
williamr@2
|
576 |
* This function intializes the items on the menu. It is used to disable and enable menu items and may be
|
williamr@2
|
577 |
* over ridden to add new ones.
|
williamr@2
|
578 |
* In addition it adds menu items which have been provided in the ConstructL in the form of a Menu Bar resource.
|
williamr@2
|
579 |
* Instead of using the Menu Bar directly it extracts the menu panes and adds them to its own menu pane.
|
williamr@2
|
580 |
* It must be called in the DynInitMenuPaneL() function of any derived class before anything else.
|
williamr@2
|
581 |
*/
|
williamr@2
|
582 |
IMPORT_C virtual void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
|
williamr@2
|
583 |
|
williamr@2
|
584 |
public: // From CCoeControl
|
williamr@2
|
585 |
/**
|
williamr@2
|
586 |
* Handles a change to the control's resources of type aType
|
williamr@2
|
587 |
* which are shared across the environment, e.g. colors or fonts.
|
williamr@2
|
588 |
*
|
williamr@2
|
589 |
* @since 2.0
|
williamr@2
|
590 |
* @param aType Reason for the "resource" change, usually an system event UID
|
williamr@2
|
591 |
*/
|
williamr@2
|
592 |
IMPORT_C void HandleResourceChange(TInt aType);
|
williamr@2
|
593 |
/**
|
williamr@2
|
594 |
* Standard CCoeControl routine to return the number of componentn controls
|
williamr@2
|
595 |
*
|
williamr@2
|
596 |
* @param aIndex index at which to return control
|
williamr@2
|
597 |
*/
|
williamr@2
|
598 |
IMPORT_C TInt CountComponentControls() const;
|
williamr@2
|
599 |
|
williamr@2
|
600 |
/**
|
williamr@2
|
601 |
* Standard CCoeControl routine to return the control at a given index
|
williamr@2
|
602 |
*
|
williamr@2
|
603 |
* @param aIndex index at which to return control
|
williamr@2
|
604 |
*/
|
williamr@2
|
605 |
|
williamr@2
|
606 |
IMPORT_C CCoeControl* ComponentControl(TInt anIndex) const;
|
williamr@2
|
607 |
|
williamr@2
|
608 |
/**
|
williamr@2
|
609 |
* Handles pointer events
|
williamr@2
|
610 |
*/
|
williamr@2
|
611 |
IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
|
williamr@2
|
612 |
/**
|
williamr@2
|
613 |
* From CCoeControl.
|
williamr@2
|
614 |
* Gets the control's input capabilities.
|
williamr@2
|
615 |
*
|
williamr@2
|
616 |
* @return The control's input capabilities.
|
williamr@2
|
617 |
*/
|
williamr@2
|
618 |
IMPORT_C TCoeInputCapabilities InputCapabilities() const;
|
williamr@2
|
619 |
|
williamr@2
|
620 |
private:
|
williamr@2
|
621 |
IMPORT_C virtual void Reserved_MtsmPosition();
|
williamr@2
|
622 |
IMPORT_C virtual void Reserved_MtsmObject();
|
williamr@2
|
623 |
|
williamr@2
|
624 |
protected:
|
williamr@2
|
625 |
/**
|
williamr@2
|
626 |
* Access method for the softkey resource used when there is invalid data
|
williamr@2
|
627 |
*
|
williamr@2
|
628 |
* @return TInt The resource Id of the softkey bindings.
|
williamr@2
|
629 |
*/
|
williamr@2
|
630 |
IMPORT_C TInt InvalidDataCbaResourceId() const;
|
williamr@2
|
631 |
|
williamr@2
|
632 |
protected: // from MObjectProvider
|
williamr@2
|
633 |
IMPORT_C TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
|
williamr@2
|
634 |
|
williamr@2
|
635 |
protected:
|
williamr@2
|
636 |
/**
|
williamr@2
|
637 |
* Hold the update mode passed in the constructor
|
williamr@2
|
638 |
*/
|
williamr@2
|
639 |
TInt iUpdateMode;
|
williamr@2
|
640 |
|
williamr@2
|
641 |
// The following are not owned:
|
williamr@2
|
642 |
|
williamr@2
|
643 |
/**
|
williamr@2
|
644 |
* Pointer to setting page observer; may be NULL
|
williamr@2
|
645 |
*/
|
williamr@2
|
646 |
MAknSettingPageObserver* iSettingPageObserver;
|
williamr@2
|
647 |
|
williamr@2
|
648 |
private:
|
williamr@2
|
649 |
//From CCoeControl
|
williamr@2
|
650 |
IMPORT_C void Draw(const TRect& aRect) const;
|
williamr@2
|
651 |
|
williamr@2
|
652 |
private:
|
williamr@2
|
653 |
/**
|
williamr@2
|
654 |
* From CAknControl
|
williamr@2
|
655 |
*/
|
williamr@2
|
656 |
IMPORT_C void* ExtensionInterface( TUid aInterface );
|
williamr@2
|
657 |
|
williamr@2
|
658 |
protected:
|
williamr@2
|
659 |
|
williamr@2
|
660 |
/**
|
williamr@2
|
661 |
* Writes the internal state of the control and its components to aStream.
|
williamr@2
|
662 |
* Does nothing in release mode.
|
williamr@2
|
663 |
* Designed to be overidden and base called by subclasses.
|
williamr@2
|
664 |
*
|
williamr@2
|
665 |
* @param aWriteSteam A connected write stream
|
williamr@2
|
666 |
*/
|
williamr@2
|
667 |
IMPORT_C virtual void WriteInternalStateL(RWriteStream& aWriteStream) const;
|
williamr@2
|
668 |
|
williamr@2
|
669 |
private:
|
williamr@2
|
670 |
/**
|
williamr@2
|
671 |
* Reserved method derived from CCoeControl
|
williamr@2
|
672 |
*/
|
williamr@2
|
673 |
IMPORT_C virtual void Reserved_2();
|
williamr@2
|
674 |
|
williamr@2
|
675 |
/**
|
williamr@2
|
676 |
* Activate another level on the active scheduler
|
williamr@2
|
677 |
*/
|
williamr@2
|
678 |
void StartActiveScheduler();
|
williamr@2
|
679 |
/**
|
williamr@2
|
680 |
* Stop current (additional) level on the active scheduler
|
williamr@2
|
681 |
*/
|
williamr@2
|
682 |
void StopActiveScheduler();
|
williamr@2
|
683 |
|
williamr@2
|
684 |
/**
|
williamr@2
|
685 |
* Pop the navidecorator. The iNaviPane is used as a flag to show if popping is required to
|
williamr@2
|
686 |
* be done or not. It is zeroed by this method.
|
williamr@2
|
687 |
*
|
williamr@2
|
688 |
*/
|
williamr@2
|
689 |
void PopNaviDecoratorIfRequired();
|
williamr@2
|
690 |
|
williamr@2
|
691 |
private:
|
williamr@2
|
692 |
|
williamr@2
|
693 |
/**
|
williamr@2
|
694 |
* New reserved methods for CAknSettingPage hierarchy
|
williamr@2
|
695 |
*/
|
williamr@2
|
696 |
private:
|
williamr@2
|
697 |
IMPORT_C virtual void CAknSettingPage_Reserved_1();
|
williamr@2
|
698 |
IMPORT_C virtual void CAknSettingPage_Reserved_2();
|
williamr@2
|
699 |
|
williamr@2
|
700 |
protected:
|
williamr@2
|
701 |
/**
|
williamr@2
|
702 |
* Enables / disables transparency effect, i.e. does the setting page draw its own background or not.
|
williamr@2
|
703 |
* @param aDrawBackground EFalse enables transparency
|
williamr@2
|
704 |
*/
|
williamr@2
|
705 |
void SetDrawBackground(const TBool aDrawBackground);
|
williamr@2
|
706 |
|
williamr@2
|
707 |
/**
|
williamr@2
|
708 |
* Is the setting page drawing the background itself or not (= "transparency")
|
williamr@2
|
709 |
*/
|
williamr@2
|
710 |
TBool IsBackgroundDrawingEnabled() const;
|
williamr@2
|
711 |
/**
|
williamr@2
|
712 |
* Set the flag to indicate that if the function CAknSettingPage::StopActiveScheduler called or not
|
williamr@2
|
713 |
*@param aStopCalled ETrue means the StopActiveScheduler is called.
|
williamr@2
|
714 |
*/
|
williamr@2
|
715 |
void SetStopActiveSchedulerFlag(const TBool aStopCalled );
|
williamr@2
|
716 |
|
williamr@2
|
717 |
/**
|
williamr@2
|
718 |
* Is the setting page call the StopActiveScheduler or not
|
williamr@2
|
719 |
*/
|
williamr@2
|
720 |
TBool IsStopActiveSchudlerCalled()const;
|
williamr@2
|
721 |
|
williamr@2
|
722 |
/**
|
williamr@2
|
723 |
* Pointer to setting text label
|
williamr@2
|
724 |
* @return pointer to the label
|
williamr@2
|
725 |
*
|
williamr@2
|
726 |
* @since 5.0
|
williamr@2
|
727 |
*/
|
williamr@2
|
728 |
IMPORT_C CEikLabel* TextLabel() const;
|
williamr@2
|
729 |
|
williamr@2
|
730 |
/**
|
williamr@2
|
731 |
* Pointer to shadow text label
|
williamr@2
|
732 |
* @return pointer to the label
|
williamr@2
|
733 |
*
|
williamr@2
|
734 |
* @since 5.0
|
williamr@2
|
735 |
*/
|
williamr@2
|
736 |
IMPORT_C CEikLabel* ShadowText() const;
|
williamr@2
|
737 |
|
williamr@2
|
738 |
private:
|
williamr@2
|
739 |
/**
|
williamr@2
|
740 |
* This member points to the setting title text that is passed as part of its more complicated constructor.
|
williamr@2
|
741 |
* The descriptor pointed to is not owned, and therefor must be preserved in the client, at least until the
|
williamr@2
|
742 |
* 2nd stage construction is performed (inside ExecuteLD).
|
williamr@2
|
743 |
*
|
williamr@2
|
744 |
* Since, however, setting pages are all waiting, the descriptor can usually be on the stack in the client.
|
williamr@2
|
745 |
*
|
williamr@2
|
746 |
*/
|
williamr@2
|
747 |
const TDesC* iSettingTextFromConstructor;
|
williamr@2
|
748 |
TInt iResourceId;
|
williamr@2
|
749 |
|
williamr@2
|
750 |
TInt iSettingNumber;
|
williamr@2
|
751 |
TInt iSettingId;
|
williamr@2
|
752 |
TInt iMenuBarId;
|
williamr@2
|
753 |
TInt iControlType;
|
williamr@2
|
754 |
TInt iEditorResourceId;
|
williamr@2
|
755 |
TInt iExtensionId;
|
williamr@2
|
756 |
TInt iCbaResourceId;
|
williamr@2
|
757 |
|
williamr@2
|
758 |
TAknLayoutRect iShadow;
|
williamr@2
|
759 |
TAknLayoutRect iHighlight;
|
williamr@2
|
760 |
|
williamr@2
|
761 |
// pointer to the return value from the setting page.
|
williamr@2
|
762 |
// Needed when presented in waiting mode.
|
williamr@2
|
763 |
TBool* iReturn;
|
williamr@2
|
764 |
|
williamr@2
|
765 |
// Internal flags
|
williamr@2
|
766 |
TBitFlags iFlags ;
|
williamr@2
|
767 |
|
williamr@2
|
768 |
enum TFlagIndices
|
williamr@2
|
769 |
{
|
williamr@2
|
770 |
EMenuShowingIndex = 0,
|
williamr@2
|
771 |
ENumberedStyleIndex,
|
williamr@2
|
772 |
EIsBaseConstructedIndex,
|
williamr@2
|
773 |
EHasValidDataIndex
|
williamr@2
|
774 |
};
|
williamr@2
|
775 |
|
williamr@2
|
776 |
// Heap objects pointed to here are owned:
|
williamr@2
|
777 |
CCoeControl* iEditorControl;
|
williamr@2
|
778 |
CEikLabel* iNumberLabel;
|
williamr@2
|
779 |
CEikLabel* iTextLabel;
|
williamr@2
|
780 |
CEikButtonGroupContainer* iCba;
|
williamr@2
|
781 |
CEikMenuBar* iMenuBar ;
|
williamr@2
|
782 |
HBufC* iHintText;
|
williamr@2
|
783 |
HBufC* iSettingText;
|
williamr@2
|
784 |
CAknNavigationDecorator* iNaviDecorator;
|
williamr@2
|
785 |
|
williamr@2
|
786 |
// The following are not owned:
|
williamr@2
|
787 |
// For hint text support
|
williamr@2
|
788 |
CAknNavigationControlContainer* iNaviPane;
|
williamr@2
|
789 |
|
williamr@2
|
790 |
// Softkey resource when the data is invalid
|
williamr@2
|
791 |
TInt iInvalidDataCbaResourceId;
|
williamr@2
|
792 |
|
williamr@2
|
793 |
// The following object is used to contain all skinning information required
|
williamr@2
|
794 |
CAknSettingPageSkinsInfo* iSkinsInfo;
|
williamr@2
|
795 |
|
williamr@2
|
796 |
CActiveSchedulerWait iWait; // owned, safe to use as direct member data.
|
williamr@2
|
797 |
|
williamr@2
|
798 |
// is setting page editable
|
williamr@2
|
799 |
TInt iIsProtected;
|
williamr@2
|
800 |
|
williamr@2
|
801 |
// extension to setting page
|
williamr@2
|
802 |
CAknSettingPageExtension* iExtension;
|
williamr@2
|
803 |
};
|
williamr@2
|
804 |
|
williamr@2
|
805 |
#endif
|