|
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: Video Telephone local variation class. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <centralrepository.h> |
|
20 #include <settingsinternalcrkeys.h> |
|
21 #include <cvtlogger.h> |
|
22 |
|
23 #include "VideoTelephonyInternalCRKeys.h" |
|
24 #include "tvtuilocalvariation.h" |
|
25 #include "tVtuifeaturevariation.h" |
|
26 |
|
27 // TVtUiVariationBase |
|
28 |
|
29 // ----------------------------------------------------------------------------- |
|
30 // TVtUiVariationBase::ReadL |
|
31 // ----------------------------------------------------------------------------- |
|
32 // |
|
33 void TVtUiVariationBase::ReadL( const TInt adefault ) |
|
34 { |
|
35 __VTPRINTENTER( "VtUi.LocalVariation.ReadL" ) |
|
36 CRepository* repository = CRepository::NewL( Uid() ); |
|
37 TInt value( 0 ); |
|
38 if ( !repository->Get( Key(), value ) ) |
|
39 { |
|
40 SetValue( value ); |
|
41 } |
|
42 // incase of error |
|
43 else |
|
44 { |
|
45 // If default is set |
|
46 if ( adefault != -1 ) |
|
47 { |
|
48 __VTPRINT2( DEBUG_GEN, "VtUi.LocalVariation.ReadL def=%d", adefault ) |
|
49 SetValue( adefault ); |
|
50 } |
|
51 } |
|
52 delete repository; |
|
53 __VTPRINTEXIT( "VtUi.LocalVariation.ReadL" ) |
|
54 } |
|
55 // ----------------------------------------------------------------------------- |
|
56 // TVtUiVariationBase::Value |
|
57 // ----------------------------------------------------------------------------- |
|
58 // |
|
59 TUint32 TVtUiVariationBase::ReceiveValue() const |
|
60 { |
|
61 __VTPRINTENTER( "VtUi.LocalVariation.ReceiveValue" ) |
|
62 __VTPRINTEXIT( "VtUi.LocalVariation.ReceiveValue" ) |
|
63 return Value(); |
|
64 } |
|
65 |
|
66 // TVtUiVideoTelephonyVariation |
|
67 // ----------------------------------------------------------------------------- |
|
68 // TVtUiVideoTelephonyVariation::Uid |
|
69 // ----------------------------------------------------------------------------- |
|
70 // |
|
71 const TUid& TVtUiVideoTelephonyVariation::Uid() const |
|
72 { |
|
73 return KCRUidVTVariation; |
|
74 } |
|
75 |
|
76 // ----------------------------------------------------------------------------- |
|
77 // TVtUiVideoTelephonyVariation::Key |
|
78 // ----------------------------------------------------------------------------- |
|
79 // |
|
80 TUint32 TVtUiVideoTelephonyVariation::Key() const |
|
81 { |
|
82 return KVTLocalVariationFlags; |
|
83 } |
|
84 |
|
85 // TVtUiActiveIdleVariation |
|
86 // ----------------------------------------------------------------------------- |
|
87 // TVtUiActiveIdleVariation::IsActiveIdleEnabled |
|
88 // ----------------------------------------------------------------------------- |
|
89 // |
|
90 TBool TVtUiActiveIdleVariation::IsActiveIdleEnabled() |
|
91 { |
|
92 __VTPRINTENTER( "VtUi.LocalVariation.AI.IsActiveIdleEnabled" ) |
|
93 #ifndef RD_BOOT_CUSTOMIZABLE_AI |
|
94 TVtUiActiveIdleFetManVariation featman; |
|
95 TRAP_IGNORE( ReadL() ); |
|
96 __VTPRINTEXIT( "VtUi.LocalVariation.AI.IsActiveIdleEnabled" ) |
|
97 return featman.IsActiveIdleFetManSupported() && Value(); |
|
98 // AI 2 implementation always true |
|
99 #else |
|
100 __VTPRINTEXIT( "VtUi.LocalVariation.AI.IsActiveIdleEnabled" ) |
|
101 return ETrue; |
|
102 #endif // RD_BOOT_CUSTOMIZABLE_AI |
|
103 } |
|
104 |
|
105 // ----------------------------------------------------------------------------- |
|
106 // TVtUiActiveIdleVariation::Uid |
|
107 // ----------------------------------------------------------------------------- |
|
108 // |
|
109 const TUid& TVtUiActiveIdleVariation::Uid() const |
|
110 { |
|
111 return KCRUidPersonalizationSettings; |
|
112 } |
|
113 |
|
114 // ----------------------------------------------------------------------------- |
|
115 // TVtUiActiveIdleVariation::Key |
|
116 // ----------------------------------------------------------------------------- |
|
117 // |
|
118 TUint32 TVtUiActiveIdleVariation::Key() const |
|
119 { |
|
120 return KSettingsActiveIdleState; |
|
121 } |
|
122 |
|
123 // TVtUiGsMuteVariation |
|
124 // ----------------------------------------------------------------------------- |
|
125 // TVtUiGsMuteVariation::GsMuteState |
|
126 // ----------------------------------------------------------------------------- |
|
127 // |
|
128 TUint32 TVtUiGsMuteVariation::GsMuteState() |
|
129 { |
|
130 __VTPRINTENTER( "VtUi.LocalVariation.Gs.GsMuteState" ) |
|
131 TRAP_IGNORE( ReadL( KAllwaysQuery ) ); |
|
132 __VTPRINTEXIT( "VtUi.LocalVariation.Gs.GsMuteState" ) |
|
133 return ReceiveValue(); |
|
134 } |
|
135 // ----------------------------------------------------------------------------- |
|
136 // TVtUiGsMuteVariation::Uid |
|
137 // ----------------------------------------------------------------------------- |
|
138 // |
|
139 const TUid& TVtUiGsMuteVariation::Uid() const |
|
140 { |
|
141 return KCRUidTelephonySettings; |
|
142 } |
|
143 |
|
144 // ----------------------------------------------------------------------------- |
|
145 // TVtUiActiveIdleVariation::Key |
|
146 // ----------------------------------------------------------------------------- |
|
147 // |
|
148 TUint32 TVtUiGsMuteVariation::Key() const |
|
149 { |
|
150 return KSettingsVTVideoSending; |
|
151 } |
|
152 // TVtUiToolbarVariation |
|
153 // ----------------------------------------------------------------------------- |
|
154 // TVtUiToolbarVariation::NumberOfButtons |
|
155 // ----------------------------------------------------------------------------- |
|
156 // |
|
157 TUint32 TVtUiToolbarVariation::NumberOfButtons() |
|
158 { |
|
159 __VTPRINTENTER( "VtUi.LocalVariation.Tb.NumberOfButtons" ) |
|
160 TRAP_IGNORE( ReadL( KNumberOfTbButtons ) ); |
|
161 __VTPRINTEXIT( "VtUi.LocalVariation.Tb.NumberOfButtons" ) |
|
162 return ReceiveValue(); |
|
163 } |
|
164 // ----------------------------------------------------------------------------- |
|
165 // TVtUiToolbarVariation::Uid |
|
166 // ----------------------------------------------------------------------------- |
|
167 // |
|
168 const TUid& TVtUiToolbarVariation::Uid() const |
|
169 { |
|
170 return KCRUidVTConfiguration; |
|
171 } |
|
172 |
|
173 // ----------------------------------------------------------------------------- |
|
174 // TVtUiActiveIdleVariation::Key |
|
175 // ----------------------------------------------------------------------------- |
|
176 // |
|
177 TUint32 TVtUiToolbarVariation::Key() const |
|
178 { |
|
179 return KVTToolbarCommands; |
|
180 } |
|
181 |