|
1 /* |
|
2 * Copyright (c) 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: Active Palette model observers* |
|
15 */ |
|
16 |
|
17 |
|
18 /** |
|
19 * @file ActivePalette2ModelObserver.h |
|
20 * Active Palette model observers |
|
21 */ |
|
22 |
|
23 #ifndef _ACTIVE_PALETTE_2_MODEL_OBSERVER_H |
|
24 #define _ACTIVE_PALETTE_2_MODEL_OBSERVER_H |
|
25 |
|
26 class CActivePalette2Item; |
|
27 class MActivePalette2Observer; |
|
28 |
|
29 |
|
30 /** |
|
31 * Model observer interface. Used by the model to update the renderer. |
|
32 */ |
|
33 class MActivePalette2ModelObserver |
|
34 { |
|
35 public: |
|
36 /** |
|
37 * Called when a new tooltip is about to be shown for the first time. This allows the renderer |
|
38 * to pre-render the tooltip if necessary |
|
39 * @return The width, in pixels, of the entire tooltip |
|
40 */ |
|
41 virtual TInt TooltipUpdated() = 0; |
|
42 |
|
43 /** |
|
44 * Called when the items have been updated. |
|
45 */ |
|
46 virtual void ItemsUpdated() = 0; |
|
47 |
|
48 /** |
|
49 * Called when the palette-appearance animation needs to be updated |
|
50 */ |
|
51 virtual void PaletteAppearingUpdated() = 0; |
|
52 |
|
53 /** |
|
54 * Called when an item animation needs to be updated |
|
55 * @param aScreenPos The screen position of the item |
|
56 * @param aItem pointer to the item object |
|
57 * @param aAnimFrame The frame to be displayed |
|
58 */ |
|
59 virtual void ItemAnimated(TInt aScreenPos, CActivePalette2Item* aItem, TInt aAnimFrame) = 0; |
|
60 |
|
61 /** |
|
62 * Called when an item's animation is complete |
|
63 * @param aScreenPos The screen position of the item |
|
64 * @param aItem pointer to the item object |
|
65 */ |
|
66 virtual void ItemAnimationComplete(TInt aScreenPos, CActivePalette2Item* aItem) = 0; |
|
67 |
|
68 /** |
|
69 * Called when a tooltip should appear or disappear |
|
70 */ |
|
71 virtual void ShowTooltipUpdated() = 0; |
|
72 |
|
73 /** |
|
74 * Should return the currently registered observer, or NULL if none. |
|
75 * @return The AP observer |
|
76 */ |
|
77 virtual MActivePalette2Observer* APObserver() const = 0; |
|
78 }; |
|
79 |
|
80 |
|
81 /** |
|
82 * Timer-style callbacks for tooltip animation |
|
83 */ |
|
84 class MActivePalette2TooltipTimerObserver |
|
85 { |
|
86 public: |
|
87 /** |
|
88 * Called when the tooltip animation needs to be updated |
|
89 */ |
|
90 virtual void TooltipAnimated() = 0; |
|
91 }; |
|
92 |
|
93 |
|
94 /** |
|
95 * Timer-style callbacks for focus-change animation |
|
96 */ |
|
97 class MActivePalette2FocusTimerObserver |
|
98 { |
|
99 public: |
|
100 /** |
|
101 * Called when a new item has been focused |
|
102 */ |
|
103 virtual void FocusUpdated() = 0; |
|
104 |
|
105 /** |
|
106 * Called when the focus-change animation needs to be updated |
|
107 */ |
|
108 virtual void FocusAnimated() = 0; |
|
109 }; |
|
110 |
|
111 |
|
112 /** |
|
113 * Timer-style callbacks for item-scroll animation |
|
114 */ |
|
115 class MActivePalette2ItemScrollTimerObserver |
|
116 { |
|
117 public: |
|
118 /** |
|
119 * Called when an item-scroll animation needs to be updated |
|
120 */ |
|
121 virtual void ItemsScrolled() = 0; |
|
122 }; |
|
123 |
|
124 |
|
125 /** |
|
126 * Timer-style callbacks for appearance animation |
|
127 */ |
|
128 class MActivePalette2AppearanceTimerObserver |
|
129 { |
|
130 public: |
|
131 /** |
|
132 * Called when the palette-appearance animation needs to be updated |
|
133 */ |
|
134 virtual void PaletteAppearingAnimated() = 0; |
|
135 }; |
|
136 |
|
137 |
|
138 /** |
|
139 * Descriptive-style callbacks for tooltip animation |
|
140 */ |
|
141 class MActivePalette2TooltipDescriptiveObserver |
|
142 { |
|
143 public: |
|
144 /** |
|
145 * Called when a tooltip animation is required |
|
146 * @param aToShow If ETrue, the tooltip should be fully shown at the end of the animation; if EFalse, it should |
|
147 * be fully hidden |
|
148 * @param aTimeInMilliseconds The length of time the animation should take, in milliseconds |
|
149 * @see CActivePalette2Model::AnimateTooltipRendererComplete |
|
150 */ |
|
151 virtual void AnimateTooltip(TBool aToShow, TInt aTimeInMilliseconds) = 0; |
|
152 }; |
|
153 |
|
154 |
|
155 /** |
|
156 * Descriptive-style callbacks for focus-change animation |
|
157 */ |
|
158 class MActivePalette2FocusDescriptiveObserver |
|
159 { |
|
160 public: |
|
161 /** |
|
162 * Called when a focus-change animation is required |
|
163 * @param aCurrentPos The screen position to start from |
|
164 * @param aTargetPos The destination screen position |
|
165 * @param aTimeInMilliseconds The duration of the animation, in milliseconds |
|
166 * @see CActivePalette2Model::AnimateFocusRendererComplete() |
|
167 */ |
|
168 virtual void AnimateFocus(TInt aCurrentPos, TInt aTargetPos, TInt aTimeInMilliseconds) = 0; |
|
169 }; |
|
170 |
|
171 |
|
172 /** |
|
173 * Descriptive-style callbacks for item-scroll animation |
|
174 */ |
|
175 class MActivePalette2ItemScrollDescriptiveObserver |
|
176 { |
|
177 public: |
|
178 /** |
|
179 * Called when an item-scroll animation is required |
|
180 * @param aDirection +1 to move the items downwards, -1 to move them upwards |
|
181 * @param aTimeInMilliseconds The length of time the animation should take, in milliseconds |
|
182 * @see CActivePalette2Model::AnimateItemScrollRendererComplete |
|
183 */ |
|
184 virtual void AnimateItemScroll(TInt aDirection, TInt aTimeInMilliseconds) = 0; |
|
185 }; |
|
186 |
|
187 |
|
188 /** |
|
189 * Descriptive-style callbacks for appearance animation |
|
190 */ |
|
191 class MActivePalette2AppearanceDescriptiveObserver |
|
192 { |
|
193 public: |
|
194 /** |
|
195 * Called when a palette-appearance animation is required |
|
196 * @param aVisible The target state |
|
197 * @param aTimeInMilliseconds The duration of the animation, in milliseconds |
|
198 * @see CActivePalette2Model::AnimateAppearanceRendererComplete() |
|
199 */ |
|
200 virtual void AnimateAppearance(TBool aVisible, TInt aTimeInMilliseconds) = 0; |
|
201 |
|
202 /** |
|
203 * Asks the implementing renderer to estimate where the appearance animation is up to |
|
204 * @return The frame number, in relation to CActivePalette2Model::PaletteAppearingTotalFrames() |
|
205 */ |
|
206 virtual TInt GuessCurrentAppearanceFrame() = 0; |
|
207 }; |
|
208 |
|
209 #endif //_ACTIVE_PALETTE_2_MODEL_OBSERVER_H |