|
1 /* |
|
2 * Copyright (c) 2009 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 // INCLUDE FILES |
|
20 #include <aknconfgesture.rsg> |
|
21 #include <akntextsettingpage.h> |
|
22 #include <centralrepository.h> |
|
23 |
|
24 #include "aknconfsettingitem.h" |
|
25 #include "aknconfgesturesettinglist.h" |
|
26 #include "aknconf.hrh" |
|
27 #include "akntouchgesturefwcrkeys.h" |
|
28 |
|
29 _LIT( KResourceFile, "\\resource\\apps\\aknconfgesture.rsc" ); |
|
30 |
|
31 // ============================ MEMBER FUNCTIONS =============================== |
|
32 |
|
33 // ----------------------------------------------------------------------------- |
|
34 // CAknConfGestureSettingList::NewL() |
|
35 // ----------------------------------------------------------------------------- |
|
36 // |
|
37 CAknConfGestureSettingList* CAknConfGestureSettingList::NewL() |
|
38 { |
|
39 CAknConfGestureSettingList* self = new ( ELeave ) CAknConfGestureSettingList(); |
|
40 CleanupStack::PushL( self ); |
|
41 self->ConstructL(); |
|
42 CleanupStack::Pop( self ); |
|
43 return self; |
|
44 } |
|
45 |
|
46 |
|
47 // ----------------------------------------------------------------------------- |
|
48 // CAknConfGestureSettingList::~CAknConfGestureSettingList() |
|
49 // ----------------------------------------------------------------------------- |
|
50 // |
|
51 CAknConfGestureSettingList::~CAknConfGestureSettingList() |
|
52 { |
|
53 } |
|
54 |
|
55 |
|
56 // ----------------------------------------------------------------------------- |
|
57 // CAknConfGestureSettingList::ResetValues() |
|
58 // ----------------------------------------------------------------------------- |
|
59 // |
|
60 void CAknConfGestureSettingList::ResetValues() |
|
61 { |
|
62 if ( iCenRep ) |
|
63 { |
|
64 iCenRep->Reset(); |
|
65 TInt cenRepKey( -1 ); |
|
66 ValueFromCenRep( EAknConfGestureSettingFlickBuffer, cenRepKey ); |
|
67 ValueFromCenRep( EAknConfGestureSettingTapThreshold, cenRepKey ); |
|
68 ValueFromCenRep( EAknConfGestureSettingLongTapThreshold, cenRepKey ); |
|
69 ValueFromCenRep( EAknConfGestureSettingDoubleTapThreshold, cenRepKey ); |
|
70 ValueFromCenRep( EAknConfGestureSettingDragThreshold, cenRepKey ); |
|
71 ValueFromCenRep( EAknConfGestureSettingFlickSpeedThreshold, cenRepKey ); |
|
72 ValueFromCenRep( EAknConfGestureSettingFlickDetectionTime, cenRepKey ); |
|
73 ValueFromCenRep( EAknConfGestureSettingFlickDirectionChange, cenRepKey ); |
|
74 ValueFromCenRep( EAknConfGestureSettingPinchInitialThreshold, cenRepKey ); |
|
75 ValueFromCenRep( EAknConfGestureSettingPinchMovementThreshold, cenRepKey ); |
|
76 ValueFromCenRep( |
|
77 EAknConfGestureSettingPinchDirectionChangeSensitivity, |
|
78 cenRepKey ); |
|
79 ValueFromCenRep( |
|
80 EAknConfGestureSettingPinchDirectionResetSensitivity, |
|
81 cenRepKey ); |
|
82 ValueFromCenRep( |
|
83 EAknConfGestureSettingPinchDimensionThreshold, |
|
84 cenRepKey ); |
|
85 ValueFromCenRep( |
|
86 EAknConfGestureSettingPinchMaximumConfirmationDuration, |
|
87 cenRepKey ); |
|
88 |
|
89 TRAP_IGNORE( LoadSettingsL() ); |
|
90 DrawDeferred(); |
|
91 } |
|
92 } |
|
93 |
|
94 |
|
95 // ----------------------------------------------------------------------------- |
|
96 // CAknConfGestureSettingList::CAknConfGestureSettingList() |
|
97 // ----------------------------------------------------------------------------- |
|
98 // |
|
99 CAknConfGestureSettingList::CAknConfGestureSettingList() |
|
100 : |
|
101 CAknConfSettingList(), |
|
102 iTapThreshold( 0 ), |
|
103 iLongTapThreshold( 0 ), |
|
104 iDoubleTapThreshold( 0 ), |
|
105 iDragThreshold( 0 ), |
|
106 iFlickBuffer( 0 ), |
|
107 iFlickSpeedThreshold( 0 ), |
|
108 iFlickDetectionTime( 0 ), |
|
109 iFlickChangeSensitivity( 0 ), |
|
110 iPinchInitialThreshold( 0 ), |
|
111 iPinchMovementThreshold( 0 ), |
|
112 iPinchDirectionChangeSensitivity( 0 ), |
|
113 iPinchDirectionResetSensitivity( 0 ), |
|
114 iPinchDimensionThreshold( 0 ), |
|
115 iPinchMaximumConfirmationDuration( 0 ) |
|
116 { |
|
117 } |
|
118 |
|
119 |
|
120 // ----------------------------------------------------------------------------- |
|
121 // CAknConfGestureSettingList::ConstructL() |
|
122 // ----------------------------------------------------------------------------- |
|
123 // |
|
124 void CAknConfGestureSettingList::ConstructL() |
|
125 { |
|
126 CAknConfSettingList::ConstructL( |
|
127 KCRUidAknTouchGestureFwSettings, KResourceFile ); |
|
128 CAknConfSettingList::ConstructFromResourceL( |
|
129 R_AKNCONF_GESTURE_SETTINGITEMLIST ); |
|
130 } |
|
131 |
|
132 |
|
133 // ----------------------------------------------------------------------------- |
|
134 // CAknConfGestureSettingList::DataValuePointer() |
|
135 // ----------------------------------------------------------------------------- |
|
136 // |
|
137 TInt* CAknConfGestureSettingList::DataValuePointer( const TInt& aId, TInt& aCenRepKey ) |
|
138 { |
|
139 TInt* valuePtr( NULL ); |
|
140 switch ( aId ) |
|
141 { |
|
142 case EAknConfGestureSettingTapThreshold: |
|
143 valuePtr = &iTapThreshold; |
|
144 aCenRepKey = KTapThreshold; |
|
145 break; |
|
146 case EAknConfGestureSettingLongTapThreshold: |
|
147 valuePtr = &iLongTapThreshold; |
|
148 aCenRepKey = KLongTapThreshold; |
|
149 break; |
|
150 case EAknConfGestureSettingDoubleTapThreshold: |
|
151 valuePtr = &iDoubleTapThreshold; |
|
152 aCenRepKey = KDoubleTapMaximumDuration; |
|
153 break; |
|
154 case EAknConfGestureSettingDragThreshold: |
|
155 valuePtr = &iDragThreshold; |
|
156 aCenRepKey = KDragThreshold; |
|
157 break; |
|
158 case EAknConfGestureSettingFlickBuffer: |
|
159 valuePtr = &iFlickBuffer; |
|
160 aCenRepKey = KFlickBuffer; |
|
161 break; |
|
162 case EAknConfGestureSettingFlickSpeedThreshold: |
|
163 valuePtr = &iFlickSpeedThreshold; |
|
164 aCenRepKey = KFlickSpeedThreshold; |
|
165 break; |
|
166 case EAknConfGestureSettingFlickDetectionTime: |
|
167 valuePtr = &iFlickDetectionTime; |
|
168 aCenRepKey = KFlickDetectionTime; |
|
169 break; |
|
170 case EAknConfGestureSettingFlickDirectionChange: |
|
171 valuePtr = &iFlickChangeSensitivity; |
|
172 aCenRepKey = KFlickDirectionChange; |
|
173 break; |
|
174 case EAknConfGestureSettingPinchInitialThreshold: |
|
175 valuePtr = &iPinchInitialThreshold; |
|
176 aCenRepKey = KPinchInitialThreshold; |
|
177 break; |
|
178 case EAknConfGestureSettingPinchMovementThreshold: |
|
179 valuePtr = &iPinchMovementThreshold; |
|
180 aCenRepKey = KPinchMovementThreshold; |
|
181 break; |
|
182 case EAknConfGestureSettingPinchDirectionChangeSensitivity: |
|
183 valuePtr = &iPinchDirectionChangeSensitivity; |
|
184 aCenRepKey = KPinchDirectionChangeSensitivity; |
|
185 break; |
|
186 case EAknConfGestureSettingPinchDirectionResetSensitivity: |
|
187 valuePtr = &iPinchDirectionResetSensitivity; |
|
188 aCenRepKey = KPinchDirectionResetSensitivity; |
|
189 break; |
|
190 case EAknConfGestureSettingPinchDimensionThreshold: |
|
191 valuePtr = &iPinchDimensionThreshold; |
|
192 aCenRepKey = KPinchDimensionThreshold; |
|
193 break; |
|
194 case EAknConfGestureSettingPinchMaximumConfirmationDuration: |
|
195 valuePtr = &iPinchMaximumConfirmationDuration; |
|
196 aCenRepKey = KPinchMaximumConfirmationDuration; |
|
197 break; |
|
198 default: |
|
199 break; |
|
200 } |
|
201 return valuePtr; |
|
202 } |
|
203 |
|
204 // End of File |