|
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: Mapping function handlers |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef T_ALFMAPPINGFUNCTIONHANDLERS_H |
|
21 #define T_ALFMAPPINGFUNCTIONHANDLERS_H |
|
22 |
|
23 #include "alf/alfextensionfactory.h" |
|
24 #include <alf/alfconstants.h> |
|
25 #include <uiacceltk/HuiMappingFunctions.h> |
|
26 |
|
27 class CHuiCurvePath; |
|
28 |
|
29 /** |
|
30 * Average mapping function |
|
31 * |
|
32 * @since S60 v3.2 |
|
33 */ |
|
34 NONSHARABLE_CLASS(TAlfAverageMappingFunctionHandler): public MAlfExtension |
|
35 { |
|
36 public: |
|
37 |
|
38 TAlfAverageMappingFunctionHandler( |
|
39 MAlfInterfaceProvider& aResolver, |
|
40 MHuiMappingFunction* aFunc1 = 0, |
|
41 MHuiMappingFunction* aFunc2 = 0 ); |
|
42 |
|
43 void Release(); |
|
44 TAny* GetInterface(const THuiInterfaceSupport& aInterface); |
|
45 void HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse); |
|
46 |
|
47 private: |
|
48 THuiAverageMappingFunction iAverageMappingFunction; |
|
49 MAlfInterfaceProvider& iResolver; |
|
50 }; |
|
51 |
|
52 /** |
|
53 * Constant mapping function |
|
54 * |
|
55 * @since S60 v3.2 |
|
56 */ |
|
57 NONSHARABLE_CLASS(TAlfConstantMappingFunctionHandler): public MAlfExtension |
|
58 { |
|
59 public: |
|
60 |
|
61 TAlfConstantMappingFunctionHandler( |
|
62 MAlfInterfaceProvider& aResolver, |
|
63 TReal32 aValue ); |
|
64 |
|
65 void Release(); |
|
66 TAny* GetInterface(const THuiInterfaceSupport& aInterface); |
|
67 void HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse); |
|
68 |
|
69 private: |
|
70 THuiConstantMappingFunction iConstantMappingFunction; |
|
71 MAlfInterfaceProvider& iResolver; |
|
72 }; |
|
73 |
|
74 /** |
|
75 * Linear mapping function |
|
76 * |
|
77 * @since S60 v3.2 |
|
78 */ |
|
79 NONSHARABLE_CLASS(TAlfLinearMappingFunctionHandler): public MAlfExtension |
|
80 { |
|
81 public: |
|
82 |
|
83 TAlfLinearMappingFunctionHandler( |
|
84 MAlfInterfaceProvider& aResolver, |
|
85 TReal32 aFactor = 1.0, |
|
86 TReal32 aOffset = 0.0 ); |
|
87 |
|
88 void Release(); |
|
89 TAny* GetInterface(const THuiInterfaceSupport& aInterface); |
|
90 void HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse); |
|
91 |
|
92 private: |
|
93 THuiLinearMappingFunction iLinearMappingFunction; |
|
94 MAlfInterfaceProvider& iResolver; |
|
95 }; |
|
96 |
|
97 /** |
|
98 * Sine mapping function |
|
99 * |
|
100 * @since S60 v3.2 |
|
101 */ |
|
102 NONSHARABLE_CLASS(TAlfSineMappingFunctionHandler): public MAlfExtension |
|
103 { |
|
104 public: |
|
105 |
|
106 TAlfSineMappingFunctionHandler( |
|
107 MAlfInterfaceProvider& aResolver, |
|
108 TReal32 aFactor = 1.0, |
|
109 TReal32 aOffset = 0.0 ); |
|
110 |
|
111 void Release(); |
|
112 TAny* GetInterface(const THuiInterfaceSupport& aInterface); |
|
113 void HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse); |
|
114 |
|
115 private: |
|
116 THuiSineMappingFunction iSineMappingFunction; |
|
117 MAlfInterfaceProvider& iResolver; |
|
118 }; |
|
119 |
|
120 /** |
|
121 * Cosine mapping function |
|
122 * |
|
123 * @since S60 v3.2 |
|
124 */ |
|
125 NONSHARABLE_CLASS(TAlfCosineMappingFunctionHandler): public MAlfExtension |
|
126 { |
|
127 public: |
|
128 |
|
129 TAlfCosineMappingFunctionHandler( |
|
130 MAlfInterfaceProvider& aResolver, |
|
131 TReal32 aFactor = 1.0, |
|
132 TReal32 aOffset = 0.0 ); |
|
133 |
|
134 void Release(); |
|
135 TAny* GetInterface(const THuiInterfaceSupport& aInterface); |
|
136 void HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse); |
|
137 |
|
138 private: |
|
139 THuiCosineMappingFunction iCosineMappingFunction; |
|
140 MAlfInterfaceProvider& iResolver; |
|
141 }; |
|
142 |
|
143 /** |
|
144 * Curve path |
|
145 * |
|
146 * @since S60 v3.2 |
|
147 */ |
|
148 NONSHARABLE_CLASS(CAlfCurvePathHandler): public CBase, public MAlfExtension |
|
149 { |
|
150 public: |
|
151 |
|
152 static CAlfCurvePathHandler* NewL( |
|
153 MAlfInterfaceProvider& aResolver, |
|
154 CHuiCurvePath* aCurvePath = 0 ); |
|
155 ~CAlfCurvePathHandler(); |
|
156 |
|
157 void Release(); |
|
158 TAny* GetInterface(const THuiInterfaceSupport& aInterface); |
|
159 void HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse); |
|
160 |
|
161 private: |
|
162 CAlfCurvePathHandler( MAlfInterfaceProvider& aResolver ); |
|
163 void ConstructL(CHuiCurvePath* aCurvePath); |
|
164 |
|
165 private: |
|
166 MAlfInterfaceProvider& iResolver; |
|
167 CHuiCurvePath* iCurvePath; |
|
168 TBool iOwnCurvePath; |
|
169 }; |
|
170 |
|
171 /** |
|
172 * Table mapping function |
|
173 * |
|
174 * @since S60 v3.2 |
|
175 */ |
|
176 NONSHARABLE_CLASS(TAlfTableMappingFunction): public MHuiMappingFunction |
|
177 { |
|
178 public: |
|
179 |
|
180 /** |
|
181 * Constructor. |
|
182 */ |
|
183 TAlfTableMappingFunction(); |
|
184 |
|
185 /* implements MHuiMappingFunction */ |
|
186 TReal32 MapValue(TReal32 aValue, TInt aComponent) const __SOFTFP; |
|
187 |
|
188 public: |
|
189 |
|
190 TAlfTableMappingFunctionParams iParams; |
|
191 }; |
|
192 |
|
193 |
|
194 NONSHARABLE_CLASS(TAlfTableMappingFunctionHandler): public MAlfExtension |
|
195 { |
|
196 public: |
|
197 |
|
198 TAlfTableMappingFunctionHandler(MAlfInterfaceProvider& aResolver); |
|
199 |
|
200 void Release(); |
|
201 TAny* GetInterface(const THuiInterfaceSupport& aInterface); |
|
202 void HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse); |
|
203 |
|
204 private: |
|
205 TAlfTableMappingFunction iMappingFunction; |
|
206 MAlfInterfaceProvider& iResolver; |
|
207 }; |
|
208 |
|
209 |
|
210 |
|
211 #endif // T_ALFMAPPINGFUNCTIONHANDLERS_H |