|
1 /* |
|
2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 /** |
|
20 * Generated helper class which manages the settings contained |
|
21 * in 'TextToSpeechSettingItemList'. Each CAknSettingItem maintains |
|
22 * a reference to data in this class so that changes in the setting |
|
23 * item list can be synchronized with this storage. |
|
24 */ |
|
25 |
|
26 #include <stringloader.h> |
|
27 #include <texttospeech.rsg> |
|
28 |
|
29 #include "texttospeechsettingitemlistsettings.h" |
|
30 |
|
31 const TInt KMinSliderValue = 10; |
|
32 |
|
33 /** |
|
34 * C/C++ constructor for settings data, cannot throw |
|
35 */ |
|
36 CTextToSpeechSettingItemListSettings::CTextToSpeechSettingItemListSettings() |
|
37 { |
|
38 } |
|
39 |
|
40 /** |
|
41 * Two-phase constructor for settings data |
|
42 */ |
|
43 CTextToSpeechSettingItemListSettings* CTextToSpeechSettingItemListSettings::NewL() |
|
44 { |
|
45 CTextToSpeechSettingItemListSettings* data = |
|
46 new( ELeave ) CTextToSpeechSettingItemListSettings(); |
|
47 |
|
48 CleanupStack::PushL( data ); |
|
49 data->ConstructL(); |
|
50 CleanupStack::Pop( data ); |
|
51 |
|
52 return data; |
|
53 } |
|
54 |
|
55 /** |
|
56 * Second phase for initializing settings data |
|
57 */ |
|
58 void CTextToSpeechSettingItemListSettings::ConstructL() |
|
59 { |
|
60 HBufC* text = StringLoader::LoadLC( R_TEXT_TO_SPEECH_SETTING_ITEM_LIST_EDIT1 ); |
|
61 SetEdit1( text->Des() ); |
|
62 CleanupStack::PopAndDestroy( text ); |
|
63 |
|
64 SetEnumeratedTextPopup1( 0 ); |
|
65 SetEnumeratedTextPopup2( 0 ); |
|
66 SetSlider1( KMinSliderValue ); |
|
67 } |
|
68 |
|
69 /** |
|
70 * Destructor |
|
71 */ |
|
72 CTextToSpeechSettingItemListSettings::~CTextToSpeechSettingItemListSettings() |
|
73 { |
|
74 iLanguages.Close(); |
|
75 iVoices.Close(); |
|
76 } |
|
77 |
|
78 /** |
|
79 * Return reference to text |
|
80 */ |
|
81 TDes& CTextToSpeechSettingItemListSettings::Edit1() |
|
82 { |
|
83 return iEdit1; |
|
84 } |
|
85 |
|
86 /** |
|
87 * Set text and limit it to maximum length if necessary |
|
88 */ |
|
89 void CTextToSpeechSettingItemListSettings::SetEdit1( const TDesC& aValue ) |
|
90 { |
|
91 if ( aValue.Length() < KEdit1MaxLength ) |
|
92 { |
|
93 iEdit1.Copy( aValue ); |
|
94 } |
|
95 else |
|
96 { |
|
97 iEdit1.Copy( aValue.Ptr(), KEdit1MaxLength ); |
|
98 } |
|
99 } |
|
100 |
|
101 /** |
|
102 * Return index of selected language |
|
103 */ |
|
104 TInt& CTextToSpeechSettingItemListSettings::EnumeratedTextPopup1() |
|
105 { |
|
106 return iEnumeratedTextPopup1; |
|
107 } |
|
108 |
|
109 /** |
|
110 * Set index of selected language |
|
111 */ |
|
112 void CTextToSpeechSettingItemListSettings::SetEnumeratedTextPopup1( const TInt& aValue ) |
|
113 { |
|
114 iEnumeratedTextPopup1 = aValue; |
|
115 } |
|
116 |
|
117 /** |
|
118 * Return index of selected voice name |
|
119 */ |
|
120 TInt& CTextToSpeechSettingItemListSettings::EnumeratedTextPopup2() |
|
121 { |
|
122 return iEnumeratedTextPopup2; |
|
123 } |
|
124 |
|
125 /** |
|
126 * Set index of selected voice name |
|
127 */ |
|
128 void CTextToSpeechSettingItemListSettings::SetEnumeratedTextPopup2( const TInt& aValue ) |
|
129 { |
|
130 iEnumeratedTextPopup2 = aValue; |
|
131 } |
|
132 |
|
133 /** |
|
134 * Return speaking rate value |
|
135 */ |
|
136 TInt& CTextToSpeechSettingItemListSettings::Slider1() |
|
137 { |
|
138 return iSlider1; |
|
139 } |
|
140 |
|
141 /** |
|
142 * Set speaking rate value |
|
143 */ |
|
144 void CTextToSpeechSettingItemListSettings::SetSlider1( const TInt& aValue ) |
|
145 { |
|
146 iSlider1 = aValue; |
|
147 } |
|
148 |
|
149 // End of file |