1 /* |
|
2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Setting item for integer settings |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 // INCLUDE FILES |
|
22 #include <aknradiobuttonsettingpage.h> |
|
23 #include <akntextsettingpage.h> |
|
24 #include "psuigspluginmodel.h" |
|
25 #include "psuiintegersettingitem.h" |
|
26 |
|
27 // ========================= MEMBER FUNCTIONS ================================ |
|
28 |
|
29 // --------------------------------------------------------------------------- |
|
30 // CPSUIIntegerSettingItem::CPSUIIntegerSettingItem() |
|
31 // See header for details. |
|
32 // --------------------------------------------------------------------------- |
|
33 // |
|
34 CPSUIIntegerSettingItem::CPSUIIntegerSettingItem( TInt aIdentifier, TInt& aValue ) |
|
35 : CAknIntegerEdwinSettingItem ( aIdentifier, aValue ), |
|
36 iPSUIInternalTextPtr( 0,0 ) |
|
37 { |
|
38 } |
|
39 |
|
40 // --------------------------------------------------------------------------- |
|
41 // CPSUIIntegerSettingItem::~CPSUIIntegerSettingItem() |
|
42 // See header for details. |
|
43 // --------------------------------------------------------------------------- |
|
44 // |
|
45 CPSUIIntegerSettingItem::~CPSUIIntegerSettingItem() |
|
46 { |
|
47 delete iPSUIInternalText; |
|
48 } |
|
49 |
|
50 // --------------------------------------------------------------------------- |
|
51 // CPSUIIntegerSettingItem::CompleteConstructionL() |
|
52 // See header for details. |
|
53 // --------------------------------------------------------------------------- |
|
54 // |
|
55 void CPSUIIntegerSettingItem::CompleteConstructionL() |
|
56 { |
|
57 const TInt KPSUIMaxIntegerDigits = 2 * EAknMaxIntegerDigits;// a bit longer for storing also empty texts |
|
58 iPSUIInternalText = HBufC::NewMaxL( KPSUIMaxIntegerDigits ); |
|
59 } |
|
60 |
|
61 // --------------------------------------------------------------------------- |
|
62 // CPSUIIntegerSettingItem::SettingTextL() |
|
63 // See header for details. |
|
64 // --------------------------------------------------------------------------- |
|
65 // |
|
66 const TDesC& CPSUIIntegerSettingItem::SettingTextL() |
|
67 { |
|
68 _LIT( KAknIntegerFormat, "%d" ); |
|
69 iPSUIInternalTextPtr.Set( iPSUIInternalText->Des() ); |
|
70 TInt& intValueRef = InternalValueRef(); |
|
71 if ( intValueRef == KErrNotFound ) |
|
72 { |
|
73 iPSUIInternalTextPtr.Zero(); |
|
74 iPSUIInternalTextPtr.Append( EmptyItemText() ); |
|
75 iPSUIInternalTextPtr.Append( KColumnListSeparator ); |
|
76 } |
|
77 else |
|
78 { |
|
79 iPSUIInternalTextPtr.Format( KAknIntegerFormat, intValueRef ); |
|
80 AknTextUtils::DisplayTextLanguageSpecificNumberConversion( |
|
81 iPSUIInternalTextPtr ); |
|
82 } |
|
83 |
|
84 return iPSUIInternalTextPtr; |
|
85 } |
|
86 |
|
87 // End of File |
|