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 |
* Support for Setting Item Lists (See Selection Service specification)
|
williamr@2
|
16 |
* Contains setting item classes (whole hierarchy) and the
|
williamr@2
|
17 |
* array classes used to set up the setting item listbox
|
williamr@2
|
18 |
*
|
williamr@2
|
19 |
*/
|
williamr@2
|
20 |
|
williamr@2
|
21 |
|
williamr@2
|
22 |
#if !defined(__AKNSETTINGITEMLIST_H__)
|
williamr@2
|
23 |
#define __AKNSETTINGITEMLIST_H__
|
williamr@2
|
24 |
|
williamr@2
|
25 |
#include <in_sock.h>
|
williamr@2
|
26 |
|
williamr@2
|
27 |
#include <AknControl.h>
|
williamr@2
|
28 |
|
williamr@2
|
29 |
// For graphics API
|
williamr@2
|
30 |
#include <gulicon.h>
|
williamr@2
|
31 |
|
williamr@2
|
32 |
// For CEikFormattedListBox
|
williamr@2
|
33 |
#include <eikfrlb.h>
|
williamr@2
|
34 |
|
williamr@2
|
35 |
// For setting page
|
williamr@2
|
36 |
#include <aknsettingpage.h>
|
williamr@2
|
37 |
|
williamr@2
|
38 |
// For query stuff
|
williamr@4
|
39 |
#include <AknQueryValueText.h>
|
williamr@2
|
40 |
|
williamr@2
|
41 |
|
williamr@2
|
42 |
// Maximum length of the blanking text
|
williamr@2
|
43 |
const TInt KMaxPasswordBlankingTextLength = 10;
|
williamr@2
|
44 |
|
williamr@2
|
45 |
class CAknSettingItemExtension;
|
williamr@2
|
46 |
|
williamr@2
|
47 |
|
williamr@2
|
48 |
/**
|
williamr@2
|
49 |
* CAknSettingItem is the base class for all setting items. The abstracted functionality
|
williamr@2
|
50 |
* is implemented in this class if possible.
|
williamr@2
|
51 |
*
|
williamr@2
|
52 |
* All array of setting items is held in CAknSettingItemArray, which in turn is owned by
|
williamr@2
|
53 |
* CAknSettingItemList, a listbox type.
|
williamr@2
|
54 |
*
|
williamr@2
|
55 |
*/
|
williamr@2
|
56 |
class CAknSettingItem : public CBase, public MAknSettingPageObserver
|
williamr@2
|
57 |
{
|
williamr@2
|
58 |
|
williamr@2
|
59 |
friend class CAknSettingItemArray;
|
williamr@2
|
60 |
|
williamr@2
|
61 |
public:
|
williamr@2
|
62 |
enum TFlags
|
williamr@2
|
63 |
{
|
williamr@2
|
64 |
EIsHidden = 0x1,
|
williamr@2
|
65 |
EHasIcon = 0x2,
|
williamr@2
|
66 |
EIsNumberedStyle = 0x4,
|
williamr@2
|
67 |
ENoProtection = 0x8,
|
williamr@2
|
68 |
EViewOnly = 0x10,
|
williamr@2
|
69 |
EProtected = 0x20
|
williamr@2
|
70 |
};
|
williamr@2
|
71 |
|
williamr@2
|
72 |
// Setting item protection states
|
williamr@2
|
73 |
enum TSettingItemProtection
|
williamr@2
|
74 |
{
|
williamr@2
|
75 |
ENoSettingItemProtection,
|
williamr@2
|
76 |
ESettingItemViewOnly,
|
williamr@2
|
77 |
ESettingItemProtected
|
williamr@2
|
78 |
};
|
williamr@2
|
79 |
public:
|
williamr@2
|
80 |
/**
|
williamr@2
|
81 |
* Constructor
|
williamr@2
|
82 |
*
|
williamr@2
|
83 |
* @param the unique identifier fo the setting item (not its number)
|
williamr@2
|
84 |
*/
|
williamr@2
|
85 |
IMPORT_C CAknSettingItem( TInt identifier );
|
williamr@2
|
86 |
|
williamr@2
|
87 |
/**
|
williamr@2
|
88 |
* Destructor
|
williamr@2
|
89 |
*/
|
williamr@2
|
90 |
IMPORT_C ~CAknSettingItem();
|
williamr@2
|
91 |
|
williamr@2
|
92 |
/**
|
williamr@2
|
93 |
*
|
williamr@2
|
94 |
* 2nd-stage constuctor. Resource for setting item is read externally in setting item list
|
williamr@2
|
95 |
* and the values are passed here.
|
williamr@2
|
96 |
*/
|
williamr@2
|
97 |
IMPORT_C void ConstructL(
|
williamr@2
|
98 |
const TBool aIsNumberedStyle,
|
williamr@2
|
99 |
const TInt aOrdinal,
|
williamr@2
|
100 |
const TDesC& aSettingTitle,
|
williamr@2
|
101 |
CArrayPtr<CGulIcon>* aIconArray,
|
williamr@2
|
102 |
const TInt aSettingPageResource,
|
williamr@2
|
103 |
const TInt aEditorControlType,
|
williamr@2
|
104 |
const TInt aSettingEditorResource = 0,
|
williamr@2
|
105 |
const TInt aAssociatedResource = 0 );
|
williamr@2
|
106 |
|
williamr@2
|
107 |
/**
|
williamr@2
|
108 |
* This command externalizes the current setting. The displayed (internal) copy
|
williamr@2
|
109 |
* is transferred to the external copy (the one referenced in the constructor).
|
williamr@2
|
110 |
*
|
williamr@2
|
111 |
* This must be called by the client if he wants this to happen. Note that StoreAllL()
|
williamr@2
|
112 |
* on the setting item list will call this for each setting item.
|
williamr@2
|
113 |
*/
|
williamr@2
|
114 |
IMPORT_C virtual void StoreL();
|
williamr@2
|
115 |
/*
|
williamr@2
|
116 |
* The external value is transferred to the internal value
|
williamr@2
|
117 |
* This occurs at construction, but may be called by client code when required.
|
williamr@2
|
118 |
*/
|
williamr@2
|
119 |
IMPORT_C virtual void LoadL();
|
williamr@2
|
120 |
/**
|
williamr@2
|
121 |
*
|
williamr@2
|
122 |
* This launches the setting page
|
williamr@2
|
123 |
*
|
williamr@2
|
124 |
* @param aCalledFromMenu - ignored in this class
|
williamr@2
|
125 |
*
|
williamr@2
|
126 |
*/
|
williamr@2
|
127 |
IMPORT_C virtual void EditItemL( TBool aCalledFromMenu );
|
williamr@2
|
128 |
/**
|
williamr@2
|
129 |
*
|
williamr@2
|
130 |
* This method is called by framework in order to update the text in the setting
|
williamr@2
|
131 |
* item. It may be called by the client.
|
williamr@2
|
132 |
*
|
williamr@2
|
133 |
*/
|
williamr@2
|
134 |
IMPORT_C virtual void UpdateListBoxTextL();
|
williamr@2
|
135 |
|
williamr@2
|
136 |
/**
|
williamr@2
|
137 |
* Access to the setting Name
|
williamr@2
|
138 |
*.@return the setting name
|
williamr@2
|
139 |
*/
|
williamr@2
|
140 |
IMPORT_C TPtrC SettingName();
|
williamr@2
|
141 |
/**
|
williamr@2
|
142 |
* Access to the setting number
|
williamr@2
|
143 |
* @return the setting number
|
williamr@2
|
144 |
*/
|
williamr@2
|
145 |
IMPORT_C TInt SettingNumber() const;
|
williamr@2
|
146 |
/**
|
williamr@2
|
147 |
* Access to the setting visibility
|
williamr@2
|
148 |
* @return ETrue if the setting item is hidden
|
williamr@2
|
149 |
*/
|
williamr@2
|
150 |
IMPORT_C TBool IsHidden() const;
|
williamr@2
|
151 |
/**
|
williamr@2
|
152 |
* Access to the numbering style of the setting item
|
williamr@2
|
153 |
* @return ETrue if it is numbered
|
williamr@2
|
154 |
*/
|
williamr@2
|
155 |
IMPORT_C TBool IsNumberedStyle() const;
|
williamr@2
|
156 |
/**
|
williamr@2
|
157 |
* Set the visibility
|
williamr@2
|
158 |
* @param Set to ETrue to hide the item; EFalse to make it visible
|
williamr@2
|
159 |
*
|
williamr@2
|
160 |
* Note that the setting item array must have be notified of this
|
williamr@2
|
161 |
* by calling CAknSettingItemList::HandleChangeInItemArrayOrVisibility
|
williamr@2
|
162 |
*/
|
williamr@2
|
163 |
IMPORT_C void SetHidden(TBool aHidden );
|
williamr@2
|
164 |
/*
|
williamr@2
|
165 |
* This method obtains the current value's setting text
|
williamr@2
|
166 |
*
|
williamr@2
|
167 |
* @return Reference to descriptor with the text
|
williamr@2
|
168 |
*/
|
williamr@2
|
169 |
IMPORT_C virtual const TDesC& SettingTextL();
|
williamr@2
|
170 |
/**
|
williamr@2
|
171 |
* This gives access to the listbox text content at this item (fully decorated)
|
williamr@2
|
172 |
*
|
williamr@2
|
173 |
* @return pointer to listboxtext. No allocation is performed and no change of ownership
|
williamr@2
|
174 |
*/
|
williamr@2
|
175 |
IMPORT_C HBufC* ListBoxText();
|
williamr@2
|
176 |
/**
|
williamr@2
|
177 |
* Access to the setting item's identifier. This is set in the setting item's constructor
|
williamr@2
|
178 |
* but usually comes via resource in the setting item list read of its resource structure
|
williamr@2
|
179 |
*
|
williamr@2
|
180 |
* @return The identifier of this setting item
|
williamr@2
|
181 |
*/
|
williamr@2
|
182 |
IMPORT_C TInt Identifier() const;
|
williamr@2
|
183 |
/**
|
williamr@2
|
184 |
* Checks if the setting item has a bitmap in its setting contents
|
williamr@2
|
185 |
* @return ETrue if it has a bitmap
|
williamr@2
|
186 |
*/
|
williamr@2
|
187 |
IMPORT_C TBool HasIcon() const;
|
williamr@2
|
188 |
/**
|
williamr@2
|
189 |
* This sets the text to display if the current setting is empty.
|
williamr@2
|
190 |
*
|
williamr@2
|
191 |
* @param text to make display when there is empty setting. A copy is made in the setting item
|
williamr@2
|
192 |
*/
|
williamr@2
|
193 |
IMPORT_C void SetEmptyItemTextL( const TDesC& aEmptyItemText );
|
williamr@2
|
194 |
IMPORT_C void SetCompulsoryIndTextL( const TDesC& aCompulsoryInd );
|
williamr@2
|
195 |
|
williamr@2
|
196 |
// From MAknSettingPageObserver
|
williamr@2
|
197 |
IMPORT_C virtual void HandleSettingPageEventL(CAknSettingPage* aSettingPage,TAknSettingPageEvent aEventType );
|
williamr@2
|
198 |
/**
|
williamr@2
|
199 |
* Get the index at which this item appears in the listbox
|
williamr@2
|
200 |
*
|
williamr@2
|
201 |
* @return index in listbox
|
williamr@2
|
202 |
*/
|
williamr@2
|
203 |
IMPORT_C TInt VisibleIndex();
|
williamr@2
|
204 |
|
williamr@2
|
205 |
/**
|
williamr@2
|
206 |
* Set the flags that are required for some of the setting page constructors
|
williamr@2
|
207 |
*
|
williamr@2
|
208 |
* @param aFlagPattern Flag pattern to set
|
williamr@2
|
209 |
*/
|
williamr@2
|
210 |
IMPORT_C void SetSettingPageFlags( TInt aFlagPattern);
|
williamr@2
|
211 |
|
williamr@2
|
212 |
/**
|
williamr@2
|
213 |
* Access method for the setting page specific flags
|
williamr@2
|
214 |
* @return the flag pattern
|
williamr@2
|
215 |
*/
|
williamr@2
|
216 |
IMPORT_C TInt SettingPageFlags( ) const;
|
williamr@2
|
217 |
|
williamr@2
|
218 |
/**
|
williamr@2
|
219 |
* Set the parent lisbox into the setting item
|
williamr@2
|
220 |
*
|
williamr@2
|
221 |
* @since 2.0
|
williamr@2
|
222 |
* @param aListBox listbox with which the setting item is associated.
|
williamr@2
|
223 |
*/
|
williamr@2
|
224 |
void SetParentListBox( const CEikFormattedCellListBox* aListBox );
|
williamr@2
|
225 |
|
williamr@2
|
226 |
/**
|
williamr@2
|
227 |
* Set the protection state of the setting item
|
williamr@2
|
228 |
*
|
williamr@2
|
229 |
* The protection state is for protecting selected settings from editing.
|
williamr@2
|
230 |
* The protection can be set to:
|
williamr@2
|
231 |
* - prohibit opening of the setting page
|
williamr@2
|
232 |
* - allow access to the setting page, but prohibit editing of it
|
williamr@2
|
233 |
*
|
williamr@2
|
234 |
* The protected item is indicated in the setting item list with a lock icon.
|
williamr@2
|
235 |
* If a user tries to open a protected setting item, a notification is shown
|
williamr@2
|
236 |
* to the user.
|
williamr@2
|
237 |
*
|
williamr@2
|
238 |
* The "view only" -mode is only possible for pop-up setting page.
|
williamr@2
|
239 |
*
|
williamr@2
|
240 |
* @since 3.1
|
williamr@2
|
241 |
* @param aProtected Sets the protection state of the setting item
|
williamr@2
|
242 |
*/
|
williamr@2
|
243 |
IMPORT_C void SetProtectionState( CAknSettingItem::TSettingItemProtection aProtected );
|
williamr@2
|
244 |
|
williamr@2
|
245 |
/**
|
williamr@2
|
246 |
* Get the protection state
|
williamr@2
|
247 |
*
|
williamr@2
|
248 |
* See SetProtected for details for the different states.
|
williamr@2
|
249 |
*
|
williamr@2
|
250 |
* @since 3.1
|
williamr@2
|
251 |
* @return Protection state of the setting item
|
williamr@2
|
252 |
*/
|
williamr@2
|
253 |
IMPORT_C CAknSettingItem::TSettingItemProtection ProtectionState();
|
williamr@2
|
254 |
|
williamr@2
|
255 |
protected:
|
williamr@2
|
256 |
|
williamr@2
|
257 |
|
williamr@2
|
258 |
/**
|
williamr@2
|
259 |
* Method called by framework to complete the construction. Extra allocations of
|
williamr@2
|
260 |
* memory or extra resource reading can happen here.
|
williamr@2
|
261 |
*
|
williamr@2
|
262 |
*/
|
williamr@2
|
263 |
IMPORT_C virtual void CompleteConstructionL();
|
williamr@2
|
264 |
/**
|
williamr@2
|
265 |
*
|
williamr@2
|
266 |
* Method to obtain a new bitmap for the setting content
|
williamr@2
|
267 |
*
|
williamr@2
|
268 |
* This method is usually empty in setting items classes except for volume and slider.
|
williamr@2
|
269 |
* Any derived implementations of this method should call SetIconMask().
|
williamr@2
|
270 |
*
|
williamr@2
|
271 |
*/
|
williamr@2
|
272 |
IMPORT_C virtual CFbsBitmap* CreateBitmapL();
|
williamr@2
|
273 |
|
williamr@2
|
274 |
// Utilities
|
williamr@2
|
275 |
/**
|
williamr@2
|
276 |
*
|
williamr@2
|
277 |
* A setting page should know when it is "Editing". This is set in EditItemL
|
williamr@2
|
278 |
* and cleared to 0 when the dialog is finished.
|
williamr@2
|
279 |
*
|
williamr@2
|
280 |
* @param pointer to the currently executing settting page dialog
|
williamr@2
|
281 |
*
|
williamr@2
|
282 |
*/
|
williamr@2
|
283 |
IMPORT_C void SetSettingPage( CAknSettingPage* aSettingPage );
|
williamr@2
|
284 |
/*
|
williamr@2
|
285 |
* Access to the current setting page
|
williamr@2
|
286 |
*
|
williamr@2
|
287 |
* @return pointer to the currently executing setting page. 0 if there is none
|
williamr@2
|
288 |
*/
|
williamr@2
|
289 |
IMPORT_C CAknSettingPage* SettingPage() const;
|
williamr@2
|
290 |
/**
|
williamr@2
|
291 |
* Performs standard setup on a setting page
|
williamr@2
|
292 |
*
|
williamr@2
|
293 |
*/
|
williamr@2
|
294 |
IMPORT_C void SetUpStandardSettingPageL();
|
williamr@2
|
295 |
/**
|
williamr@2
|
296 |
* Access to the empty text that has been set, or is default
|
williamr@2
|
297 |
*
|
williamr@2
|
298 |
* @return ref to empty text descriptor
|
williamr@2
|
299 |
*/
|
williamr@2
|
300 |
IMPORT_C TDesC& EmptyItemText() const; // Assumed only needs to be used by SettingTextL
|
williamr@2
|
301 |
|
williamr@2
|
302 |
/**
|
williamr@2
|
303 |
* Access to the setting page resource id that might have been read by
|
williamr@2
|
304 |
* the setting item resource.
|
williamr@2
|
305 |
*
|
williamr@2
|
306 |
* @return 0 or the setting page resource id
|
williamr@2
|
307 |
*/
|
williamr@2
|
308 |
IMPORT_C TInt SettingPageResourceId() const;
|
williamr@2
|
309 |
/**
|
williamr@2
|
310 |
* Access to the setting page editor's resource id that might have been read by
|
williamr@2
|
311 |
* the setting item resource.
|
williamr@2
|
312 |
*
|
williamr@2
|
313 |
* @return 0 or the setting page editor's id
|
williamr@2
|
314 |
*/
|
williamr@2
|
315 |
IMPORT_C TInt SettingEditorResourceId() const;
|
williamr@2
|
316 |
/**
|
williamr@2
|
317 |
* Returns the associate editor resource. This is an LLINK in the seting item
|
williamr@2
|
318 |
* resource that subclasses can use in CompleteContstructionL
|
williamr@2
|
319 |
*
|
williamr@2
|
320 |
* @return 0 or the extra resource id
|
williamr@2
|
321 |
*/
|
williamr@2
|
322 |
IMPORT_C TInt AssociatedResourceId() const;
|
williamr@2
|
323 |
/**
|
williamr@2
|
324 |
*
|
williamr@2
|
325 |
* @return the control type of the settin page editor
|
williamr@2
|
326 |
*
|
williamr@2
|
327 |
*/
|
williamr@2
|
328 |
TInt EditorControlType() const;
|
williamr@2
|
329 |
|
williamr@2
|
330 |
/**
|
williamr@2
|
331 |
* This sets the mask of this setting item's icon array, if it exists.
|
williamr@2
|
332 |
* The normal usage of this routine is inside a re-implementation of CAknSettingItem::CreateBitmapL.
|
williamr@2
|
333 |
* It is used to set the mask of the setting item's setting icon as a side effect of a
|
williamr@2
|
334 |
* framework call to CreateBitmapL
|
williamr@2
|
335 |
*
|
williamr@2
|
336 |
* The return value may need to be looked at to decide how to dispose of, for example, an
|
williamr@2
|
337 |
* a CGulIcon that may be holding the mask.
|
williamr@2
|
338 |
*
|
williamr@2
|
339 |
* @since 2.0
|
williamr@2
|
340 |
* @param aMask bitmap to set as a mask for the CGulIcon in the setting listbox's icon array
|
williamr@2
|
341 |
* @return TBool ETrue if the ownership of aMask has been passed
|
williamr@2
|
342 |
*/
|
williamr@2
|
343 |
IMPORT_C TBool SetIconMask( CFbsBitmap* aMask );
|
williamr@2
|
344 |
|
williamr@2
|
345 |
/**
|
williamr@2
|
346 |
* This sets the mask of this setting item's icon array, if it exists, using the mask from the
|
williamr@2
|
347 |
* passed icon.
|
williamr@2
|
348 |
* It returns the bitmap from the aIcon.
|
williamr@2
|
349 |
* The method also takes ownership of aIcon and may delete it (but not its bitmap).
|
williamr@2
|
350 |
*
|
williamr@2
|
351 |
* @since 2.0
|
williamr@2
|
352 |
* @param aIcon icon of which the mask is passed through to SetIconMask() and bitmap is returned
|
williamr@2
|
353 |
* @return CFbsBitmap* bitmap from aIcon. Ownership of the bitmap is transfered to the caller
|
williamr@2
|
354 |
*/
|
williamr@2
|
355 |
CFbsBitmap* SetIconMaskAndReturnBitmap( CGulIcon* aIcon );
|
williamr@2
|
356 |
private:
|
williamr@2
|
357 |
/**
|
williamr@2
|
358 |
* This routine causes any bitmaps that are extracted from setting pages to be updated
|
williamr@2
|
359 |
* according to the current (internal) setting value
|
williamr@2
|
360 |
*/
|
williamr@2
|
361 |
void UpdateBitmapL();
|
williamr@2
|
362 |
|
williamr@2
|
363 |
/**
|
williamr@2
|
364 |
* Set the index at which the item is to appear in the setting item list
|
williamr@2
|
365 |
* Only needed by CAknSettingItemArray
|
williamr@2
|
366 |
*/
|
williamr@2
|
367 |
void SetVisibleIndex( TInt aVisibleIndex );
|
williamr@2
|
368 |
|
williamr@2
|
369 |
/**
|
williamr@2
|
370 |
* Set the ordinal value. This is used for dynamic changing of the ordinal by
|
williamr@2
|
371 |
* CAknSettingItemArray
|
williamr@2
|
372 |
*
|
williamr@2
|
373 |
*/
|
williamr@2
|
374 |
void SetOrdinal( TInt aOrdinal );
|
williamr@2
|
375 |
|
williamr@2
|
376 |
/**
|
williamr@2
|
377 |
*
|
williamr@2
|
378 |
* Clean up a setting text for display by replacing all non printing characters
|
williamr@2
|
379 |
* by spaces
|
williamr@2
|
380 |
*
|
williamr@2
|
381 |
*/
|
williamr@2
|
382 |
TPtrC ReplaceNonPrintingCharacters( TDes& aTextToClean );
|
williamr@2
|
383 |
private:
|
williamr@2
|
384 |
IMPORT_C void CAknSettingItem_Reserved();
|
williamr@2
|
385 |
|
williamr@2
|
386 |
private:
|
williamr@2
|
387 |
TUint iFlags;
|
williamr@2
|
388 |
TInt iIdentifier;
|
williamr@2
|
389 |
TInt iOrdinal;
|
williamr@2
|
390 |
TInt iSettingIdentifier;
|
williamr@2
|
391 |
TInt iSettingPageResourceId;
|
williamr@2
|
392 |
TInt iEditorControlType;
|
williamr@2
|
393 |
TInt iSettingEditorResourceId;
|
williamr@2
|
394 |
TInt iAssociatedResourceId;
|
williamr@2
|
395 |
TInt iIconIndex; // Only valid if relevant bit is set in iFlags
|
williamr@2
|
396 |
HBufC* iEmptyItemText; // Owned
|
williamr@2
|
397 |
|
williamr@2
|
398 |
HBufC* iSettingName; // Owned
|
williamr@2
|
399 |
HBufC* iListBoxText; // Owned
|
williamr@2
|
400 |
HBufC* iCompulsoryText; // Owned
|
williamr@2
|
401 |
|
williamr@2
|
402 |
|
williamr@2
|
403 |
// Following are not owned
|
williamr@2
|
404 |
CAknSettingPage* iSettingPage; // This is a ref that is valid when non-0 - when the SP is "up"
|
williamr@2
|
405 |
CArrayPtr<CGulIcon>* iIconArray; // Reference to the array only !
|
williamr@2
|
406 |
|
williamr@2
|
407 |
TInt iVisibleIndex;
|
williamr@2
|
408 |
// Set flags that are in the Setting pages' constructors
|
williamr@2
|
409 |
TInt iSettingPageFlags;
|
williamr@2
|
410 |
|
williamr@2
|
411 |
// Pointer to the listbox that the setting item is providing data to
|
williamr@2
|
412 |
const CEikFormattedCellListBox* iParentListBox; // Not owned
|
williamr@2
|
413 |
|
williamr@2
|
414 |
CAknSettingItemExtension* iExtension;
|
williamr@2
|
415 |
};
|
williamr@2
|
416 |
|
williamr@2
|
417 |
/**
|
williamr@2
|
418 |
* Support for abstact text setting type. Corresponds to CAknTextSettingPage
|
williamr@2
|
419 |
*
|
williamr@2
|
420 |
*/
|
williamr@2
|
421 |
class CAknTextSettingItem : public CAknSettingItem
|
williamr@2
|
422 |
{
|
williamr@2
|
423 |
public:
|
williamr@2
|
424 |
/*
|
williamr@2
|
425 |
* Constructor
|
williamr@2
|
426 |
*
|
williamr@2
|
427 |
* @param resource identifier for this setting item
|
williamr@2
|
428 |
* @param Setting text
|
williamr@2
|
429 |
*
|
williamr@2
|
430 |
*/
|
williamr@2
|
431 |
IMPORT_C CAknTextSettingItem( TInt aIdentifier, TDes& aText );
|
williamr@2
|
432 |
|
williamr@2
|
433 |
/**
|
williamr@2
|
434 |
* Destructor
|
williamr@2
|
435 |
*/
|
williamr@2
|
436 |
IMPORT_C ~CAknTextSettingItem();
|
williamr@2
|
437 |
|
williamr@2
|
438 |
/**
|
williamr@2
|
439 |
* This command externalizes the current setting. The displayed (internal) copy
|
williamr@2
|
440 |
* is transferred to the external copy (the one referenced in the constructor).
|
williamr@2
|
441 |
*
|
williamr@2
|
442 |
* This must be called by the client if he wants this to happen. Note that StoreAllL()
|
williamr@2
|
443 |
* on the setting item list will call this for each setting item.
|
williamr@2
|
444 |
*/
|
williamr@2
|
445 |
IMPORT_C virtual void StoreL();
|
williamr@2
|
446 |
|
williamr@2
|
447 |
/*
|
williamr@2
|
448 |
* The external value is transferred to the internal value
|
williamr@2
|
449 |
* This occurs at construction, but may be called by client code when required.
|
williamr@2
|
450 |
*/
|
williamr@2
|
451 |
IMPORT_C virtual void LoadL(); // Called from 2nd stage constructors
|
williamr@2
|
452 |
|
williamr@2
|
453 |
/*
|
williamr@2
|
454 |
* This method obtains the current value's setting text.
|
williamr@2
|
455 |
*
|
williamr@2
|
456 |
* The reference is returned and is not a copy of the text, but refers to the current
|
williamr@2
|
457 |
* internal text value. This is the value that would be externalized if StoreL were called.
|
williamr@2
|
458 |
* An exception to this is if the current text is zero length. In that case a reference to the
|
williamr@2
|
459 |
* empty text is returned (which would not be externalized if StoreL is called).
|
williamr@2
|
460 |
*
|
williamr@2
|
461 |
* @return Reference to descriptor with the current internal text
|
williamr@2
|
462 |
*/
|
williamr@2
|
463 |
IMPORT_C virtual const TDesC& SettingTextL();
|
williamr@2
|
464 |
|
williamr@2
|
465 |
/**
|
williamr@2
|
466 |
*
|
williamr@2
|
467 |
* This launches the setting page for text editing
|
williamr@2
|
468 |
*
|
williamr@2
|
469 |
* @param aCalledFromMenu - ignored in this class
|
williamr@2
|
470 |
*
|
williamr@2
|
471 |
*/
|
williamr@2
|
472 |
IMPORT_C virtual void EditItemL( TBool aCalledFromMenu );
|
williamr@2
|
473 |
|
williamr@2
|
474 |
protected:
|
williamr@2
|
475 |
|
williamr@2
|
476 |
/**
|
williamr@2
|
477 |
* Access for re-implementors to the internal text
|
williamr@2
|
478 |
*
|
williamr@2
|
479 |
* @return reference to a TPtr holding the internal text
|
williamr@2
|
480 |
*/
|
williamr@2
|
481 |
IMPORT_C TPtr& InternalTextPtr();
|
williamr@2
|
482 |
|
williamr@2
|
483 |
/**
|
williamr@2
|
484 |
* Access for re-implementors to the external text
|
williamr@2
|
485 |
*
|
williamr@2
|
486 |
* @return TPtrC pointing to the external text
|
williamr@2
|
487 |
*/
|
williamr@2
|
488 |
IMPORT_C TPtrC ExternalText();
|
williamr@2
|
489 |
|
williamr@2
|
490 |
/**
|
williamr@2
|
491 |
* Allows re-implementors to set the external text
|
williamr@2
|
492 |
* No change of ownership is implied.
|
williamr@2
|
493 |
*
|
williamr@2
|
494 |
* @param a reference to the external text
|
williamr@2
|
495 |
*
|
williamr@2
|
496 |
*/
|
williamr@2
|
497 |
IMPORT_C void SetExternalText( TDesC& aNewExternalText );
|
williamr@2
|
498 |
private:
|
williamr@2
|
499 |
IMPORT_C void CAknSettingItem_Reserved();
|
williamr@2
|
500 |
|
williamr@2
|
501 |
private:
|
williamr@2
|
502 |
TDes& iExternalText;
|
williamr@2
|
503 |
HBufC* iInternalText; // Owned
|
williamr@2
|
504 |
TPtr iInternalTextPtr;
|
williamr@2
|
505 |
TInt iSpare_Text_1;
|
williamr@2
|
506 |
};
|
williamr@2
|
507 |
|
williamr@2
|
508 |
|
williamr@2
|
509 |
/**
|
williamr@2
|
510 |
*
|
williamr@2
|
511 |
* Abstract setting item for integer editing.
|
williamr@2
|
512 |
*
|
williamr@2
|
513 |
* This class is not disposed toward any particular type of setting page
|
williamr@2
|
514 |
*
|
williamr@2
|
515 |
*/
|
williamr@2
|
516 |
class CAknIntegerSettingItem : public CAknSettingItem
|
williamr@2
|
517 |
{
|
williamr@2
|
518 |
public:
|
williamr@2
|
519 |
/*
|
williamr@2
|
520 |
* Constructor
|
williamr@2
|
521 |
*
|
williamr@2
|
522 |
* @param resource identifier for this setting item
|
williamr@2
|
523 |
* @param integer value to edit.
|
williamr@2
|
524 |
*
|
williamr@2
|
525 |
*/
|
williamr@2
|
526 |
IMPORT_C CAknIntegerSettingItem( TInt aIdentifier, TInt& aValue );
|
williamr@2
|
527 |
IMPORT_C ~CAknIntegerSettingItem();
|
williamr@2
|
528 |
|
williamr@2
|
529 |
/**
|
williamr@2
|
530 |
* This command externalizes the current setting. The displayed (internal) copy
|
williamr@2
|
531 |
* is transferred to the external copy (the one referenced in the constructor).
|
williamr@2
|
532 |
*
|
williamr@2
|
533 |
* This must be called by the client if he wants this to happen. Note that StoreAllL()
|
williamr@2
|
534 |
* on the setting item list will call this for each setting item.
|
williamr@2
|
535 |
*/
|
williamr@2
|
536 |
IMPORT_C virtual void StoreL();
|
williamr@2
|
537 |
/*
|
williamr@2
|
538 |
* The external value is transferred to the internal value
|
williamr@2
|
539 |
* This occurs at construction, but may be called by client code when required.
|
williamr@2
|
540 |
*/
|
williamr@2
|
541 |
IMPORT_C virtual void LoadL();
|
williamr@2
|
542 |
|
williamr@2
|
543 |
/*
|
williamr@2
|
544 |
* This method obtains the current value's setting text
|
williamr@2
|
545 |
*
|
williamr@2
|
546 |
* @return Reference to descriptor with the text
|
williamr@2
|
547 |
*/
|
williamr@2
|
548 |
IMPORT_C virtual const TDesC& SettingTextL();
|
williamr@2
|
549 |
|
williamr@2
|
550 |
/**
|
williamr@2
|
551 |
*
|
williamr@2
|
552 |
* Pure virtual editItemL
|
williamr@2
|
553 |
*
|
williamr@2
|
554 |
* @param aCalledFromMenu - ignored in this class
|
williamr@2
|
555 |
*
|
williamr@2
|
556 |
*/
|
williamr@2
|
557 |
virtual void EditItemL( TBool aCalledFromMenu ) = 0;
|
williamr@2
|
558 |
|
williamr@2
|
559 |
protected:
|
williamr@2
|
560 |
/**
|
williamr@2
|
561 |
* Method called by framework to complete the construction. Extra allocations of
|
williamr@2
|
562 |
* memory or extra resource reading can happen here.
|
williamr@2
|
563 |
*
|
williamr@2
|
564 |
*/
|
williamr@2
|
565 |
IMPORT_C virtual void CompleteConstructionL();
|
williamr@2
|
566 |
|
williamr@2
|
567 |
/**
|
williamr@2
|
568 |
* Method to access the internal value.
|
williamr@2
|
569 |
*
|
williamr@2
|
570 |
* @return a reference to the internal integer value
|
williamr@2
|
571 |
*/
|
williamr@2
|
572 |
IMPORT_C TInt& InternalValueRef();
|
williamr@2
|
573 |
|
williamr@2
|
574 |
/**
|
williamr@2
|
575 |
* Method to access the external reference to the external value. Note that this class
|
williamr@2
|
576 |
* only accesses the external integer via a copy of a reference to it.
|
williamr@2
|
577 |
*
|
williamr@2
|
578 |
* @return a reference to the external integer value
|
williamr@2
|
579 |
*/
|
williamr@2
|
580 |
IMPORT_C TInt& ExternalValueRef();
|
williamr@2
|
581 |
|
williamr@2
|
582 |
/**
|
williamr@2
|
583 |
* Sets the external value's reference. The external vlue is externally owned, so
|
williamr@2
|
584 |
* this does not make a copy.
|
williamr@2
|
585 |
* @param TInt& aValue a reference to the external value
|
williamr@2
|
586 |
*/
|
williamr@2
|
587 |
IMPORT_C void SetExternalValue( TInt& aValue );
|
williamr@2
|
588 |
private:
|
williamr@2
|
589 |
IMPORT_C void CAknSettingItem_Reserved();
|
williamr@2
|
590 |
|
williamr@2
|
591 |
private:
|
williamr@2
|
592 |
TInt iInternalValue;
|
williamr@2
|
593 |
TInt& iExternalValue;
|
williamr@2
|
594 |
HBufC* iInternalText; // Owned
|
williamr@2
|
595 |
TPtr iInternalTextPtr;
|
williamr@2
|
596 |
};
|
williamr@2
|
597 |
|
williamr@2
|
598 |
|
williamr@2
|
599 |
class CAknIntegerEdwinSettingItem : public CAknIntegerSettingItem
|
williamr@2
|
600 |
{
|
williamr@2
|
601 |
public:
|
williamr@2
|
602 |
IMPORT_C CAknIntegerEdwinSettingItem( TInt aIdentifier, TInt& aValue );
|
williamr@2
|
603 |
/**
|
williamr@2
|
604 |
*
|
williamr@2
|
605 |
* This launches the setting page for editing using the integer edwin class
|
williamr@2
|
606 |
*
|
williamr@2
|
607 |
* @param aCalledFromMenu - ignored in this class
|
williamr@2
|
608 |
*
|
williamr@2
|
609 |
*/
|
williamr@2
|
610 |
IMPORT_C virtual void EditItemL( TBool aCalledFromMenu );
|
williamr@2
|
611 |
private:
|
williamr@2
|
612 |
IMPORT_C void CAknSettingItem_Reserved();
|
williamr@2
|
613 |
};
|
williamr@2
|
614 |
|
williamr@2
|
615 |
/**
|
williamr@2
|
616 |
*
|
williamr@2
|
617 |
* Class for holding a password setting item
|
williamr@2
|
618 |
*
|
williamr@2
|
619 |
*/
|
williamr@2
|
620 |
class CAknPasswordSettingItem : public CAknTextSettingItem
|
williamr@2
|
621 |
{
|
williamr@2
|
622 |
public:
|
williamr@2
|
623 |
enum TAknPasswordSettingItemMode
|
williamr@2
|
624 |
{
|
williamr@2
|
625 |
EAlpha, // password held is alphanumeric
|
williamr@2
|
626 |
ENumeric // password is numeric ( digits 0 - 9 only used )
|
williamr@2
|
627 |
};
|
williamr@2
|
628 |
|
williamr@2
|
629 |
/*
|
williamr@2
|
630 |
* Constructor
|
williamr@2
|
631 |
*
|
williamr@2
|
632 |
* @param resource identifier for this setting item
|
williamr@2
|
633 |
* @param password mode; text or numeric
|
williamr@2
|
634 |
* @param password to change
|
williamr@2
|
635 |
*/
|
williamr@2
|
636 |
IMPORT_C CAknPasswordSettingItem( TInt aIdentifier, enum TAknPasswordSettingItemMode aMode, TDes& aPassword );
|
williamr@2
|
637 |
|
williamr@2
|
638 |
/*
|
williamr@2
|
639 |
* This method obtains the current value's setting text
|
williamr@2
|
640 |
*
|
williamr@2
|
641 |
* @return Reference to descriptor with the text
|
williamr@2
|
642 |
*/
|
williamr@2
|
643 |
IMPORT_C virtual const TDesC& SettingTextL();
|
williamr@2
|
644 |
/**
|
williamr@2
|
645 |
*
|
williamr@2
|
646 |
* This launches the setting page for password editing
|
williamr@2
|
647 |
*
|
williamr@2
|
648 |
* @param aCalledFromMenu - ignored in this class
|
williamr@2
|
649 |
*
|
williamr@2
|
650 |
*/
|
williamr@2
|
651 |
IMPORT_C virtual void EditItemL( TBool aCalledFromMenu );
|
williamr@2
|
652 |
|
williamr@2
|
653 |
protected:
|
williamr@2
|
654 |
|
williamr@2
|
655 |
/**
|
williamr@2
|
656 |
* Method called by framework to complete the construction. Extra allocations of
|
williamr@2
|
657 |
* memory or extra resource reading can happen here.
|
williamr@2
|
658 |
*
|
williamr@2
|
659 |
*/
|
williamr@2
|
660 |
IMPORT_C virtual void CompleteConstructionL();
|
williamr@2
|
661 |
private:
|
williamr@2
|
662 |
IMPORT_C void CAknSettingItem_Reserved();
|
williamr@2
|
663 |
|
williamr@2
|
664 |
private:
|
williamr@2
|
665 |
TAknPasswordSettingItemMode iPasswordMode;
|
williamr@2
|
666 |
// For holding the text to blank the setting item text
|
williamr@2
|
667 |
TBuf<KMaxPasswordBlankingTextLength> iBlankingText;
|
williamr@2
|
668 |
// For holding the resouce for a password query
|
williamr@2
|
669 |
TInt iOldPasswordQueryResourceId;
|
williamr@2
|
670 |
};
|
williamr@2
|
671 |
|
williamr@2
|
672 |
|
williamr@2
|
673 |
/**
|
williamr@2
|
674 |
* An abstract integer setting that uses the volume control as its editor
|
williamr@2
|
675 |
*
|
williamr@2
|
676 |
*/
|
williamr@2
|
677 |
class CAknVolumeSettingItem : public CAknSettingItem
|
williamr@2
|
678 |
{
|
williamr@2
|
679 |
public:
|
williamr@2
|
680 |
/*
|
williamr@2
|
681 |
* Constructor
|
williamr@2
|
682 |
*
|
williamr@2
|
683 |
* @param resource identifier for this setting item
|
williamr@2
|
684 |
* @param volume value. Must be in range 0 to 10, inclusive
|
williamr@2
|
685 |
*
|
williamr@2
|
686 |
*/
|
williamr@2
|
687 |
IMPORT_C CAknVolumeSettingItem( TInt aIdentifier, TInt& aExternalVolume );
|
williamr@2
|
688 |
|
williamr@2
|
689 |
/**
|
williamr@2
|
690 |
* This command externalizes the current setting. The displayed (internal) copy
|
williamr@2
|
691 |
* is transferred to the external copy (the one referenced in the constructor).
|
williamr@2
|
692 |
*
|
williamr@2
|
693 |
* This must be called by the client if he wants this to happen. Note that StoreAllL()
|
williamr@2
|
694 |
* on the setting item list will call this for each setting item.
|
williamr@2
|
695 |
*/
|
williamr@2
|
696 |
IMPORT_C virtual void StoreL();
|
williamr@2
|
697 |
/*
|
williamr@2
|
698 |
* The external value is transferred to the internal value
|
williamr@2
|
699 |
* This occurs at construction, but may be called by client code when required.
|
williamr@2
|
700 |
*/
|
williamr@2
|
701 |
IMPORT_C virtual void LoadL();
|
williamr@2
|
702 |
/*
|
williamr@2
|
703 |
* This method obtains the current value's setting text
|
williamr@2
|
704 |
*
|
williamr@2
|
705 |
* @return Reference to descriptor with the text
|
williamr@2
|
706 |
*/
|
williamr@2
|
707 |
IMPORT_C virtual const TDesC& SettingTextL();
|
williamr@2
|
708 |
/**
|
williamr@2
|
709 |
*
|
williamr@2
|
710 |
* This launches the setting page for volume editing
|
williamr@2
|
711 |
*
|
williamr@2
|
712 |
* @param aCalledFromMenu - ignored in this class
|
williamr@2
|
713 |
*
|
williamr@2
|
714 |
*/
|
williamr@2
|
715 |
IMPORT_C virtual void EditItemL( TBool aCalledFromMenu );
|
williamr@2
|
716 |
|
williamr@2
|
717 |
protected:
|
williamr@2
|
718 |
/**
|
williamr@2
|
719 |
* Protected access to the volume value
|
williamr@2
|
720 |
*
|
williamr@2
|
721 |
* @return Reference to the internal volume value
|
williamr@2
|
722 |
*/
|
williamr@2
|
723 |
IMPORT_C TInt& InternalVolumeValue(); // For access to internal value for derived classes
|
williamr@2
|
724 |
|
williamr@2
|
725 |
//From CAknSettingItem
|
williamr@2
|
726 |
/**
|
williamr@2
|
727 |
*
|
williamr@2
|
728 |
* Obtain a bitmap from the CAknVolume
|
williamr@2
|
729 |
*
|
williamr@2
|
730 |
*/
|
williamr@2
|
731 |
IMPORT_C virtual CFbsBitmap* CreateBitmapL();
|
williamr@2
|
732 |
private:
|
williamr@2
|
733 |
IMPORT_C void CAknSettingItem_Reserved();
|
williamr@2
|
734 |
|
williamr@2
|
735 |
private:
|
williamr@2
|
736 |
TInt& iExternalVolume;
|
williamr@2
|
737 |
TInt iInternalVolume;
|
williamr@2
|
738 |
|
williamr@2
|
739 |
};
|
williamr@2
|
740 |
|
williamr@2
|
741 |
/**
|
williamr@2
|
742 |
* Slider control setting item
|
williamr@2
|
743 |
*
|
williamr@2
|
744 |
*
|
williamr@2
|
745 |
*/
|
williamr@2
|
746 |
|
williamr@2
|
747 |
class CAknSliderSettingItem : public CAknSettingItem
|
williamr@2
|
748 |
{
|
williamr@2
|
749 |
public:
|
williamr@2
|
750 |
/*
|
williamr@2
|
751 |
* Constructor
|
williamr@2
|
752 |
*
|
williamr@2
|
753 |
* @param resource identifier for this setting item
|
williamr@2
|
754 |
* @param Slider value; must be within the minimum and maximum values in resource
|
williamr@2
|
755 |
*
|
williamr@2
|
756 |
*/
|
williamr@2
|
757 |
IMPORT_C CAknSliderSettingItem( TInt aIdentifier, TInt& aExternalSliderValue );
|
williamr@2
|
758 |
|
williamr@2
|
759 |
/**
|
williamr@2
|
760 |
* This command externalizes the current setting. The displayed (internal) copy
|
williamr@2
|
761 |
* is transferred to the external copy (the one referenced in the constructor).
|
williamr@2
|
762 |
*
|
williamr@2
|
763 |
* This must be called by the client if he wants this to happen. Note that StoreAllL()
|
williamr@2
|
764 |
* on the setting item list will call this for each setting item.
|
williamr@2
|
765 |
*/
|
williamr@2
|
766 |
IMPORT_C virtual void StoreL();
|
williamr@2
|
767 |
/*
|
williamr@2
|
768 |
* The external value is transferred to the internal value
|
williamr@2
|
769 |
* This occurs at construction, but may be called by client code when required.
|
williamr@2
|
770 |
*/
|
williamr@2
|
771 |
IMPORT_C virtual void LoadL();
|
williamr@2
|
772 |
/*
|
williamr@2
|
773 |
* This method obtains the current value's setting text
|
williamr@2
|
774 |
*
|
williamr@2
|
775 |
* @return Reference to descriptor with the text
|
williamr@2
|
776 |
*/
|
williamr@2
|
777 |
IMPORT_C virtual const TDesC& SettingTextL();
|
williamr@2
|
778 |
/**
|
williamr@2
|
779 |
*
|
williamr@2
|
780 |
* This launches the setting page for slider editing
|
williamr@2
|
781 |
*
|
williamr@2
|
782 |
* @param aCalledFromMenu - ignored in this class
|
williamr@2
|
783 |
*
|
williamr@2
|
784 |
*/
|
williamr@2
|
785 |
IMPORT_C virtual void EditItemL( TBool aCalledFromMenu );
|
williamr@2
|
786 |
|
williamr@2
|
787 |
protected:
|
williamr@2
|
788 |
/**
|
williamr@2
|
789 |
* Method to create a setting page
|
williamr@2
|
790 |
*/
|
williamr@2
|
791 |
IMPORT_C virtual CAknSettingPage* CreateSettingPageL();
|
williamr@2
|
792 |
|
williamr@2
|
793 |
/**
|
williamr@2
|
794 |
* Method to contruct the setting page (via CreateSettingPageL), and execute it
|
williamr@2
|
795 |
*/
|
williamr@2
|
796 |
IMPORT_C virtual void CreateAndExecuteSettingPageL();
|
williamr@2
|
797 |
|
williamr@2
|
798 |
/**
|
williamr@2
|
799 |
* For access to internal value for derived classes
|
williamr@2
|
800 |
*
|
williamr@2
|
801 |
* @return A ref to the internal value
|
williamr@2
|
802 |
*/
|
williamr@2
|
803 |
IMPORT_C TInt& InternalSliderValue();
|
williamr@2
|
804 |
|
williamr@2
|
805 |
// From CAknSettingItem
|
williamr@2
|
806 |
/**
|
williamr@2
|
807 |
*
|
williamr@2
|
808 |
* Obtain a bitmap from the CAknSlider
|
williamr@2
|
809 |
*
|
williamr@2
|
810 |
*/
|
williamr@2
|
811 |
IMPORT_C virtual CFbsBitmap* CreateBitmapL();
|
williamr@2
|
812 |
private:
|
williamr@2
|
813 |
IMPORT_C void CAknSettingItem_Reserved();
|
williamr@2
|
814 |
|
williamr@2
|
815 |
private:
|
williamr@2
|
816 |
TInt& iExternalSliderValue;
|
williamr@2
|
817 |
TInt iInternalSliderValue; // required for use in derived classes
|
williamr@2
|
818 |
|
williamr@2
|
819 |
};
|
williamr@2
|
820 |
|
williamr@2
|
821 |
|
williamr@2
|
822 |
/**
|
williamr@2
|
823 |
*
|
williamr@2
|
824 |
* Time or Date Setting Item
|
williamr@2
|
825 |
*
|
williamr@2
|
826 |
* This class combines the time and the date functionality, as determined by a mode
|
williamr@2
|
827 |
* passed to the constructor.
|
williamr@2
|
828 |
*
|
williamr@2
|
829 |
* Time or Date setting pages are launched from here, which use Time or date editor
|
williamr@2
|
830 |
* MFNEs to do the editing.
|
williamr@2
|
831 |
*
|
williamr@2
|
832 |
*/
|
williamr@2
|
833 |
class CAknTimeOrDateSettingItem : public CAknSettingItem
|
williamr@2
|
834 |
{
|
williamr@2
|
835 |
public:
|
williamr@2
|
836 |
enum TAknTimeOrDateSettingItemMode
|
williamr@2
|
837 |
{
|
williamr@2
|
838 |
ETime,
|
williamr@2
|
839 |
EDate
|
williamr@2
|
840 |
};
|
williamr@2
|
841 |
/*
|
williamr@2
|
842 |
* Constructor
|
williamr@2
|
843 |
*
|
williamr@2
|
844 |
* @param resource identifier for this setting item
|
williamr@2
|
845 |
* @param construct a Time or a Date setting item
|
williamr@2
|
846 |
* @param IP address to be controlled by the setting editing
|
williamr@2
|
847 |
*
|
williamr@2
|
848 |
*/
|
williamr@2
|
849 |
IMPORT_C CAknTimeOrDateSettingItem( TInt aIdentifier, enum TAknTimeOrDateSettingItemMode aMode, TTime& aTime );
|
williamr@2
|
850 |
/**
|
williamr@2
|
851 |
* Destructor
|
williamr@2
|
852 |
*/
|
williamr@2
|
853 |
IMPORT_C ~CAknTimeOrDateSettingItem();
|
williamr@2
|
854 |
/**
|
williamr@2
|
855 |
* Method called by framework to complete the construction. Extra allocations of
|
williamr@2
|
856 |
* memory or extra resource reading can happen here.
|
williamr@2
|
857 |
*
|
williamr@2
|
858 |
*/
|
williamr@2
|
859 |
IMPORT_C void CompleteConstructionL( );
|
williamr@2
|
860 |
|
williamr@2
|
861 |
/**
|
williamr@2
|
862 |
* This command externalizes the current setting. The displayed (internal) copy
|
williamr@2
|
863 |
* is transferred to the external copy (the one referenced in the constructor).
|
williamr@2
|
864 |
*
|
williamr@2
|
865 |
* This must be called by the client if he wants this to happen. Note that StoreAllL()
|
williamr@2
|
866 |
* on the setting item list will call this for each setting item.
|
williamr@2
|
867 |
*/
|
williamr@2
|
868 |
IMPORT_C virtual void StoreL();
|
williamr@2
|
869 |
/*
|
williamr@2
|
870 |
* The external value is transferred to the internal value
|
williamr@2
|
871 |
* This occurs at construction, but may be called by client code when required.
|
williamr@2
|
872 |
*/
|
williamr@2
|
873 |
IMPORT_C virtual void LoadL();
|
williamr@2
|
874 |
/*
|
williamr@2
|
875 |
* This method obtains the current value's setting text
|
williamr@2
|
876 |
*
|
williamr@2
|
877 |
* @return Reference to descriptor with the text
|
williamr@2
|
878 |
*/
|
williamr@2
|
879 |
IMPORT_C virtual const TDesC& SettingTextL();
|
williamr@2
|
880 |
/**
|
williamr@2
|
881 |
*
|
williamr@2
|
882 |
* This launches the setting page for Time or Date editing
|
williamr@2
|
883 |
*
|
williamr@2
|
884 |
* @param aCalledFromMenu - ignored in this class
|
williamr@2
|
885 |
*
|
williamr@2
|
886 |
*/
|
williamr@2
|
887 |
IMPORT_C virtual void EditItemL( TBool aCalledFromMenu );
|
williamr@2
|
888 |
/**
|
williamr@2
|
889 |
*
|
williamr@2
|
890 |
* Set the time or date format string. If this is not called, then a
|
williamr@2
|
891 |
* localized, default string is used
|
williamr@2
|
892 |
*
|
williamr@2
|
893 |
*/
|
williamr@2
|
894 |
IMPORT_C void SetTimeFormatStringL( const TDesC& aTimeFormat );
|
williamr@2
|
895 |
/**
|
williamr@2
|
896 |
*
|
williamr@2
|
897 |
* Obtain the time format string
|
williamr@2
|
898 |
*
|
williamr@2
|
899 |
* @return A pointer descriptor to the date/time format string
|
williamr@2
|
900 |
*/
|
williamr@2
|
901 |
IMPORT_C const TPtrC TimeFormatString();
|
williamr@2
|
902 |
private:
|
williamr@2
|
903 |
IMPORT_C void CAknSettingItem_Reserved();
|
williamr@2
|
904 |
private:
|
williamr@2
|
905 |
TTime& iExternalTime;
|
williamr@2
|
906 |
TTime iInternalTime;
|
williamr@2
|
907 |
HBufC* iInternalText; // Owned
|
williamr@2
|
908 |
TPtr iInternalTextPtr;
|
williamr@2
|
909 |
HBufC* iTimeFormat;
|
williamr@2
|
910 |
TPtr iTimeFormatPtr;
|
williamr@2
|
911 |
TAknTimeOrDateSettingItemMode iTimeOrDateMode;
|
williamr@2
|
912 |
};
|
williamr@2
|
913 |
|
williamr@2
|
914 |
|
williamr@2
|
915 |
|
williamr@2
|
916 |
/**
|
williamr@2
|
917 |
*
|
williamr@2
|
918 |
* Time Offset Setting Item
|
williamr@2
|
919 |
*
|
williamr@2
|
920 |
* Time Offset page as launched from here, which use Offset editor
|
williamr@2
|
921 |
* MFNEs to do the editing.
|
williamr@2
|
922 |
*
|
williamr@2
|
923 |
* @lib avkon
|
williamr@2
|
924 |
* @since 2.0
|
williamr@2
|
925 |
|
williamr@2
|
926 |
*/
|
williamr@2
|
927 |
class CAknTimeOffsetSettingItem : public CAknSettingItem
|
williamr@2
|
928 |
{
|
williamr@2
|
929 |
public:
|
williamr@2
|
930 |
/*
|
williamr@2
|
931 |
* Constructor
|
williamr@2
|
932 |
*
|
williamr@2
|
933 |
* @param resource identifier for this setting item
|
williamr@2
|
934 |
* @param construct a Time offset setting item
|
williamr@2
|
935 |
*
|
williamr@2
|
936 |
*/
|
williamr@2
|
937 |
IMPORT_C CAknTimeOffsetSettingItem( TInt aIdentifier, TTimeIntervalSeconds& aTime );
|
williamr@2
|
938 |
/**
|
williamr@2
|
939 |
* Destructor
|
williamr@2
|
940 |
*/
|
williamr@2
|
941 |
IMPORT_C ~CAknTimeOffsetSettingItem();
|
williamr@2
|
942 |
/**
|
williamr@2
|
943 |
* Method called by framework to complete the construction. Extra allocations of
|
williamr@2
|
944 |
* memory or extra resource reading can happen here.
|
williamr@2
|
945 |
*
|
williamr@2
|
946 |
* @since 2.0
|
williamr@2
|
947 |
*/
|
williamr@2
|
948 |
IMPORT_C void CompleteConstructionL( );
|
williamr@2
|
949 |
|
williamr@2
|
950 |
/**
|
williamr@2
|
951 |
* This command externalizes the current setting. The displayed (internal) copy
|
williamr@2
|
952 |
* is transferred to the external copy (the one referenced in the constructor).
|
williamr@2
|
953 |
*
|
williamr@2
|
954 |
* This must be called by the client if he wants this to happen. Note that StoreAllL()
|
williamr@2
|
955 |
* on the setting item list will call this for each setting item.
|
williamr@2
|
956 |
*
|
williamr@2
|
957 |
* @since 2.0
|
williamr@2
|
958 |
*/
|
williamr@2
|
959 |
IMPORT_C virtual void StoreL();
|
williamr@2
|
960 |
/*
|
williamr@2
|
961 |
* The external value is transferred to the internal value
|
williamr@2
|
962 |
* This occurs at construction, but may be called by client code when required.
|
williamr@2
|
963 |
*
|
williamr@2
|
964 |
* @since 2.0
|
williamr@2
|
965 |
*/
|
williamr@2
|
966 |
IMPORT_C virtual void LoadL();
|
williamr@2
|
967 |
/*
|
williamr@2
|
968 |
* This method obtains the current value's setting text
|
williamr@2
|
969 |
*
|
williamr@2
|
970 |
* @since 2.0
|
williamr@2
|
971 |
* @return Reference to descriptor with the text
|
williamr@2
|
972 |
*/
|
williamr@2
|
973 |
IMPORT_C virtual const TDesC& SettingTextL();
|
williamr@2
|
974 |
/**
|
williamr@2
|
975 |
*
|
williamr@2
|
976 |
* This launches the setting page for Time or Date editing
|
williamr@2
|
977 |
*
|
williamr@2
|
978 |
* @since 2.0
|
williamr@2
|
979 |
* @param aCalledFromMenu - ignored in this class
|
williamr@2
|
980 |
*
|
williamr@2
|
981 |
*/
|
williamr@2
|
982 |
IMPORT_C virtual void EditItemL( TBool aCalledFromMenu );
|
williamr@2
|
983 |
/**
|
williamr@2
|
984 |
*
|
williamr@2
|
985 |
* Set the time or date format string. If this is not called, then a
|
williamr@2
|
986 |
* localized, default string is used
|
williamr@2
|
987 |
*
|
williamr@2
|
988 |
* @since 2.0
|
williamr@2
|
989 |
*/
|
williamr@2
|
990 |
IMPORT_C void SetTimeFormatStringL( const TDesC& aTimeFormat );
|
williamr@2
|
991 |
/**
|
williamr@2
|
992 |
*
|
williamr@2
|
993 |
* Obtain the time format string
|
williamr@2
|
994 |
*
|
williamr@2
|
995 |
* @since 2.0
|
williamr@2
|
996 |
* @return A pointer descriptor to the date/time format string
|
williamr@2
|
997 |
*/
|
williamr@2
|
998 |
IMPORT_C const TPtrC TimeFormatString();
|
williamr@2
|
999 |
private:
|
williamr@2
|
1000 |
IMPORT_C void CAknSettingItem_Reserved();
|
williamr@2
|
1001 |
private:
|
williamr@2
|
1002 |
TTimeIntervalSeconds iExternalTime;
|
williamr@2
|
1003 |
TTimeIntervalSeconds iInternalTime;
|
williamr@2
|
1004 |
HBufC* iInternalText; // Owned
|
williamr@2
|
1005 |
TPtr iInternalTextPtr;
|
williamr@2
|
1006 |
HBufC* iTimeFormat;
|
williamr@2
|
1007 |
TPtr iTimeFormatPtr;
|
williamr@2
|
1008 |
|
williamr@2
|
1009 |
TInt iSpare;
|
williamr@2
|
1010 |
};
|
williamr@2
|
1011 |
|
williamr@2
|
1012 |
|
williamr@2
|
1013 |
/**
|
williamr@2
|
1014 |
*
|
williamr@2
|
1015 |
* IP Address setting item
|
williamr@2
|
1016 |
*
|
williamr@2
|
1017 |
* Abstract data type for IP address setting. Launches a CAknIpFieldSettingPage
|
williamr@2
|
1018 |
* that in turn uses the CAknIpFieldEditor
|
williamr@2
|
1019 |
*
|
williamr@2
|
1020 |
*/
|
williamr@2
|
1021 |
class CAknIpFieldSettingItem : public CAknSettingItem
|
williamr@2
|
1022 |
{
|
williamr@2
|
1023 |
public:
|
williamr@2
|
1024 |
/*
|
williamr@2
|
1025 |
* Constructor
|
williamr@2
|
1026 |
*
|
williamr@2
|
1027 |
* @param resource identifier for this setting item
|
williamr@2
|
1028 |
* @param IP address to be controlled by the setting editing
|
williamr@2
|
1029 |
*
|
williamr@2
|
1030 |
*/
|
williamr@2
|
1031 |
IMPORT_C CAknIpFieldSettingItem( TInt aIdentifier, TInetAddr& aIpAddress );
|
williamr@2
|
1032 |
/**
|
williamr@2
|
1033 |
*
|
williamr@2
|
1034 |
* Destructor
|
williamr@2
|
1035 |
*
|
williamr@2
|
1036 |
*/
|
williamr@2
|
1037 |
IMPORT_C ~CAknIpFieldSettingItem();
|
williamr@2
|
1038 |
|
williamr@2
|
1039 |
/**
|
williamr@2
|
1040 |
* Method called by framework to complete the construction. Extra allocations of
|
williamr@2
|
1041 |
* memory or extra resource reading can happen here.
|
williamr@2
|
1042 |
*
|
williamr@2
|
1043 |
*/
|
williamr@2
|
1044 |
IMPORT_C void CompleteConstructionL( );
|
williamr@2
|
1045 |
|
williamr@2
|
1046 |
/**
|
williamr@2
|
1047 |
* This command externalizes the current setting. The displayed (internal) copy
|
williamr@2
|
1048 |
* is transferred to the external copy (the one referenced in the constructor).
|
williamr@2
|
1049 |
*
|
williamr@2
|
1050 |
* This must be called by the client if he wants this to happen. Note that StoreAllL()
|
williamr@2
|
1051 |
* on the setting item list will call this for each setting item.
|
williamr@2
|
1052 |
*/
|
williamr@2
|
1053 |
IMPORT_C virtual void StoreL();
|
williamr@2
|
1054 |
/*
|
williamr@2
|
1055 |
* The external value is transferred to the internal value
|
williamr@2
|
1056 |
* This occurs at construction, but may be called by client code when required.
|
williamr@2
|
1057 |
*
|
williamr@2
|
1058 |
*/
|
williamr@2
|
1059 |
IMPORT_C virtual void LoadL(); // Called from 2nd stage constructors
|
williamr@2
|
1060 |
/*
|
williamr@2
|
1061 |
* This method obtains the current value's setting text
|
williamr@2
|
1062 |
*
|
williamr@2
|
1063 |
* @return Reference to descriptor with the text
|
williamr@2
|
1064 |
*/
|
williamr@2
|
1065 |
IMPORT_C virtual const TDesC& SettingTextL();
|
williamr@2
|
1066 |
/**
|
williamr@2
|
1067 |
*
|
williamr@2
|
1068 |
* This launches the setting page for IP address editing
|
williamr@2
|
1069 |
*
|
williamr@2
|
1070 |
* @param aCalledFromMenu - ignored in this class
|
williamr@2
|
1071 |
*
|
williamr@2
|
1072 |
*/
|
williamr@2
|
1073 |
IMPORT_C virtual void EditItemL( TBool aCalledFromMenu );
|
williamr@2
|
1074 |
private:
|
williamr@2
|
1075 |
IMPORT_C void CAknSettingItem_Reserved();
|
williamr@2
|
1076 |
|
williamr@2
|
1077 |
private:
|
williamr@2
|
1078 |
TInetAddr& iExternalIpAddress;
|
williamr@2
|
1079 |
TInetAddr iInternalIpAddress;
|
williamr@2
|
1080 |
HBufC* iInternalText; // Owned
|
williamr@2
|
1081 |
TPtr iInternalTextPtr;
|
williamr@2
|
1082 |
};
|
williamr@2
|
1083 |
|
williamr@2
|
1084 |
/**
|
williamr@2
|
1085 |
* Base class for a data object to hold a pointer and a corresponding integer value.
|
williamr@2
|
1086 |
* This is used to make a template class by CAknEnumeratedItem
|
williamr@2
|
1087 |
*
|
williamr@2
|
1088 |
*/
|
williamr@2
|
1089 |
class CAknEnumeratedItemBase : public CBase
|
williamr@2
|
1090 |
{
|
williamr@2
|
1091 |
public:
|
williamr@2
|
1092 |
/**
|
williamr@2
|
1093 |
* Construct an item consisting of an integer value and its co-ordinate pointer
|
williamr@2
|
1094 |
*/
|
williamr@2
|
1095 |
IMPORT_C CAknEnumeratedItemBase( TInt aEnumeratedValue, TAny* aValue );
|
williamr@2
|
1096 |
/**
|
williamr@2
|
1097 |
* Destructor
|
williamr@2
|
1098 |
*/
|
williamr@2
|
1099 |
IMPORT_C ~CAknEnumeratedItemBase();
|
williamr@2
|
1100 |
/**
|
williamr@2
|
1101 |
* Access the integer value
|
williamr@2
|
1102 |
*
|
williamr@2
|
1103 |
* @return the integer value of this item
|
williamr@2
|
1104 |
*/
|
williamr@2
|
1105 |
IMPORT_C TInt EnumerationValue() const;
|
williamr@2
|
1106 |
/**
|
williamr@2
|
1107 |
* Set the integer part of the object
|
williamr@2
|
1108 |
*
|
williamr@2
|
1109 |
* @param aNewValue Value to set
|
williamr@2
|
1110 |
*/
|
williamr@2
|
1111 |
IMPORT_C void SetEnumerationValue( TInt aNewValue );
|
williamr@2
|
1112 |
/**
|
williamr@2
|
1113 |
* Access the pointer part of the object
|
williamr@2
|
1114 |
*
|
williamr@2
|
1115 |
* @return TAny* pointer to any type
|
williamr@2
|
1116 |
*/
|
williamr@2
|
1117 |
IMPORT_C TAny* Value() const;
|
williamr@2
|
1118 |
/**
|
williamr@2
|
1119 |
* Set the pointer part of the object
|
williamr@2
|
1120 |
*
|
williamr@2
|
1121 |
* @param pointer to store in the object; no copy model, no ownership transfer
|
williamr@2
|
1122 |
*/
|
williamr@2
|
1123 |
IMPORT_C void SetValue( TAny* aPtr );
|
williamr@2
|
1124 |
private:
|
williamr@2
|
1125 |
TInt iEnumerationValue;
|
williamr@2
|
1126 |
TAny* iValue;
|
williamr@2
|
1127 |
};
|
williamr@2
|
1128 |
|
williamr@2
|
1129 |
|
williamr@2
|
1130 |
/**
|
williamr@2
|
1131 |
* Makes a template class from CAknEnumeratedItemBase
|
williamr@2
|
1132 |
*
|
williamr@2
|
1133 |
*/
|
williamr@2
|
1134 |
template <class T>
|
williamr@2
|
1135 |
class CAknEnumeratedItem : public CAknEnumeratedItemBase
|
williamr@2
|
1136 |
{
|
williamr@2
|
1137 |
public:
|
williamr@2
|
1138 |
inline CAknEnumeratedItem( TInt aEnumeratedValue, T* aValue );
|
williamr@2
|
1139 |
inline ~CAknEnumeratedItem();
|
williamr@2
|
1140 |
inline T* Value();
|
williamr@2
|
1141 |
inline void SetValue( T* );
|
williamr@2
|
1142 |
};
|
williamr@2
|
1143 |
|
williamr@2
|
1144 |
|
williamr@2
|
1145 |
template <class T>
|
williamr@2
|
1146 |
inline CAknEnumeratedItem<T>::CAknEnumeratedItem( TInt aEnumValue, T* aValue ) :
|
williamr@2
|
1147 |
CAknEnumeratedItemBase( aEnumValue, (TAny*)aValue)
|
williamr@2
|
1148 |
{
|
williamr@2
|
1149 |
}
|
williamr@2
|
1150 |
|
williamr@2
|
1151 |
template <class T>
|
williamr@2
|
1152 |
inline CAknEnumeratedItem<T>::~CAknEnumeratedItem()
|
williamr@2
|
1153 |
{
|
williamr@2
|
1154 |
delete (T*)Value();
|
williamr@2
|
1155 |
}
|
williamr@2
|
1156 |
|
williamr@2
|
1157 |
template <class T>
|
williamr@2
|
1158 |
inline T* CAknEnumeratedItem<T>::Value()
|
williamr@2
|
1159 |
{
|
williamr@2
|
1160 |
return ( ( T* ) CAknEnumeratedItemBase::Value() );
|
williamr@2
|
1161 |
}
|
williamr@2
|
1162 |
|
williamr@2
|
1163 |
template <class T>
|
williamr@2
|
1164 |
inline void CAknEnumeratedItem<T>::SetValue( T* aNewValue )
|
williamr@2
|
1165 |
{
|
williamr@2
|
1166 |
CAknEnumeratedItemBase::SetValue( aNewValue );
|
williamr@2
|
1167 |
}
|
williamr@2
|
1168 |
|
williamr@2
|
1169 |
|
williamr@2
|
1170 |
|
williamr@2
|
1171 |
/**
|
williamr@2
|
1172 |
* Definition of CAknEnumeratedText
|
williamr@2
|
1173 |
*/
|
williamr@2
|
1174 |
typedef CAknEnumeratedItem<HBufC> CAknEnumeratedText;
|
williamr@2
|
1175 |
|
williamr@2
|
1176 |
|
williamr@2
|
1177 |
|
williamr@2
|
1178 |
/**
|
williamr@2
|
1179 |
* CAknEnumeratedTextSettingItem
|
williamr@2
|
1180 |
*
|
williamr@2
|
1181 |
* Abstract Base class for deriving listbox setting page related setting items
|
williamr@2
|
1182 |
*
|
williamr@2
|
1183 |
* The class provides standard array support for these setting items and their
|
williamr@2
|
1184 |
* listboxes. Then approach is centred upon the CAknEnumeratedText type.
|
williamr@2
|
1185 |
*
|
williamr@2
|
1186 |
* The texts are exposed to the user, and appear in two versions, if desired - the text shown
|
williamr@2
|
1187 |
* in the setting list when not being edited, and the "popped-up" version of the texts.
|
williamr@2
|
1188 |
*
|
williamr@2
|
1189 |
*/
|
williamr@2
|
1190 |
class CAknEnumeratedTextSettingItem : public CAknSettingItem
|
williamr@2
|
1191 |
{
|
williamr@2
|
1192 |
public:
|
williamr@2
|
1193 |
/**
|
williamr@2
|
1194 |
* Constructor. Resource Id for the setting item
|
williamr@2
|
1195 |
*
|
williamr@2
|
1196 |
*/
|
williamr@2
|
1197 |
IMPORT_C CAknEnumeratedTextSettingItem( TInt aResourceId );
|
williamr@2
|
1198 |
|
williamr@2
|
1199 |
/**
|
williamr@2
|
1200 |
* Destructor
|
williamr@2
|
1201 |
*/
|
williamr@2
|
1202 |
IMPORT_C ~CAknEnumeratedTextSettingItem();
|
williamr@2
|
1203 |
|
williamr@2
|
1204 |
//
|
williamr@2
|
1205 |
// From CAknSettingItem
|
williamr@2
|
1206 |
//
|
williamr@2
|
1207 |
protected:
|
williamr@2
|
1208 |
|
williamr@2
|
1209 |
/**
|
williamr@2
|
1210 |
*
|
williamr@2
|
1211 |
* Virtual method called by framework to complete the construction.
|
williamr@2
|
1212 |
* In this class, the two arrays, pointers to which can be obtained by calling
|
williamr@2
|
1213 |
* EnumeratedTextArray() and PoppedUpTextArray() are created.
|
williamr@2
|
1214 |
*
|
williamr@2
|
1215 |
*/
|
williamr@2
|
1216 |
IMPORT_C void CompleteConstructionL();
|
williamr@2
|
1217 |
|
williamr@2
|
1218 |
private:
|
williamr@2
|
1219 |
IMPORT_C void CAknSettingItem_Reserved();
|
williamr@2
|
1220 |
|
williamr@2
|
1221 |
public:
|
williamr@2
|
1222 |
|
williamr@2
|
1223 |
/**
|
williamr@2
|
1224 |
* Access to the enumerated text array. Texts here are used in the setting item list
|
williamr@2
|
1225 |
* display.
|
williamr@2
|
1226 |
* No ownership of the array or its contents is transferred
|
williamr@2
|
1227 |
*
|
williamr@2
|
1228 |
* @return a pointer to an array of HBufC*s
|
williamr@2
|
1229 |
*/
|
williamr@2
|
1230 |
IMPORT_C CArrayPtr<CAknEnumeratedText>* EnumeratedTextArray() const;
|
williamr@2
|
1231 |
|
williamr@2
|
1232 |
/**
|
williamr@2
|
1233 |
* Access to the "popped up" array of texts. They may be defined differently from
|
williamr@2
|
1234 |
* those in the enumerated text array so that the setting page items can be different
|
williamr@2
|
1235 |
* from those displayed in the setting item editing list
|
williamr@2
|
1236 |
* No ownership of the array or its contents is transferred
|
williamr@2
|
1237 |
*
|
williamr@2
|
1238 |
* @return a pointer to an array of HBufC*s
|
williamr@2
|
1239 |
*/
|
williamr@2
|
1240 |
IMPORT_C CArrayPtr<HBufC>* PoppedUpTextArray() const;
|
williamr@2
|
1241 |
|
williamr@2
|
1242 |
/**
|
williamr@2
|
1243 |
* Set the enumerated arrays.
|
williamr@2
|
1244 |
* Ownership of these arrays and their contents is wholly given over to the setting item
|
williamr@2
|
1245 |
* object. The client must call HandleTextArrayUpdateL() after making this call.
|
williamr@2
|
1246 |
*
|
williamr@2
|
1247 |
* After calling SetEnumeratedTextArrays(), it is the client code's responsibility to ensure that
|
williamr@2
|
1248 |
* the current value of the external Tint value corresponds to one of the enumerated texts. This can
|
williamr@2
|
1249 |
* be done, for instance, after calling SetEnumeratedTextArrays() by calling IndexFromValue() and
|
williamr@2
|
1250 |
* ensuring a return value of a valid index (not -1 ). Otherwise, there will be a panic in
|
williamr@2
|
1251 |
* HandleTextArrayUpdateL() when it is called.
|
williamr@2
|
1252 |
*
|
williamr@2
|
1253 |
* This call transfers the ownership of the arrays, and the items pointed to by the arrays
|
williamr@2
|
1254 |
*
|
williamr@2
|
1255 |
* @param aEnumeratedTextArray array of Integer-Text pairs to be the new basis for display
|
williamr@2
|
1256 |
* This is the master array, and its Count() determines the number of entries to display
|
williamr@2
|
1257 |
* @param aPoppedUpTextArray array of Text descriptors that provide versions of the text
|
williamr@2
|
1258 |
* to display in the setting page listbox. The array pointer must be valid, but the
|
williamr@2
|
1259 |
* array need not contain any entries. Only those entries that need to be different
|
williamr@2
|
1260 |
* from those in aEnumeratedTextArray needs be present;
|
williamr@2
|
1261 |
*/
|
williamr@2
|
1262 |
IMPORT_C void SetEnumeratedTextArrays( CArrayPtr<CAknEnumeratedText>* aEnumeratedTextArray,
|
williamr@2
|
1263 |
CArrayPtr<HBufC>* PoppedUpTextArray );
|
williamr@2
|
1264 |
/**
|
williamr@2
|
1265 |
* Called to execute any code that might need to run when the text arrays are replaced.
|
williamr@2
|
1266 |
* This class has a null implementation
|
williamr@2
|
1267 |
*
|
williamr@2
|
1268 |
*/
|
williamr@2
|
1269 |
IMPORT_C virtual void HandleTextArrayUpdateL();
|
williamr@2
|
1270 |
|
williamr@2
|
1271 |
/**
|
williamr@2
|
1272 |
* Access to the number of items in the arrays
|
williamr@2
|
1273 |
*
|
williamr@2
|
1274 |
* @return The number of items in the array returned by EnumeratedTextArray()
|
williamr@2
|
1275 |
*/
|
williamr@2
|
1276 |
IMPORT_C TInt NumberOfItems() const;
|
williamr@2
|
1277 |
|
williamr@2
|
1278 |
/**
|
williamr@2
|
1279 |
* Routine to find the index in the enumerated text list that corresponds to the value
|
williamr@2
|
1280 |
* passed in.
|
williamr@2
|
1281 |
*
|
williamr@2
|
1282 |
* @param aInputValue value to search for in the enumerated items
|
williamr@2
|
1283 |
* @return 0 - based index in the item found. -1 if not found.
|
williamr@2
|
1284 |
*
|
williamr@2
|
1285 |
*/
|
williamr@2
|
1286 |
IMPORT_C TInt IndexFromValue( TInt aInputValue ) const;
|
williamr@2
|
1287 |
|
williamr@2
|
1288 |
protected:
|
williamr@2
|
1289 |
|
williamr@2
|
1290 |
/**
|
williamr@2
|
1291 |
* Implementors of subclasses can call this non-virtual method to set up the list of texts
|
williamr@2
|
1292 |
* to be used for the setting page. (Although it is not useful for CAknCheckBoxSettingPage)
|
williamr@2
|
1293 |
* The list is constructed from the contents of the two
|
williamr@2
|
1294 |
* text arrays, EnumeratedTextArray() and PoppedUpTextArray(). This is usually to be done
|
williamr@2
|
1295 |
* "On the fly" immediately prior to the raising of a setting page.
|
williamr@2
|
1296 |
*/
|
williamr@2
|
1297 |
IMPORT_C void SetSettingPageTextL();
|
williamr@2
|
1298 |
|
williamr@2
|
1299 |
/**
|
williamr@2
|
1300 |
* Accessor for the setting page text array
|
williamr@2
|
1301 |
*/
|
williamr@2
|
1302 |
IMPORT_C CDesCArray* SettingPageTextArray() const;
|
williamr@2
|
1303 |
|
williamr@2
|
1304 |
private:
|
williamr@2
|
1305 |
|
williamr@2
|
1306 |
/**
|
williamr@2
|
1307 |
* The primary text arrays (those set by SetEnumeratedTextArrays) are deleted and their
|
williamr@2
|
1308 |
* references zeroed.
|
williamr@2
|
1309 |
*/
|
williamr@2
|
1310 |
void DeleteAndZeroPrimaryArrays();
|
williamr@2
|
1311 |
|
williamr@2
|
1312 |
private:
|
williamr@2
|
1313 |
TInt iTextPopupFlags;
|
williamr@2
|
1314 |
CArrayPtr<CAknEnumeratedText>* iEnumeratedTextArray; // Owned and pointed to objects are owned
|
williamr@2
|
1315 |
CArrayPtr<HBufC>* iPoppedUpTextArray; // Owned and the HBufCs are owned here
|
williamr@2
|
1316 |
TInt iEnumeratedTextArrayResourceId;
|
williamr@2
|
1317 |
TInt iPoppedUpTextArrayResourceId;
|
williamr@2
|
1318 |
CDesCArrayFlat* iSettingPageText; // Owned
|
williamr@2
|
1319 |
HBufC* iSpare; // Formerly space was used by iEmptyText;
|
williamr@2
|
1320 |
};
|
williamr@2
|
1321 |
|
williamr@2
|
1322 |
|
williamr@2
|
1323 |
|
williamr@2
|
1324 |
/**
|
williamr@2
|
1325 |
* Setting item type for CAknEnumeratedItems.
|
williamr@2
|
1326 |
*
|
williamr@2
|
1327 |
* The main use case for this is for list of texts that are being manipulated in the
|
williamr@2
|
1328 |
* client source code as a set of enumerations, while the texts, read from resource,
|
williamr@2
|
1329 |
* are not strongly exposed to the client.
|
williamr@2
|
1330 |
*
|
williamr@2
|
1331 |
* They are exposed to the user, and appear in two versions, if desired - the text shown
|
williamr@2
|
1332 |
* in the setting list when not being edited, and the "popped-up" version of the texts.
|
williamr@2
|
1333 |
*
|
williamr@2
|
1334 |
*/
|
williamr@2
|
1335 |
class CAknEnumeratedTextPopupSettingItem : public CAknEnumeratedTextSettingItem
|
williamr@2
|
1336 |
{
|
williamr@2
|
1337 |
public:
|
williamr@2
|
1338 |
/**
|
williamr@2
|
1339 |
* Construct a list, storing in it a resource (to be read at 2nd stage construction)
|
williamr@2
|
1340 |
* and a reference to na externally owned integer - the value to be manipulated
|
williamr@2
|
1341 |
*
|
williamr@2
|
1342 |
*/
|
williamr@2
|
1343 |
IMPORT_C CAknEnumeratedTextPopupSettingItem( TInt aResourceId, TInt& aValue );
|
williamr@2
|
1344 |
|
williamr@2
|
1345 |
/**
|
williamr@2
|
1346 |
* Destructor
|
williamr@2
|
1347 |
*/
|
williamr@2
|
1348 |
IMPORT_C ~CAknEnumeratedTextPopupSettingItem();
|
williamr@2
|
1349 |
|
williamr@2
|
1350 |
/**
|
williamr@2
|
1351 |
* This command externalizes the current setting. The displayed (internal) copy
|
williamr@2
|
1352 |
* is transferred to the external copy (the one referenced in the constructor).
|
williamr@2
|
1353 |
*
|
williamr@2
|
1354 |
* This must be called by the client if he wants this to happen. Note that StoreAllL()
|
williamr@2
|
1355 |
* on the setting item list will call this for each setting item.
|
williamr@2
|
1356 |
*/
|
williamr@2
|
1357 |
IMPORT_C virtual void StoreL();
|
williamr@2
|
1358 |
|
williamr@2
|
1359 |
/*
|
williamr@2
|
1360 |
* The external value is transferred to the internal value
|
williamr@2
|
1361 |
* This occurs at construction, but may be called by client code when required.
|
williamr@2
|
1362 |
*/
|
williamr@2
|
1363 |
IMPORT_C virtual void LoadL();
|
williamr@2
|
1364 |
|
williamr@2
|
1365 |
/*
|
williamr@2
|
1366 |
* This method obtains the current value's setting text
|
williamr@2
|
1367 |
*
|
williamr@2
|
1368 |
* @return Reference to descriptor with the text
|
williamr@2
|
1369 |
*/
|
williamr@2
|
1370 |
IMPORT_C virtual const TDesC& SettingTextL();
|
williamr@2
|
1371 |
/**
|
williamr@2
|
1372 |
*
|
williamr@2
|
1373 |
* This launches the setting page for popup list setting page
|
williamr@2
|
1374 |
*
|
williamr@2
|
1375 |
* @param aCalledFromMenu - ignored in this class
|
williamr@2
|
1376 |
*
|
williamr@2
|
1377 |
*/
|
williamr@2
|
1378 |
IMPORT_C virtual void EditItemL( TBool aCalledFromMenu );
|
williamr@2
|
1379 |
|
williamr@2
|
1380 |
public:
|
williamr@2
|
1381 |
/**
|
williamr@2
|
1382 |
* Access to the enumerated text array. Texts here are used in the setting item list
|
williamr@2
|
1383 |
* display.
|
williamr@2
|
1384 |
*
|
williamr@2
|
1385 |
* @return a pointer to an array of HBufC*s
|
williamr@2
|
1386 |
*/
|
williamr@2
|
1387 |
IMPORT_C CArrayPtr<CAknEnumeratedText>* EnumeratedTextArray() const;
|
williamr@2
|
1388 |
|
williamr@2
|
1389 |
/**
|
williamr@2
|
1390 |
* Access to the "popped up" array of texts. They may be defined differently from
|
williamr@2
|
1391 |
* those in the enumerated text arry
|
williamr@2
|
1392 |
*
|
williamr@2
|
1393 |
* @return a pointer to an array of HBufC*s
|
williamr@2
|
1394 |
*/
|
williamr@2
|
1395 |
IMPORT_C CArrayPtr<HBufC>* PoppedUpTextArray() const;
|
williamr@2
|
1396 |
|
williamr@2
|
1397 |
protected:
|
williamr@2
|
1398 |
/**
|
williamr@2
|
1399 |
* Framework method for constructing the launching setting page
|
williamr@2
|
1400 |
* @return a constructed CAknSettingPage object on the heap
|
williamr@2
|
1401 |
*/
|
williamr@2
|
1402 |
IMPORT_C virtual CAknSettingPage* CreateSettingPageL();
|
williamr@2
|
1403 |
|
williamr@2
|
1404 |
/**
|
williamr@2
|
1405 |
* Framework method to create and execute setting page
|
williamr@2
|
1406 |
*/
|
williamr@2
|
1407 |
IMPORT_C virtual void CreateAndExecuteSettingPageL();
|
williamr@2
|
1408 |
|
williamr@2
|
1409 |
/**
|
williamr@2
|
1410 |
* Method called by framework to complete the construction. Extra allocations of
|
williamr@2
|
1411 |
* memory or extra resource reading can happen here.
|
williamr@2
|
1412 |
*
|
williamr@2
|
1413 |
*/
|
williamr@2
|
1414 |
IMPORT_C virtual void CompleteConstructionL();
|
williamr@2
|
1415 |
|
williamr@2
|
1416 |
/**
|
williamr@2
|
1417 |
* Sets the value of the (unowned) external value using the reference to it held
|
williamr@2
|
1418 |
* internally.
|
williamr@2
|
1419 |
* Note that this does not change the value of the reference itself.
|
williamr@2
|
1420 |
* That is, aNewValue's address is not copied in to be used as the external reference.
|
williamr@2
|
1421 |
* @param aNewValue Value to be copied via the external reference.
|
williamr@2
|
1422 |
*/
|
williamr@2
|
1423 |
IMPORT_C void SetExternalValue( TInt aNewValue );
|
williamr@2
|
1424 |
/**
|
williamr@2
|
1425 |
* Sets the internal value. The value of aNewValue is copied into the internal storage
|
williamr@2
|
1426 |
* holding the internal value
|
williamr@2
|
1427 |
* @param aNewValue
|
williamr@2
|
1428 |
*/
|
williamr@2
|
1429 |
IMPORT_C void SetInternalValue( TInt aNewValue );
|
williamr@2
|
1430 |
|
williamr@2
|
1431 |
/**
|
williamr@2
|
1432 |
* Set the item that is selected in the associated popup. This should be done so
|
williamr@2
|
1433 |
* as to keep the selected index consistent with the internal value
|
williamr@2
|
1434 |
*
|
williamr@2
|
1435 |
* @param aNewIndex
|
williamr@2
|
1436 |
*/
|
williamr@2
|
1437 |
IMPORT_C void SetSelectedIndex( TInt aNewIndex );
|
williamr@2
|
1438 |
|
williamr@2
|
1439 |
/**
|
williamr@2
|
1440 |
* Returns the index in the enumerated item array, given the value of the enumeration
|
williamr@2
|
1441 |
*
|
williamr@2
|
1442 |
* @param aInputValue Value to look up; Returns -1 if value is not found
|
williamr@2
|
1443 |
*/
|
williamr@2
|
1444 |
IMPORT_C TInt IndexFromValue( TInt aInputValue ) const ;
|
williamr@2
|
1445 |
|
williamr@2
|
1446 |
/**
|
williamr@2
|
1447 |
* Get the external value
|
williamr@2
|
1448 |
* @return TInt
|
williamr@2
|
1449 |
*/
|
williamr@2
|
1450 |
IMPORT_C TInt ExternalValue() const;
|
williamr@2
|
1451 |
/**
|
williamr@2
|
1452 |
* Access the internal value
|
williamr@2
|
1453 |
* @return TInt
|
williamr@2
|
1454 |
*/
|
williamr@2
|
1455 |
IMPORT_C TInt InternalValue() const;
|
williamr@2
|
1456 |
/**
|
williamr@2
|
1457 |
* Return a reference to the MAknQueryValue that is constructed for the CAknPopupListSettingPage
|
williamr@2
|
1458 |
* @return MAknQueryValue
|
williamr@2
|
1459 |
*/
|
williamr@2
|
1460 |
IMPORT_C MAknQueryValue* QueryValue() const;
|
williamr@2
|
1461 |
private:
|
williamr@2
|
1462 |
IMPORT_C void CAknSettingItem_Reserved();
|
williamr@2
|
1463 |
|
williamr@2
|
1464 |
private:
|
williamr@2
|
1465 |
void SetSettingPageTextL();
|
williamr@2
|
1466 |
void CreateTextArrayL();
|
williamr@2
|
1467 |
void CreateQueryValueL();
|
williamr@2
|
1468 |
void UpdateInternalValuesL();
|
williamr@2
|
1469 |
/**
|
williamr@2
|
1470 |
*
|
williamr@2
|
1471 |
* This routine looks at the current enumeration values and returns the next integer
|
williamr@2
|
1472 |
* higher than the highest enumeration. For internal use only, although it is possible
|
williamr@2
|
1473 |
* that clients or derivers might want to use somthing like it.
|
williamr@2
|
1474 |
*
|
williamr@2
|
1475 |
* @return a new unique value that can be used for extending the enumeration
|
williamr@2
|
1476 |
*/
|
williamr@2
|
1477 |
TInt FindNextEnumerationValue() const;
|
williamr@2
|
1478 |
|
williamr@2
|
1479 |
private:
|
williamr@2
|
1480 |
TInt& iExternalValue;
|
williamr@2
|
1481 |
TInt iInternalValue;
|
williamr@2
|
1482 |
TInt iNumberOfItems;
|
williamr@2
|
1483 |
TInt iSelectedIndex;
|
williamr@2
|
1484 |
CAknQueryValueText* iQueryValue;
|
williamr@2
|
1485 |
CAknQueryValueTextArray* iQueryTextArray;
|
williamr@2
|
1486 |
TInt iSpare_EnumeratedTextPopup_1;
|
williamr@2
|
1487 |
};
|
williamr@2
|
1488 |
|
williamr@2
|
1489 |
|
williamr@2
|
1490 |
class CAknBinaryPopupSettingItem : public CAknEnumeratedTextPopupSettingItem
|
williamr@2
|
1491 |
{
|
williamr@2
|
1492 |
public:
|
williamr@2
|
1493 |
/**
|
williamr@2
|
1494 |
* Constructs a binary setting value, given a resource id and a reference to
|
williamr@2
|
1495 |
* an externally owned external boolen setting item.
|
williamr@2
|
1496 |
* Resource supplied is just as for CAknEnumeratedTextPopupSettingItem
|
williamr@2
|
1497 |
*
|
williamr@2
|
1498 |
* @param aIdentifier Resource id for the associated values and texts;
|
williamr@2
|
1499 |
*
|
williamr@2
|
1500 |
*/
|
williamr@2
|
1501 |
IMPORT_C CAknBinaryPopupSettingItem( TInt aIdentifier, TBool& aBinaryValue );
|
williamr@2
|
1502 |
|
williamr@2
|
1503 |
/**
|
williamr@2
|
1504 |
* This command externalizes the current setting. The displayed (internal) copy
|
williamr@2
|
1505 |
* is transferred to the external copy (the one referenced in the constructor).
|
williamr@2
|
1506 |
*
|
williamr@2
|
1507 |
* This must be called by the client if he wants this to happen. Note that StoreAllL()
|
williamr@2
|
1508 |
* on the setting item list will call this for each setting item.
|
williamr@2
|
1509 |
*/
|
williamr@2
|
1510 |
IMPORT_C virtual void StoreL();
|
williamr@2
|
1511 |
/*
|
williamr@2
|
1512 |
* The external value is transferred to the internal value
|
williamr@2
|
1513 |
* This occurs at construction, but may be called by client code when required.
|
williamr@2
|
1514 |
*/
|
williamr@2
|
1515 |
IMPORT_C virtual void LoadL();
|
williamr@2
|
1516 |
/**
|
williamr@2
|
1517 |
*
|
williamr@2
|
1518 |
* This launches the setting page (or just toggles) the binary setting
|
williamr@2
|
1519 |
*
|
williamr@2
|
1520 |
* @param aCalledFromMenu - This flag determines if the setting page actually
|
williamr@2
|
1521 |
* launches or not. It does not if this flag is EFalse - the value is just toggled
|
williamr@2
|
1522 |
*
|
williamr@2
|
1523 |
*/
|
williamr@2
|
1524 |
IMPORT_C virtual void EditItemL( TBool aCalledFromMenu );
|
williamr@2
|
1525 |
|
williamr@2
|
1526 |
protected:
|
williamr@2
|
1527 |
/**
|
williamr@2
|
1528 |
* Method called by framework to complete the construction. Extra allocations of
|
williamr@2
|
1529 |
* memory or extra resource reading can happen here.
|
williamr@2
|
1530 |
*
|
williamr@2
|
1531 |
*/
|
williamr@2
|
1532 |
IMPORT_C virtual void CompleteConstructionL();
|
williamr@2
|
1533 |
private:
|
williamr@2
|
1534 |
IMPORT_C void CAknSettingItem_Reserved();
|
williamr@2
|
1535 |
private:
|
williamr@2
|
1536 |
TAny* iUnused;
|
williamr@2
|
1537 |
};
|
williamr@2
|
1538 |
|
williamr@2
|
1539 |
|
williamr@2
|
1540 |
/**
|
williamr@2
|
1541 |
* This class can be used as a base class for "Big Settings". The additional
|
williamr@2
|
1542 |
* functionality is small - merely to ensure that there is an empty string
|
williamr@2
|
1543 |
* in the list box text.
|
williamr@2
|
1544 |
*
|
williamr@2
|
1545 |
* To derive from this class, the client code is usually expected to add a new constructor,
|
williamr@2
|
1546 |
* re-implement StoreL, LoadL() and EditItemL().
|
williamr@2
|
1547 |
*
|
williamr@2
|
1548 |
*/
|
williamr@2
|
1549 |
class CAknBigSettingItemBase : public CAknSettingItem
|
williamr@2
|
1550 |
{
|
williamr@2
|
1551 |
public:
|
williamr@2
|
1552 |
/**
|
williamr@2
|
1553 |
* Contruct the "Big" setting item. The passed resource identifier all that is needed
|
williamr@2
|
1554 |
* There is no external value to reference.
|
williamr@2
|
1555 |
*/
|
williamr@2
|
1556 |
IMPORT_C CAknBigSettingItemBase( TInt aIdentifier );
|
williamr@2
|
1557 |
|
williamr@2
|
1558 |
protected:
|
williamr@2
|
1559 |
/*
|
williamr@2
|
1560 |
* This method obtains the current value's setting text
|
williamr@2
|
1561 |
*
|
williamr@2
|
1562 |
* @return Reference to descriptor with the text
|
williamr@2
|
1563 |
*/
|
williamr@2
|
1564 |
IMPORT_C virtual const TDesC& SettingTextL();
|
williamr@2
|
1565 |
private:
|
williamr@2
|
1566 |
IMPORT_C void CAknSettingItem_Reserved();
|
williamr@2
|
1567 |
|
williamr@2
|
1568 |
private:
|
williamr@2
|
1569 |
const TDesC& iEmptyString;
|
williamr@2
|
1570 |
|
williamr@2
|
1571 |
};
|
williamr@2
|
1572 |
|
williamr@2
|
1573 |
|
williamr@2
|
1574 |
/**
|
williamr@2
|
1575 |
* This class holds the setting items themselves and also manages the bitmap array
|
williamr@2
|
1576 |
*/
|
williamr@2
|
1577 |
class CAknSettingItemArray : public CArrayPtrFlat<CAknSettingItem>, public MDesCArray
|
williamr@2
|
1578 |
{
|
williamr@2
|
1579 |
public:
|
williamr@2
|
1580 |
/**
|
williamr@2
|
1581 |
* CAknSettingItemArray is constructed as a numbered or unnumbered array.
|
williamr@2
|
1582 |
* @param aGranularity - number of items to extend when the aarray needs extention
|
williamr@2
|
1583 |
* @param aIsNumbered - flags the array as numbered or not
|
williamr@2
|
1584 |
* @param aInitialOrdinal - value to start the numbering at
|
williamr@2
|
1585 |
*/
|
williamr@2
|
1586 |
IMPORT_C CAknSettingItemArray( TInt aGranularity, TBool aIsNumbered, TInt aInitialOrdinal );
|
williamr@2
|
1587 |
/**
|
williamr@2
|
1588 |
* Destructor
|
williamr@2
|
1589 |
*/
|
williamr@2
|
1590 |
IMPORT_C virtual ~CAknSettingItemArray();
|
williamr@2
|
1591 |
|
williamr@2
|
1592 |
// from MDesC16Array
|
williamr@2
|
1593 |
/**
|
williamr@2
|
1594 |
* Method by which the CAknSetStyleListBox accesses the number of items in the array
|
williamr@2
|
1595 |
* @return number of items in the array
|
williamr@2
|
1596 |
*/
|
williamr@2
|
1597 |
IMPORT_C TInt MdcaCount() const;
|
williamr@2
|
1598 |
/**
|
williamr@2
|
1599 |
* Method by which the setting item list accesses the text for the aIndex-th item in the
|
williamr@2
|
1600 |
* array.
|
williamr@2
|
1601 |
*
|
williamr@2
|
1602 |
* @param aIndex index at which to access the listbox text
|
williamr@2
|
1603 |
* @return Descriptor for this item to be used by the listbox.
|
williamr@2
|
1604 |
*/
|
williamr@2
|
1605 |
IMPORT_C TPtrC16 MdcaPoint(TInt aIndex) const;
|
williamr@2
|
1606 |
// For hidden item support
|
williamr@2
|
1607 |
/**
|
williamr@2
|
1608 |
* This method returns the true index in the array given the index as would be
|
williamr@2
|
1609 |
* calculated by looking at the visible items.
|
williamr@2
|
1610 |
*
|
williamr@2
|
1611 |
* @param aVisibleIndex - index among the visible items
|
williamr@2
|
1612 |
* @return the corresponding "true" index in the array
|
williamr@2
|
1613 |
*/
|
williamr@2
|
1614 |
IMPORT_C TInt ItemIndexFromVisibleIndex( TInt aVisibleIndex ) const;
|
williamr@2
|
1615 |
/**
|
williamr@2
|
1616 |
* Update date the mapping of visible indices. To be called when an item is made
|
williamr@2
|
1617 |
* visible or invisible.
|
williamr@2
|
1618 |
*
|
williamr@2
|
1619 |
*/
|
williamr@2
|
1620 |
IMPORT_C virtual void RecalculateVisibleIndicesL();
|
williamr@2
|
1621 |
/**
|
williamr@2
|
1622 |
* This is used to update the initial setting number for the top index. The number set
|
williamr@2
|
1623 |
* is the for the 0-th "true" or data index. That is, this numbered item may not show up
|
williamr@2
|
1624 |
*
|
williamr@2
|
1625 |
*/
|
williamr@2
|
1626 |
IMPORT_C void SetInitialOrdinal( TInt aInitialOrdinal );
|
williamr@2
|
1627 |
/*
|
williamr@2
|
1628 |
* Method used to transfer flags from the CAknSettingItemList to this array
|
williamr@2
|
1629 |
*/
|
williamr@2
|
1630 |
IMPORT_C void SetFlags( TInt aFlags );
|
williamr@2
|
1631 |
protected:
|
williamr@2
|
1632 |
|
williamr@2
|
1633 |
/**
|
williamr@2
|
1634 |
* Set the number of visible items.
|
williamr@2
|
1635 |
* @param aCount number of items that are visible.
|
williamr@2
|
1636 |
*/
|
williamr@2
|
1637 |
IMPORT_C void SetVisibleCount( TInt aCount );
|
williamr@2
|
1638 |
/**
|
williamr@2
|
1639 |
* Returns the number of visible items
|
williamr@2
|
1640 |
*
|
williamr@2
|
1641 |
* @return the number of visible items
|
williamr@2
|
1642 |
*/
|
williamr@2
|
1643 |
IMPORT_C TInt VisibleCount() const;
|
williamr@2
|
1644 |
|
williamr@2
|
1645 |
private:
|
williamr@2
|
1646 |
TBool iIsNumbered;
|
williamr@2
|
1647 |
TInt iInitialOrdinal;
|
williamr@2
|
1648 |
TInt iVisibleCount;
|
williamr@2
|
1649 |
TInt iFlags;
|
williamr@2
|
1650 |
};
|
williamr@2
|
1651 |
|
williamr@2
|
1652 |
|
williamr@2
|
1653 |
class CAknSettingItemList : public CAknControl , public MEikListBoxObserver
|
williamr@2
|
1654 |
{
|
williamr@2
|
1655 |
public:
|
williamr@2
|
1656 |
enum TAknSettingItemStyle
|
williamr@2
|
1657 |
{
|
williamr@2
|
1658 |
ENumberedStyle, // The setting item list displays number
|
williamr@2
|
1659 |
EUnnumberedStyle // The setting item list does not disply number
|
williamr@2
|
1660 |
};
|
williamr@2
|
1661 |
|
williamr@2
|
1662 |
public:
|
williamr@2
|
1663 |
/**
|
williamr@2
|
1664 |
* Constructs the setting item list
|
williamr@2
|
1665 |
*/
|
williamr@2
|
1666 |
IMPORT_C CAknSettingItemList();
|
williamr@2
|
1667 |
/**
|
williamr@2
|
1668 |
* Destructor
|
williamr@2
|
1669 |
*/
|
williamr@2
|
1670 |
IMPORT_C ~CAknSettingItemList();
|
williamr@2
|
1671 |
|
williamr@2
|
1672 |
// From CCoeControl
|
williamr@2
|
1673 |
/**
|
williamr@2
|
1674 |
* 2nd-stage construction from resource id
|
williamr@2
|
1675 |
*/
|
williamr@2
|
1676 |
IMPORT_C void ConstructFromResourceL(TInt aResourceId );
|
williamr@2
|
1677 |
/**
|
williamr@2
|
1678 |
* 2nd-stage construction from constructed resource reader
|
williamr@2
|
1679 |
*/
|
williamr@2
|
1680 |
IMPORT_C void ConstructFromResourceL( TResourceReader& aReader );
|
williamr@2
|
1681 |
|
williamr@2
|
1682 |
/**
|
williamr@2
|
1683 |
* @return the number of component controls
|
williamr@2
|
1684 |
*/
|
williamr@2
|
1685 |
IMPORT_C TInt CountComponentControls() const;
|
williamr@2
|
1686 |
/**
|
williamr@2
|
1687 |
* @param TInt aId
|
williamr@2
|
1688 |
* @return a reference to the component control at index aId
|
williamr@2
|
1689 |
*/
|
williamr@2
|
1690 |
IMPORT_C CCoeControl* ComponentControl(TInt aId ) const;
|
williamr@2
|
1691 |
|
williamr@2
|
1692 |
/**
|
williamr@2
|
1693 |
* Handles keys sent to this control
|
williamr@2
|
1694 |
*/
|
williamr@2
|
1695 |
IMPORT_C virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
|
williamr@2
|
1696 |
/**
|
williamr@2
|
1697 |
* Take action necessary when the focus is change
|
williamr@2
|
1698 |
*/
|
williamr@2
|
1699 |
IMPORT_C virtual void FocusChanged(TDrawNow aDrawNow);
|
williamr@2
|
1700 |
|
williamr@2
|
1701 |
/**
|
williamr@2
|
1702 |
* Handles a change to the control's resources of type aType
|
williamr@2
|
1703 |
* which are shared across the environment, e.g. colors or fonts.
|
williamr@2
|
1704 |
*
|
williamr@2
|
1705 |
* @since 2.0
|
williamr@2
|
1706 |
* @param aType Reason for the "resource" change, usually an system event UID
|
williamr@2
|
1707 |
*/
|
williamr@2
|
1708 |
IMPORT_C void HandleResourceChange(TInt aType);
|
williamr@2
|
1709 |
|
williamr@2
|
1710 |
// from MEikListBoxObserver
|
williamr@2
|
1711 |
IMPORT_C virtual void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
|
williamr@2
|
1712 |
|
williamr@2
|
1713 |
public:
|
williamr@2
|
1714 |
// Framework methods
|
williamr@2
|
1715 |
/**
|
williamr@2
|
1716 |
*
|
williamr@2
|
1717 |
* This launches the setting page for the current item by calling EditItemL on it
|
williamr@2
|
1718 |
*
|
williamr@2
|
1719 |
* @param aIndex - current item's (Visible) index in the list
|
williamr@2
|
1720 |
* aCalledFromMenu- ignored in most classes; may alter the behaviour
|
williamr@2
|
1721 |
* of the setting page
|
williamr@2
|
1722 |
*/
|
williamr@2
|
1723 |
IMPORT_C virtual void EditItemL(TInt aIndex, TBool aCalledFromMenu);
|
williamr@2
|
1724 |
/**
|
williamr@2
|
1725 |
*
|
williamr@2
|
1726 |
* Calls LoadL() on each item in the MAknSettingItemArray.
|
williamr@2
|
1727 |
*
|
williamr@2
|
1728 |
*/
|
williamr@2
|
1729 |
IMPORT_C virtual void LoadSettingsL();
|
williamr@2
|
1730 |
/**
|
williamr@2
|
1731 |
* This command calls StoreL on all the setting items (hidden or not)
|
williamr@2
|
1732 |
*
|
williamr@2
|
1733 |
* This must be called by the client if he wants it to occur
|
williamr@2
|
1734 |
*/
|
williamr@2
|
1735 |
IMPORT_C virtual void StoreSettingsL(); // call StoreL() on each item in MAknSettingItemArray
|
williamr@2
|
1736 |
|
williamr@2
|
1737 |
/**
|
williamr@2
|
1738 |
* @param aInclude If EFalse, numbering does not include hidden items
|
williamr@2
|
1739 |
* Otherwise, they are
|
williamr@2
|
1740 |
*/
|
williamr@2
|
1741 |
IMPORT_C void SetIncludeHiddenInOrdinal( TBool aInclude );
|
williamr@2
|
1742 |
|
williamr@2
|
1743 |
/**
|
williamr@2
|
1744 |
* @return EFalse if the listbox is not numbered style; Not EFalse otherwise
|
williamr@2
|
1745 |
*/
|
williamr@2
|
1746 |
IMPORT_C TBool IsNumberedStyle();
|
williamr@2
|
1747 |
/**
|
williamr@2
|
1748 |
* @return the listbox used by setting item list
|
williamr@2
|
1749 |
*/
|
williamr@2
|
1750 |
IMPORT_C CEikFormattedCellListBox* ListBox(); // get the listbox
|
williamr@2
|
1751 |
/**
|
williamr@2
|
1752 |
* @return a pointer to the setting item array; No ownership is transferred
|
williamr@2
|
1753 |
*/
|
williamr@2
|
1754 |
IMPORT_C CAknSettingItemArray* SettingItemArray() const;
|
williamr@2
|
1755 |
/**
|
williamr@2
|
1756 |
* Method to be called when the client code has added or removed items or their visibility;
|
williamr@2
|
1757 |
* This should be called when a single event's batch of array or visibility changes
|
williamr@2
|
1758 |
* is complete in order to avoid more re-draws than is necessary
|
williamr@2
|
1759 |
*/
|
williamr@2
|
1760 |
IMPORT_C void HandleChangeInItemArrayOrVisibilityL();
|
williamr@2
|
1761 |
/**
|
williamr@2
|
1762 |
* From CCoeControl.
|
williamr@2
|
1763 |
* Handles pointer events
|
williamr@2
|
1764 |
*/
|
williamr@2
|
1765 |
IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
|
williamr@2
|
1766 |
|
williamr@2
|
1767 |
protected:
|
williamr@2
|
1768 |
/**
|
williamr@2
|
1769 |
* Framework method to create a setting item based upon the user id aSettingId. The
|
williamr@2
|
1770 |
* client code decides what type to contruct. new (ELeave) must then be used and the resulting
|
williamr@2
|
1771 |
* pointer returned. Ownership is thereafter base class's responsiblity.
|
williamr@2
|
1772 |
*
|
williamr@2
|
1773 |
* @param aSettingId ID to use to determine the type of the setting item
|
williamr@2
|
1774 |
* @return a constructed (not 2nd-stage constructed) setting item.
|
williamr@2
|
1775 |
*/
|
williamr@2
|
1776 |
IMPORT_C virtual CAknSettingItem* CreateSettingItemL( TInt aSettingId );
|
williamr@2
|
1777 |
private:
|
williamr@2
|
1778 |
/**
|
williamr@2
|
1779 |
* From CAknControl
|
williamr@2
|
1780 |
*/
|
williamr@2
|
1781 |
IMPORT_C void* ExtensionInterface( TUid aInterface );
|
williamr@2
|
1782 |
|
williamr@2
|
1783 |
private:
|
williamr@2
|
1784 |
void UpdateAllListBoxTextsL() const;
|
williamr@2
|
1785 |
|
williamr@2
|
1786 |
private:
|
williamr@2
|
1787 |
|
williamr@2
|
1788 |
// Owned objects:
|
williamr@2
|
1789 |
CEikFormattedCellListBox* iSettingItemListBox;
|
williamr@2
|
1790 |
CAknSettingItemArray* iSettingItemArray;
|
williamr@2
|
1791 |
|
williamr@2
|
1792 |
// Other non-CBase classes
|
williamr@2
|
1793 |
HBufC* iSettingItemListTitle; // Owned
|
williamr@2
|
1794 |
|
williamr@2
|
1795 |
// Internal information
|
williamr@2
|
1796 |
TInt iFlags;
|
williamr@2
|
1797 |
TInt iInitialOrdinal;
|
williamr@2
|
1798 |
|
williamr@2
|
1799 |
TInt iSpare_1;
|
williamr@2
|
1800 |
TInt iSpare_2;
|
williamr@2
|
1801 |
};
|
williamr@2
|
1802 |
|
williamr@2
|
1803 |
|
williamr@2
|
1804 |
|
williamr@2
|
1805 |
|
williamr@2
|
1806 |
#endif
|