|
1 /* |
|
2 * Copyright (c) 2007-2008 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: Wrapper on top of THuiTimedValue to enable pause / resume |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef __SHWTIMEDVALUE_H__ |
|
22 #define __SHWTIMEDVALUE_H__ |
|
23 |
|
24 // Include Files |
|
25 #include <e32std.h> |
|
26 #include <alf/alftimedvalue.h> |
|
27 //#include <uiacceltk/huitimedpoint.h> |
|
28 |
|
29 /** |
|
30 * Wrapper class to enable pause and resume for timed values. |
|
31 * |
|
32 * @author Kimmo Hoikka |
|
33 * @lib shwslideshowengine.lib |
|
34 */ |
|
35 NONSHARABLE_CLASS( TShwTimedValue ) |
|
36 { |
|
37 public: // the API |
|
38 |
|
39 /** |
|
40 * Constructor, initializes value to zero |
|
41 */ |
|
42 inline TShwTimedValue(); |
|
43 |
|
44 /** |
|
45 * Sets the interpolation style |
|
46 * @param aStyle, @ref THuiInterpolationStyle |
|
47 */ |
|
48 inline void SetStyle( TAlfInterpolationStyle aStyle ); |
|
49 |
|
50 /** |
|
51 * Sets the value to be aValue now |
|
52 * @param aValue the target value |
|
53 */ |
|
54 inline void Set( TReal32 aValue ); |
|
55 |
|
56 /** |
|
57 * Sets the value to be aValue after the specified aTime |
|
58 * @param aValue the target value |
|
59 * @param aTime the target time for the value |
|
60 */ |
|
61 inline void Set( TReal32 aValue, TInt aTime ); |
|
62 |
|
63 /** |
|
64 * Return the current interpolated value. |
|
65 * @return the current value |
|
66 */ |
|
67 inline TReal32 Now(); |
|
68 |
|
69 /** |
|
70 * Return the target value. |
|
71 * @return the current value |
|
72 */ |
|
73 inline TReal32 Target(); |
|
74 |
|
75 /** |
|
76 * @return ETrue if the value has changed since last time |
|
77 */ |
|
78 inline TBool Changed() const; |
|
79 |
|
80 /** |
|
81 * Clears the changed flag |
|
82 */ |
|
83 inline void ClearChanged(); |
|
84 |
|
85 /** |
|
86 * Pauses the timed value |
|
87 */ |
|
88 inline void Pause(); |
|
89 |
|
90 /** |
|
91 * Resumes the timed value |
|
92 */ |
|
93 inline void Resume(); |
|
94 |
|
95 private: // Data |
|
96 |
|
97 TAlfTimedValue iTimedValue; |
|
98 TBool iPaused; |
|
99 TReal32 iTargetValue; |
|
100 TInt iRemainingTime; |
|
101 |
|
102 }; |
|
103 |
|
104 /** |
|
105 * Wrapper class to enable pause and resume for timed values |
|
106 */ |
|
107 NONSHARABLE_CLASS( TShwTimedSize ) |
|
108 { |
|
109 public: // the API |
|
110 |
|
111 /** |
|
112 * Constructor, initializes value to zero |
|
113 */ |
|
114 inline TShwTimedSize(); |
|
115 |
|
116 /** |
|
117 * Sets the interpolation style |
|
118 * @param aStyle, @ref THuiInterpolationStyle |
|
119 */ |
|
120 inline void SetStyle( TAlfInterpolationStyle aStyle ); |
|
121 |
|
122 /** |
|
123 * Sets the value to be aValue now |
|
124 * @param aValue the target value |
|
125 */ |
|
126 inline void Set( TAlfRealSize aValue ); |
|
127 |
|
128 /** |
|
129 * Sets the value to be aValue after the specified aTime |
|
130 * @param aValue the target value |
|
131 * @param aTime the target time for the value |
|
132 */ |
|
133 inline void Set( TAlfRealSize aValue, TInt aTime ); |
|
134 |
|
135 /** |
|
136 * Return the current interpolated value. |
|
137 * @return the current value |
|
138 */ |
|
139 inline TAlfRealSize Now(); |
|
140 |
|
141 /** |
|
142 * @return ETrue if the value has changed since last time |
|
143 */ |
|
144 inline TBool Changed() const; |
|
145 |
|
146 /** |
|
147 * Clears the changed flag |
|
148 */ |
|
149 inline void ClearChanged(); |
|
150 |
|
151 /** |
|
152 * Pauses the timed value |
|
153 */ |
|
154 inline void Pause(); |
|
155 |
|
156 /** |
|
157 * Resumes the timed value |
|
158 */ |
|
159 inline void Resume(); |
|
160 |
|
161 public: // Data |
|
162 |
|
163 TShwTimedValue iWidth; |
|
164 TShwTimedValue iHeight; |
|
165 |
|
166 }; |
|
167 |
|
168 #include "shwtimedvalue.inl" |
|
169 |
|
170 #endif // __SHWTIMEDVALUE_H__ |