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 |
* Interface for Setting page carrying CEikEdwin editors
|
williamr@2
|
16 |
* - CAknTextSettingPage: 6 line text editor
|
williamr@2
|
17 |
* - CAknIntegerSettingPage: 1 line integer editor
|
williamr@2
|
18 |
*
|
williamr@2
|
19 |
*
|
williamr@2
|
20 |
*/
|
williamr@2
|
21 |
|
williamr@2
|
22 |
|
williamr@2
|
23 |
#ifndef __AKNTEXTSETTINGPAGE_H__
|
williamr@2
|
24 |
#define __AKNTEXTSETTINGPAGE_H__
|
williamr@2
|
25 |
|
williamr@2
|
26 |
// For coecontrol and its observer
|
williamr@2
|
27 |
#include <coecntrl.h>
|
williamr@2
|
28 |
#include <coecobs.h>
|
williamr@2
|
29 |
|
williamr@2
|
30 |
#include <eikdef.h>
|
williamr@2
|
31 |
#include <eikedwin.h>
|
williamr@2
|
32 |
#include "aknsettingpage.h"
|
williamr@2
|
33 |
#include "aknnumedwin.h"
|
williamr@2
|
34 |
|
williamr@2
|
35 |
/**
|
williamr@2
|
36 |
* This class is an intermediate pure virtual class for all setting page classes that host
|
williamr@2
|
37 |
* Edwins.
|
williamr@2
|
38 |
*
|
williamr@2
|
39 |
* It implements type-specific access to the hosted editor and common drawing code
|
williamr@2
|
40 |
*/
|
williamr@2
|
41 |
class CAknEdwinSettingPage : public CAknSettingPage
|
williamr@2
|
42 |
{
|
williamr@2
|
43 |
|
williamr@2
|
44 |
public:
|
williamr@2
|
45 |
|
williamr@2
|
46 |
/**
|
williamr@2
|
47 |
* Common access to the edwin for descendant classes
|
williamr@2
|
48 |
*
|
williamr@2
|
49 |
* @return Pointer to contained edwin control
|
williamr@2
|
50 |
*/
|
williamr@2
|
51 |
IMPORT_C CEikEdwin* TextControl();
|
williamr@2
|
52 |
|
williamr@2
|
53 |
/**
|
williamr@2
|
54 |
* From CCoeControl.
|
williamr@2
|
55 |
* Handles pointer events
|
williamr@2
|
56 |
*/
|
williamr@2
|
57 |
IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
|
williamr@2
|
58 |
|
williamr@2
|
59 |
protected:
|
williamr@2
|
60 |
/**
|
williamr@2
|
61 |
* Simple constructor depending only on a single resource Id.
|
williamr@2
|
62 |
*
|
williamr@2
|
63 |
* @param aSettingPageResourceId Setting Page resource id to use
|
williamr@2
|
64 |
*/
|
williamr@2
|
65 |
IMPORT_C CAknEdwinSettingPage( TInt ResourceId );
|
williamr@2
|
66 |
/**
|
williamr@2
|
67 |
* Constructor that allows separate setting page and editor resources
|
williamr@2
|
68 |
*
|
williamr@2
|
69 |
* This constructor allows the use of setting page using only the editor resource. Other combinations are also possible
|
williamr@2
|
70 |
*
|
williamr@2
|
71 |
* In all cases the number (if supplied i.e. <> 0 ) is used.
|
williamr@2
|
72 |
*
|
williamr@2
|
73 |
* Editor Resource Setting Page Resource
|
williamr@2
|
74 |
* present present Both are used (but text & number overridden)
|
williamr@2
|
75 |
* = 0 present Editor resource is used via SP resource (Effectively like the other constructor)
|
williamr@2
|
76 |
* present = 0 Default Avkon SP resource if used + this editor resource
|
williamr@2
|
77 |
* = 0 = 0 uses default resource for both SP and editor. This is OK if:
|
williamr@2
|
78 |
* i) control type is present,
|
williamr@2
|
79 |
* ii) a default resource exists ( OK for text, integer, date, time, duration )
|
williamr@2
|
80 |
*
|
williamr@2
|
81 |
* Note: THe first argument is a TDesC* (rather than TDesC&) because the other constructor
|
williamr@2
|
82 |
* cannot initialize such a member without allocation or having an internal dummy buffer.
|
williamr@2
|
83 |
* Note that this buffer must be owned by the client until ExecuteLD has been called.
|
williamr@2
|
84 |
*
|
williamr@2
|
85 |
* Rules for text and numbers: The rules are the same for both: (non-zero length) text or number other
|
williamr@2
|
86 |
* than EAknSettingPageNoOrdinalDisplayed if given in this constructor will not override resource
|
williamr@2
|
87 |
* (unless that is zero length or EAknSettingPageNoOrdinalDisplayed). Note, however, that text or number given via the
|
williamr@2
|
88 |
* specific API for setting them, WILL override resource.
|
williamr@2
|
89 |
* It is assumed that number from resource is very rare. Special text is somewhat more likely.
|
williamr@2
|
90 |
*
|
williamr@2
|
91 |
* @param aSettingTitleText Text at top of setting pane; EXTERNALLY OWNED
|
williamr@2
|
92 |
* @param aSettingNumber Number at top left (if present)
|
williamr@2
|
93 |
* @param aControlType Determines the type constructed and how its resource is read
|
williamr@2
|
94 |
* @param aEditorResourceId Editor resource to use in the setting page (if present)
|
williamr@2
|
95 |
* @param aSettingPageResourceId Setting Page to use (if present)
|
williamr@2
|
96 |
*/
|
williamr@2
|
97 |
|
williamr@2
|
98 |
IMPORT_C CAknEdwinSettingPage(
|
williamr@2
|
99 |
const TDesC* aSettingTitleText,
|
williamr@2
|
100 |
TInt aSettingNumber,
|
williamr@2
|
101 |
TInt aControlType,
|
williamr@2
|
102 |
TInt aEditorResourceId,
|
williamr@2
|
103 |
TInt aSettingPageResourceId );
|
williamr@2
|
104 |
|
williamr@2
|
105 |
//
|
williamr@2
|
106 |
// From CCoeControl
|
williamr@2
|
107 |
//
|
williamr@2
|
108 |
protected:
|
williamr@2
|
109 |
/**
|
williamr@2
|
110 |
* No implementation of SizeChanged is delivered with this class
|
williamr@2
|
111 |
*
|
williamr@2
|
112 |
*/
|
williamr@2
|
113 |
virtual void SizeChanged() = 0;
|
williamr@2
|
114 |
|
williamr@2
|
115 |
/**
|
williamr@2
|
116 |
* Common draw function for laid-out descendent setting pages.
|
williamr@2
|
117 |
* This should not need to be re-implemented as long as the rectangle members are
|
williamr@2
|
118 |
* all that is needed
|
williamr@2
|
119 |
*
|
williamr@2
|
120 |
* @param aRect rectangle within which to perform the draw
|
williamr@2
|
121 |
*/
|
williamr@2
|
122 |
IMPORT_C void Draw(const TRect& aRect) const;
|
williamr@2
|
123 |
|
williamr@2
|
124 |
private:
|
williamr@2
|
125 |
/**
|
williamr@2
|
126 |
* From CAknControl
|
williamr@2
|
127 |
*/
|
williamr@2
|
128 |
IMPORT_C void* ExtensionInterface( TUid aInterface );
|
williamr@2
|
129 |
|
williamr@2
|
130 |
private:
|
williamr@2
|
131 |
/**
|
williamr@2
|
132 |
* New reserved method with this class
|
williamr@2
|
133 |
*
|
williamr@2
|
134 |
*/
|
williamr@2
|
135 |
IMPORT_C virtual void CAknEdwinSettingPage_Reserved_1();
|
williamr@2
|
136 |
|
williamr@2
|
137 |
protected:
|
williamr@2
|
138 |
/**
|
williamr@2
|
139 |
* Rectangle within which to layout the edwin. Not drawn
|
williamr@2
|
140 |
*/
|
williamr@2
|
141 |
TAknLayoutRect iEdwinLayoutRect;
|
williamr@2
|
142 |
|
williamr@2
|
143 |
/**
|
williamr@2
|
144 |
* Horizontal shadow rectangle
|
williamr@2
|
145 |
*/
|
williamr@2
|
146 |
TAknLayoutRect iHorizontalShadow;
|
williamr@2
|
147 |
|
williamr@2
|
148 |
/**
|
williamr@2
|
149 |
* Vertical shadow rectangle
|
williamr@2
|
150 |
*/
|
williamr@2
|
151 |
TAknLayoutRect iVerticalShadow;
|
williamr@2
|
152 |
|
williamr@2
|
153 |
/**
|
williamr@2
|
154 |
* Rectangle drawn around the edwin
|
williamr@2
|
155 |
*/
|
williamr@2
|
156 |
TAknLayoutRect iOutlineFrame;
|
williamr@2
|
157 |
|
williamr@2
|
158 |
private:
|
williamr@2
|
159 |
TInt iSpare;
|
williamr@2
|
160 |
};
|
williamr@2
|
161 |
|
williamr@2
|
162 |
/**
|
williamr@2
|
163 |
* Implementation of the 6 line textual setting page.
|
williamr@2
|
164 |
* A multi-line edwin is displayed when the setting page is executing.
|
williamr@2
|
165 |
* An externally held text descriptor is altered by user input
|
williamr@2
|
166 |
*/
|
williamr@2
|
167 |
class CAknTextSettingPageExtension;
|
williamr@2
|
168 |
|
williamr@2
|
169 |
class CAknTextSettingPage : public CAknEdwinSettingPage
|
williamr@2
|
170 |
{
|
williamr@2
|
171 |
public:
|
williamr@2
|
172 |
|
williamr@2
|
173 |
// Flags to modify the behaviour of the editor
|
williamr@2
|
174 |
enum TAknTextSettingPageFlags
|
williamr@2
|
175 |
{
|
williamr@2
|
176 |
EZeroLengthNotOffered = 0x0, // DEPRECATED. This enum preserved but with value 0
|
williamr@2
|
177 |
EPutCursorAtEnd = 0x0, // DEPRECATED. This is already default so putting flag at beginning is more useful
|
williamr@2
|
178 |
EZeroLengthAllowed = 0x0000001,
|
williamr@2
|
179 |
ENoInitialSelection = 0x0000004, // DEPRECATED and no longer used
|
williamr@2
|
180 |
EPutCursorAtBeginning = 0x0000008, // DEPRECATED and no longer used
|
williamr@2
|
181 |
// Instructs the TextSettingPage not to override any of the Edwin's cursor and selection flags
|
williamr@2
|
182 |
EUseEdwinCursorAndSelectionFlags = 0x0000010, // DEPRECATED
|
williamr@2
|
183 |
EPredictiveTextEntryPermitted = 0x0020
|
williamr@2
|
184 |
};
|
williamr@2
|
185 |
|
williamr@2
|
186 |
public:
|
williamr@2
|
187 |
/**
|
williamr@2
|
188 |
* Simple constructor depending only on a single resource Id. Editor resource is given via
|
williamr@2
|
189 |
* the link in the setting page resource.
|
williamr@2
|
190 |
*
|
williamr@2
|
191 |
* @param aSettingPageResourceId Setting Page to use (if present)
|
williamr@2
|
192 |
* @param aText Reference to text for editing
|
williamr@2
|
193 |
* @param aTextSettingPageFlags option flags for miscellaneous things
|
williamr@2
|
194 |
*/
|
williamr@2
|
195 |
IMPORT_C CAknTextSettingPage(TInt aResourceID, TDes& aText, TInt aTextSettingPageFlags = 0 );
|
williamr@2
|
196 |
/**
|
williamr@2
|
197 |
* Constructor that allows separate setting page and editor resources
|
williamr@2
|
198 |
*
|
williamr@2
|
199 |
* This constructor allows the use of setting page using only the editor resource. Other combinations are also possible
|
williamr@2
|
200 |
*
|
williamr@2
|
201 |
* In all cases the number (if supplied i.e. <> 0 ) is used.
|
williamr@2
|
202 |
*
|
williamr@2
|
203 |
* Editor Resource Setting Page Resource
|
williamr@2
|
204 |
* present present Both are used (but text & number overridden)
|
williamr@2
|
205 |
* = 0 present Editor resource is used via SP resource (Effectively like the other constructor)
|
williamr@2
|
206 |
* present = 0 Default Avkon SP resource if used + this editor resource
|
williamr@2
|
207 |
* = 0 = 0 uses default resource for both SP and editor. This is OK if:
|
williamr@2
|
208 |
* i) control type is present,
|
williamr@2
|
209 |
* ii) a default resource exists ( OK for text, integer, date, time, duration )
|
williamr@2
|
210 |
*
|
williamr@2
|
211 |
* Note: The first argument is a TDesC* (rather than TDesC&) because the other constructor
|
williamr@2
|
212 |
* cannot initialize such a member without allocation or having an internal dummy buffer.
|
williamr@2
|
213 |
* Note that this buffer must be owned by the client until ExecuteLD has been called.
|
williamr@2
|
214 |
*
|
williamr@2
|
215 |
* Rules for text and numbers: The rules are the same for both: (non-zero length) text or number other
|
williamr@2
|
216 |
* than EAknSettingPageNoOrdinalDisplayed if given in this constructor will not override resource
|
williamr@2
|
217 |
* (unless that is zero length or EAknSettingPageNoOrdinalDisplayed). Note, however, that text or number given via the
|
williamr@2
|
218 |
* specific API for setting them, WILL override resource.
|
williamr@2
|
219 |
* It is assumed that number from resource is very rare. Special text is somewhat more likely.
|
williamr@2
|
220 |
*
|
williamr@2
|
221 |
* @param aSettingTitleText Text at top of setting pane; OWNED EXTERNALLY
|
williamr@2
|
222 |
* @param aSettingNumber Number at top left (if present)
|
williamr@2
|
223 |
* @param aControlType Determines the type constructed and how its resource is read
|
williamr@2
|
224 |
* @param aEditorResourceId Editor resource to use in the setting page (if present)
|
williamr@2
|
225 |
* @param aSettingPageResourceId Setting Page to use (if present)
|
williamr@2
|
226 |
* @param aText Reference to text for editing
|
williamr@2
|
227 |
* @param aTextSettingPageFlags option flags for miscellaneous things
|
williamr@2
|
228 |
*/
|
williamr@2
|
229 |
IMPORT_C CAknTextSettingPage( const TDesC* aSettingTitleText,
|
williamr@2
|
230 |
TInt aSettingNumber,
|
williamr@2
|
231 |
TInt aControlType,
|
williamr@2
|
232 |
TInt aEditorResourceId,
|
williamr@2
|
233 |
TInt aSettingPageResourceId,
|
williamr@2
|
234 |
TDes& aText,
|
williamr@2
|
235 |
TInt aTextSettingPageFlags = 0);
|
williamr@2
|
236 |
|
williamr@2
|
237 |
/**
|
williamr@2
|
238 |
* 2nd stage construction for this specific type. Calls BaseConstructL in
|
williamr@2
|
239 |
* CAknSettingPage, where the object is constructed from resource.
|
williamr@2
|
240 |
*
|
williamr@2
|
241 |
* After calling this method, the contained editor is fully constructed and has its text set,
|
williamr@2
|
242 |
* copied from the aText parameter of the constructor.
|
williamr@2
|
243 |
*
|
williamr@2
|
244 |
* This constructor can be called prior to a call to ExecuteLD in order to ensure
|
williamr@2
|
245 |
* construction of the editor if API needs to be called on it prior to setting page launch.
|
williamr@2
|
246 |
* ExecuteLD will not attempt itself to do the construction a 2nd time.
|
williamr@2
|
247 |
*
|
williamr@2
|
248 |
*/
|
williamr@2
|
249 |
IMPORT_C virtual void ConstructL();
|
williamr@2
|
250 |
|
williamr@2
|
251 |
/**
|
williamr@2
|
252 |
* From CCoeControl.
|
williamr@2
|
253 |
* Handles pointer events
|
williamr@2
|
254 |
*/
|
williamr@2
|
255 |
IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
|
williamr@2
|
256 |
|
williamr@2
|
257 |
|
williamr@2
|
258 |
protected:
|
williamr@2
|
259 |
/**
|
williamr@2
|
260 |
* C++ destructor
|
williamr@2
|
261 |
*
|
williamr@2
|
262 |
*/
|
williamr@2
|
263 |
IMPORT_C virtual ~CAknTextSettingPage();
|
williamr@2
|
264 |
|
williamr@2
|
265 |
//
|
williamr@2
|
266 |
// CAknSettingPage Framework implementations
|
williamr@2
|
267 |
//
|
williamr@2
|
268 |
protected:
|
williamr@2
|
269 |
|
williamr@2
|
270 |
/**
|
williamr@2
|
271 |
* Called immediately prior to activation of the dialog. Framework routine for derived
|
williamr@2
|
272 |
* classes.
|
williamr@2
|
273 |
*
|
williamr@2
|
274 |
*/
|
williamr@2
|
275 |
IMPORT_C virtual void DynamicInitL();
|
williamr@2
|
276 |
|
williamr@2
|
277 |
/**
|
williamr@2
|
278 |
* Called when something has changed and the client's object needs to have its text updated
|
williamr@2
|
279 |
*
|
williamr@2
|
280 |
*/
|
williamr@2
|
281 |
IMPORT_C virtual void UpdateSettingL();
|
williamr@2
|
282 |
|
williamr@2
|
283 |
/**
|
williamr@2
|
284 |
* Called when the user accepts the text and the setting page is about to be dismissed. The latest value of the
|
williamr@2
|
285 |
* text is written to the client's object
|
williamr@2
|
286 |
*/
|
williamr@2
|
287 |
IMPORT_C virtual void AcceptSettingL();
|
williamr@2
|
288 |
|
williamr@2
|
289 |
/**
|
williamr@2
|
290 |
* Called when the user rejects the setting.
|
williamr@2
|
291 |
* A backed up copy is used to restore the initial value
|
williamr@2
|
292 |
*
|
williamr@2
|
293 |
*/
|
williamr@2
|
294 |
IMPORT_C virtual void RestoreOriginalSettingL();
|
williamr@2
|
295 |
|
williamr@2
|
296 |
/**
|
williamr@2
|
297 |
* From MCoeControlObserver:
|
williamr@2
|
298 |
* Acts upon changes in the hosted control's state. If the EUpdateWhenChanged
|
williamr@2
|
299 |
* flag is set, this updates the setting text.
|
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 method to set the validity of the data
|
williamr@2
|
309 |
* This is called when the data changes.
|
williamr@2
|
310 |
*
|
williamr@2
|
311 |
*/
|
williamr@2
|
312 |
IMPORT_C virtual void CheckAndSetDataValidity();
|
williamr@2
|
313 |
|
williamr@2
|
314 |
/**
|
williamr@2
|
315 |
* This method copies out the text from the editor into the client's descriptor
|
williamr@2
|
316 |
*
|
williamr@2
|
317 |
*/
|
williamr@2
|
318 |
IMPORT_C virtual void UpdateTextL();
|
williamr@2
|
319 |
|
williamr@2
|
320 |
/**
|
williamr@2
|
321 |
* Update the CBA. This should be called after a control state change in case
|
williamr@2
|
322 |
* there has been a change in data validity.
|
williamr@2
|
323 |
*
|
williamr@2
|
324 |
*/
|
williamr@2
|
325 |
IMPORT_C virtual void UpdateCbaL();
|
williamr@2
|
326 |
|
williamr@2
|
327 |
/**
|
williamr@2
|
328 |
* Framework method to determine if it is OK to exit the setting page.
|
williamr@2
|
329 |
* Derived classes may check for valid data before allowing the dismissal of the
|
williamr@2
|
330 |
* setting page.
|
williamr@2
|
331 |
*
|
williamr@2
|
332 |
*
|
williamr@2
|
333 |
*
|
williamr@2
|
334 |
* @param aAccept ETrue if the user has indicated to accept the setting page; EFalse otherwise
|
williamr@2
|
335 |
* @return TBool a value indicating whether the setting page should be dismissed
|
williamr@2
|
336 |
*/
|
williamr@2
|
337 |
IMPORT_C virtual TBool OkToExitL(TBool aAccept);
|
williamr@2
|
338 |
|
williamr@2
|
339 |
/**
|
williamr@2
|
340 |
* This routine routes the keys to the editor.
|
williamr@2
|
341 |
* However, if the menu is showing, then events are sent to the menu.
|
williamr@2
|
342 |
*
|
williamr@2
|
343 |
* @param aKeyEvent event information
|
williamr@2
|
344 |
* @param aType type of event being handled
|
williamr@2
|
345 |
*
|
williamr@2
|
346 |
*/
|
williamr@2
|
347 |
IMPORT_C TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType);
|
williamr@2
|
348 |
|
williamr@2
|
349 |
|
williamr@2
|
350 |
/**
|
williamr@2
|
351 |
* Reserved methods for CAknSettingPage hierarchy
|
williamr@2
|
352 |
*/
|
williamr@2
|
353 |
private:
|
williamr@2
|
354 |
IMPORT_C virtual void CAknSettingPage_Reserved_1();
|
williamr@2
|
355 |
IMPORT_C virtual void CAknSettingPage_Reserved_2();
|
williamr@2
|
356 |
|
williamr@2
|
357 |
//
|
williamr@2
|
358 |
// From CCoeControl
|
williamr@2
|
359 |
//
|
williamr@2
|
360 |
|
williamr@2
|
361 |
protected:
|
williamr@2
|
362 |
|
williamr@2
|
363 |
/**
|
williamr@2
|
364 |
* From CCoeControl
|
williamr@2
|
365 |
* This routine is called as part of the set-up of the control. It is the place to put
|
williamr@2
|
366 |
* the layout code.
|
williamr@2
|
367 |
*
|
williamr@2
|
368 |
*/
|
williamr@2
|
369 |
IMPORT_C virtual void SizeChanged();
|
williamr@2
|
370 |
|
williamr@2
|
371 |
/**
|
williamr@2
|
372 |
* Writes the internal state of the control and its components to aStream.
|
williamr@2
|
373 |
* Does nothing in release mode.
|
williamr@2
|
374 |
* Designed to be overidden and base called by subclasses.
|
williamr@2
|
375 |
*
|
williamr@2
|
376 |
* @param aWriteSteam A connected write stream
|
williamr@2
|
377 |
*/
|
williamr@2
|
378 |
IMPORT_C virtual void WriteInternalStateL(RWriteStream& aWriteStream) const;
|
williamr@2
|
379 |
|
williamr@2
|
380 |
private:
|
williamr@2
|
381 |
/**
|
williamr@2
|
382 |
* Reserved method derived from CCoeControl
|
williamr@2
|
383 |
*/
|
williamr@2
|
384 |
IMPORT_C virtual void Reserved_2();
|
williamr@2
|
385 |
|
williamr@2
|
386 |
private:
|
williamr@2
|
387 |
/**
|
williamr@2
|
388 |
* From CAknControl
|
williamr@2
|
389 |
*/
|
williamr@2
|
390 |
IMPORT_C void* ExtensionInterface( TUid aInterface );
|
williamr@2
|
391 |
|
williamr@2
|
392 |
/**
|
williamr@2
|
393 |
* Reserved method from CAknEdwinSettingPage
|
williamr@2
|
394 |
*
|
williamr@2
|
395 |
*/
|
williamr@2
|
396 |
IMPORT_C virtual void CAknEdwinSettingPage_Reserved_1();
|
williamr@2
|
397 |
|
williamr@2
|
398 |
private:
|
williamr@2
|
399 |
// restarts timer that blocks Ok button for the period FEP may reject the edit
|
williamr@2
|
400 |
void RestartMultitapWaitTimer();
|
williamr@2
|
401 |
|
williamr@2
|
402 |
private:
|
williamr@2
|
403 |
HBufC* iBackupText;
|
williamr@2
|
404 |
TDes& iText;
|
williamr@2
|
405 |
TInt iTextSettingPageFlags;
|
williamr@2
|
406 |
CAknTextSettingPageExtension* iExtension;
|
williamr@2
|
407 |
};
|
williamr@2
|
408 |
|
williamr@2
|
409 |
|
williamr@2
|
410 |
/**
|
williamr@2
|
411 |
* Setting page specialized for display of CAknIntegerEdwin
|
williamr@2
|
412 |
*
|
williamr@2
|
413 |
*/
|
williamr@2
|
414 |
class CAknIntegerSettingPage : public CAknEdwinSettingPage
|
williamr@2
|
415 |
{
|
williamr@2
|
416 |
public:
|
williamr@2
|
417 |
|
williamr@2
|
418 |
// Flags to modify the behaviour of the editor
|
williamr@2
|
419 |
enum TAknIntegerSettingPageFlags
|
williamr@2
|
420 |
{
|
williamr@2
|
421 |
EInvalidValueNotOffered = 0x0,
|
williamr@2
|
422 |
EEmptyValueAllowed = 0x0000001,
|
williamr@2
|
423 |
EInvalidValueAllowed = 0x0000002,
|
williamr@2
|
424 |
ENoInitialSelection = 0x0000004,
|
williamr@2
|
425 |
EPutCursorAtBeginning = 0x0000008
|
williamr@2
|
426 |
};
|
williamr@2
|
427 |
|
williamr@2
|
428 |
public:
|
williamr@2
|
429 |
IMPORT_C CAknIntegerSettingPage(TInt aResourceID, TInt& aValue, TInt aTextSettingPageFlags = 0 );
|
williamr@2
|
430 |
/**
|
williamr@2
|
431 |
* Constructor that allows separate setting page and editor resources
|
williamr@2
|
432 |
*
|
williamr@2
|
433 |
* This constructor allows the use of setting page using only the editor resource. Other combinations are also possible
|
williamr@2
|
434 |
*
|
williamr@2
|
435 |
* In all cases the number (if supplied i.e. <> 0 ) is used.
|
williamr@2
|
436 |
*
|
williamr@2
|
437 |
* Editor Resource Setting Page Resource
|
williamr@2
|
438 |
* present present Both are used (but text & number overridden)
|
williamr@2
|
439 |
* = 0 present Editor resource is used via SP resource (Effectively like the other constructor)
|
williamr@2
|
440 |
* present = 0 Default Avkon SP resource if used + this editor resource
|
williamr@2
|
441 |
* = 0 = 0 uses default resource for both SP and editor. This is OK if:
|
williamr@2
|
442 |
* i) control type is present,
|
williamr@2
|
443 |
* ii) a default resource exists ( OK for text, integer, date, time, duration )
|
williamr@2
|
444 |
*
|
williamr@2
|
445 |
* Note: The first argument is a TDesC* (rather than TDesC&) because the other constructor
|
williamr@2
|
446 |
* cannot initialize such a member without allocation or having an internal dummy buffer.
|
williamr@2
|
447 |
*
|
williamr@2
|
448 |
* Rules for text and numbers: The rules are the same for both: (non-zero length) text or number other
|
williamr@2
|
449 |
* than EAknSettingPageNoOrdinalDisplayed if given in this constructor will not override resource
|
williamr@2
|
450 |
* (unless that is zero length or EAknSettingPageNoOrdinalDisplayed). Note, however, that text or number given via the
|
williamr@2
|
451 |
* specific API for setting them, WILL override resource.
|
williamr@2
|
452 |
* It is assumed that number from resource is very rare. Special text is somewhat more likely.
|
williamr@2
|
453 |
*
|
williamr@2
|
454 |
* @param aSettingTitleText Text at top of setting pane; OWNED EXTERNALLY
|
williamr@2
|
455 |
* @param aSettingNumber Number at top left (if present)
|
williamr@2
|
456 |
* @param aControlType Determines the type constructed and how its resource is read
|
williamr@2
|
457 |
* @param aEditorResourceId Editor resource to use in the setting page (if present)
|
williamr@2
|
458 |
* @param aSettingPageResourceId Setting Page to use (if present)
|
williamr@2
|
459 |
* @param aValue Reference to integer value for editing
|
williamr@2
|
460 |
* @param aIntegerSettingPageFlags option flags for miscellaneous things
|
williamr@2
|
461 |
*/
|
williamr@2
|
462 |
IMPORT_C CAknIntegerSettingPage( const TDesC* aSettingTitleText,
|
williamr@2
|
463 |
TInt aSettingNumber,
|
williamr@2
|
464 |
TInt aControlType,
|
williamr@2
|
465 |
TInt aEditorResourceId,
|
williamr@2
|
466 |
TInt aSettingPageResourceId,
|
williamr@2
|
467 |
TInt& aValue,
|
williamr@2
|
468 |
TInt aIntegerSettingPageFlags = 0);
|
williamr@2
|
469 |
|
williamr@2
|
470 |
/**
|
williamr@2
|
471 |
* 2nd stage construction for this specific type. Call BaseConstructL in
|
williamr@2
|
472 |
* CAknSettingPage, where the object is constructed from resource.
|
williamr@2
|
473 |
*/
|
williamr@2
|
474 |
IMPORT_C virtual void ConstructL();
|
williamr@2
|
475 |
|
williamr@2
|
476 |
/**
|
williamr@2
|
477 |
* Type-specific access to the hosted editor
|
williamr@2
|
478 |
*
|
williamr@2
|
479 |
* @return CAknIntegerEdwin* pointer to the current hosted editor
|
williamr@2
|
480 |
*/
|
williamr@2
|
481 |
IMPORT_C CAknIntegerEdwin* IntegerEditorControl();
|
williamr@2
|
482 |
|
williamr@2
|
483 |
/**
|
williamr@2
|
484 |
* From CCoeControl.
|
williamr@2
|
485 |
* Handles pointer events
|
williamr@2
|
486 |
*/
|
williamr@2
|
487 |
IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
|
williamr@2
|
488 |
|
williamr@2
|
489 |
//
|
williamr@2
|
490 |
// Framework methods from CAknSettingPage
|
williamr@2
|
491 |
//
|
williamr@2
|
492 |
protected:
|
williamr@2
|
493 |
|
williamr@2
|
494 |
/**
|
williamr@2
|
495 |
* Called immediately prior to activation of the dialog. Framework routine for derived
|
williamr@2
|
496 |
* classes.
|
williamr@2
|
497 |
*
|
williamr@2
|
498 |
*/
|
williamr@2
|
499 |
IMPORT_C virtual void DynamicInitL();
|
williamr@2
|
500 |
|
williamr@2
|
501 |
/**
|
williamr@2
|
502 |
* Called when something has changed and the client's object needs to have its value updated
|
williamr@2
|
503 |
*
|
williamr@2
|
504 |
*/
|
williamr@2
|
505 |
IMPORT_C virtual void UpdateSettingL();
|
williamr@2
|
506 |
|
williamr@2
|
507 |
|
williamr@2
|
508 |
/**
|
williamr@2
|
509 |
* Called when the user rejects the setting. A backup copy may need to be restored if UpdateWhenChanged flag was set
|
williamr@2
|
510 |
*
|
williamr@2
|
511 |
*/
|
williamr@2
|
512 |
IMPORT_C virtual void RestoreOriginalSettingL();
|
williamr@2
|
513 |
|
williamr@2
|
514 |
/**
|
williamr@2
|
515 |
* Framework method to set the validity of the data
|
williamr@2
|
516 |
* This is called when the data changes.
|
williamr@2
|
517 |
* May be over-ridden to change the validation rules.
|
williamr@2
|
518 |
*
|
williamr@2
|
519 |
*/
|
williamr@2
|
520 |
IMPORT_C virtual void CheckAndSetDataValidity();
|
williamr@2
|
521 |
|
williamr@2
|
522 |
/**
|
williamr@2
|
523 |
* This framework method is used to update the contents of the CBA in a custom way.
|
williamr@2
|
524 |
* Some setting page classes implement a degree of validation and will implement this.
|
williamr@2
|
525 |
* Derived classes should ensure that this is being called frequently enough for their
|
williamr@2
|
526 |
* purposes.
|
williamr@2
|
527 |
*/
|
williamr@2
|
528 |
IMPORT_C virtual void UpdateCbaL();
|
williamr@2
|
529 |
|
williamr@2
|
530 |
/**
|
williamr@2
|
531 |
* Reserved methods for CAknSettingPage hierarchy
|
williamr@2
|
532 |
*/
|
williamr@2
|
533 |
private:
|
williamr@2
|
534 |
IMPORT_C virtual void CAknSettingPage_Reserved_1();
|
williamr@2
|
535 |
IMPORT_C virtual void CAknSettingPage_Reserved_2();
|
williamr@2
|
536 |
|
williamr@2
|
537 |
|
williamr@2
|
538 |
|
williamr@2
|
539 |
//
|
williamr@2
|
540 |
// From MEikControlObserver
|
williamr@2
|
541 |
//
|
williamr@2
|
542 |
|
williamr@2
|
543 |
protected:
|
williamr@2
|
544 |
|
williamr@2
|
545 |
/**
|
williamr@2
|
546 |
* From MCoeControlObserver:
|
williamr@2
|
547 |
* Acts upon changes in the hosted control's state.
|
williamr@2
|
548 |
*
|
williamr@2
|
549 |
* The implementation of this class is trivial and should be able to be
|
williamr@2
|
550 |
* safely re-implemented in directly client-derived classes.
|
williamr@2
|
551 |
* For non-base setting page classes, a call to the base class should be made
|
williamr@2
|
552 |
*
|
williamr@2
|
553 |
* @param aControl The control changing its state (not used)
|
williamr@2
|
554 |
* @param aEventType The type of control event
|
williamr@2
|
555 |
*/
|
williamr@2
|
556 |
IMPORT_C virtual void HandleControlEventL(CCoeControl* aControl, TCoeEvent aEventType );
|
williamr@2
|
557 |
|
williamr@2
|
558 |
//
|
williamr@2
|
559 |
// From CCoeControl
|
williamr@2
|
560 |
//
|
williamr@2
|
561 |
protected:
|
williamr@2
|
562 |
|
williamr@2
|
563 |
/**
|
williamr@2
|
564 |
* From CCoeControl
|
williamr@2
|
565 |
* This routine is called as part of the set-up of the control. It is the place to put
|
williamr@2
|
566 |
* layout code.
|
williamr@2
|
567 |
*
|
williamr@2
|
568 |
*/
|
williamr@2
|
569 |
IMPORT_C virtual void SizeChanged();
|
williamr@2
|
570 |
|
williamr@2
|
571 |
|
williamr@2
|
572 |
/**
|
williamr@2
|
573 |
* Writes the internal state of the control and its components to aStream.
|
williamr@2
|
574 |
* Does nothing in release mode.
|
williamr@2
|
575 |
* Designed to be overidden and base called by subclasses.
|
williamr@2
|
576 |
*
|
williamr@2
|
577 |
* @param aWriteSteam A connected write stream
|
williamr@2
|
578 |
*/
|
williamr@2
|
579 |
IMPORT_C virtual void WriteInternalStateL(RWriteStream& aWriteStream) const;
|
williamr@2
|
580 |
|
williamr@2
|
581 |
private:
|
williamr@2
|
582 |
/**
|
williamr@2
|
583 |
* Reserved method derived from CCoeControl
|
williamr@2
|
584 |
*/
|
williamr@2
|
585 |
IMPORT_C virtual void Reserved_2();
|
williamr@2
|
586 |
|
williamr@2
|
587 |
private:
|
williamr@2
|
588 |
/**
|
williamr@2
|
589 |
* From CAknControl
|
williamr@2
|
590 |
*/
|
williamr@2
|
591 |
IMPORT_C void* ExtensionInterface( TUid aInterface );
|
williamr@2
|
592 |
|
williamr@2
|
593 |
private:
|
williamr@2
|
594 |
|
williamr@2
|
595 |
/**
|
williamr@2
|
596 |
* Reserved method from CAknEdwinSettingPage
|
williamr@2
|
597 |
*
|
williamr@2
|
598 |
*/
|
williamr@2
|
599 |
IMPORT_C virtual void CAknEdwinSettingPage_Reserved_1();
|
williamr@2
|
600 |
|
williamr@2
|
601 |
private:
|
williamr@2
|
602 |
TInt iBackupValue;
|
williamr@2
|
603 |
TInt& iValue;
|
williamr@2
|
604 |
TInt iIntegerSettingPageFlags;
|
williamr@2
|
605 |
TInt iSpare_1;
|
williamr@2
|
606 |
};
|
williamr@2
|
607 |
|
williamr@2
|
608 |
|
williamr@2
|
609 |
#endif
|