|
1 /* |
|
2 * Copyright (c) 2006-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: ?Description |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #include "uiacceltk/HuiTimedPoint.h" // Class definition |
|
21 #include "uiacceltk/HuiUtil.h" |
|
22 |
|
23 EXPORT_C THuiTimedPoint::THuiTimedPoint() |
|
24 { |
|
25 iX.SetMappingMode(0); |
|
26 iY.SetMappingMode(1); |
|
27 } |
|
28 |
|
29 |
|
30 EXPORT_C THuiTimedPoint::THuiTimedPoint(TReal32 aX, TReal32 aY) __SOFTFP |
|
31 : iX(aX), iY(aY) |
|
32 { |
|
33 iX.SetMappingMode(0); |
|
34 iY.SetMappingMode(1); |
|
35 } |
|
36 |
|
37 |
|
38 EXPORT_C void THuiTimedPoint::SetStyle(THuiInterpolationStyle aStyle) |
|
39 { |
|
40 iX.SetStyle(aStyle); |
|
41 iY.SetStyle(aStyle); |
|
42 } |
|
43 |
|
44 |
|
45 EXPORT_C void THuiTimedPoint::SetFunction(MHuiMappingFunction* aFunction) |
|
46 { |
|
47 // Both use the same function, but the components are different. |
|
48 iX.SetFunction(aFunction); |
|
49 iY.SetFunction(aFunction); |
|
50 } |
|
51 |
|
52 |
|
53 EXPORT_C void THuiTimedPoint::Set(const THuiRealPoint& aPoint, |
|
54 TInt aTransitionTime) |
|
55 { |
|
56 iX.Set(aPoint.iX, aTransitionTime); |
|
57 iY.Set(aPoint.iY, aTransitionTime); |
|
58 } |
|
59 |
|
60 |
|
61 EXPORT_C void THuiTimedPoint::SetWithSpeed(const THuiRealPoint& aPoint, |
|
62 TReal32 aUnitsPerSecond) __SOFTFP |
|
63 { |
|
64 iX.SetWithSpeed(aPoint.iX, aUnitsPerSecond); |
|
65 iY.SetWithSpeed(aPoint.iY, aUnitsPerSecond); |
|
66 } |
|
67 |
|
68 |
|
69 EXPORT_C void THuiTimedPoint::Set(TReal32 aValue, TInt aTransitionTime) __SOFTFP |
|
70 { |
|
71 iX.Set(aValue, aTransitionTime); |
|
72 iY.Set(aValue, aTransitionTime); |
|
73 } |
|
74 |
|
75 |
|
76 EXPORT_C void THuiTimedPoint::SetWithSpeed(TReal32 aValue, TReal32 aUnitsPerSecond) __SOFTFP |
|
77 { |
|
78 iX.SetWithSpeed(aValue, aUnitsPerSecond); |
|
79 iY.SetWithSpeed(aValue, aUnitsPerSecond); |
|
80 } |
|
81 |
|
82 |
|
83 EXPORT_C TPoint THuiTimedPoint::Now() const |
|
84 { |
|
85 // NOTE! the THuiTimeValue Now() and Target() return floating point values |
|
86 // Round these floating point values to closest integer values |
|
87 return TPoint(HUI_ROUND_FLOAT_TO_INT(iX.Now()), HUI_ROUND_FLOAT_TO_INT(iY.Now())); |
|
88 } |
|
89 |
|
90 |
|
91 EXPORT_C THuiRealPoint THuiTimedPoint::RealNow() const __SOFTFP |
|
92 { |
|
93 // NOTE! the THuiTimeValue Now() and Target() return floating point values |
|
94 return THuiRealPoint(iX.Now(), iY.Now()); |
|
95 } |
|
96 |
|
97 |
|
98 EXPORT_C TPoint THuiTimedPoint::Target() const |
|
99 { |
|
100 // NOTE! the THuiTimeValue Now() and Target() return floating point values |
|
101 // Round these floating point values to closest integer values |
|
102 return TPoint(HUI_ROUND_FLOAT_TO_INT(iX.Target()), HUI_ROUND_FLOAT_TO_INT(iY.Target())); |
|
103 } |
|
104 |
|
105 |
|
106 EXPORT_C THuiRealPoint THuiTimedPoint::RealTarget() const __SOFTFP |
|
107 { |
|
108 return THuiRealPoint(iX.Target(), iY.Target()); |
|
109 } |
|
110 |
|
111 |
|
112 EXPORT_C void THuiTimedPoint::Finish() |
|
113 { |
|
114 iX.Finish(); |
|
115 iY.Finish(); |
|
116 } |
|
117 |
|
118 |
|
119 TBool THuiTimedPoint::Changed() const |
|
120 { |
|
121 return iX.Changed() || iY.Changed(); |
|
122 } |
|
123 |
|
124 |
|
125 void THuiTimedPoint::ClearChanged() |
|
126 { |
|
127 iX.ClearChanged(); |
|
128 iY.ClearChanged(); |
|
129 } |