|
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: Declaration of CSAnimEngineImpl class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef SANIMENGINEIMPL_H |
|
20 #define SANIMENGINEIMPL_H |
|
21 |
|
22 #include "sanimengine.h" |
|
23 |
|
24 class CSAnimImagePlugin; |
|
25 class CSAnimPluginCtrl; |
|
26 class CSAnimTonePlugin; |
|
27 class RFs; |
|
28 |
|
29 /** |
|
30 * Start-up Animation Engine implementation class. |
|
31 * |
|
32 * @lib None |
|
33 * @since S60 3.2 |
|
34 */ |
|
35 NONSHARABLE_CLASS( CSAnimEngineImpl ) : public CSAnimEngine |
|
36 { |
|
37 |
|
38 public: |
|
39 |
|
40 /** |
|
41 * Constructor. |
|
42 * |
|
43 * @since S60 3.2 |
|
44 * |
|
45 * @param aFs Fileserver reference. |
|
46 * @param aObserver Observer for animation events.. |
|
47 */ |
|
48 CSAnimEngineImpl( RFs& aFs, MSAnimObserver& aObserver ); |
|
49 |
|
50 /** |
|
51 * Destructor. |
|
52 * |
|
53 * @since S60 3.2 |
|
54 */ |
|
55 virtual ~CSAnimEngineImpl(); |
|
56 |
|
57 /** |
|
58 * Call-back to be called when a plug-in completes its activity. |
|
59 * |
|
60 * @since S60 3.2 |
|
61 */ |
|
62 void PluginFinished(); |
|
63 |
|
64 protected: |
|
65 |
|
66 /** |
|
67 * Set the file name identifying the image / animation to show and other |
|
68 * properties that affect how the image / animation is shown. |
|
69 * From CSAnimEngine. |
|
70 * |
|
71 * @since S60 3.2 |
|
72 * |
|
73 * @param aImageFileName Identifies the image file to use. |
|
74 * @param aDisplayMode Display mode to use, if supported by the image. |
|
75 * @param aSize Requested size for the image. |
|
76 * @param aFrameDelay Frame delay to use. |
|
77 * @param aScalingEnabled Identifies whether to try to scale the image to fit |
|
78 * the screen size or just use the target size of the animation as it is. |
|
79 * @param aRepeatCount How many times to repeat the animation. |
|
80 * Zero indicates infinite. |
|
81 * @return KErrNone if file was found, a plug-in for the file type was found |
|
82 * and successfully loaded. One of the system-wide error codes otherwise. |
|
83 */ |
|
84 virtual TInt SetImageProperties( |
|
85 const TDesC& aImageFileName, |
|
86 const TDisplayMode aDisplayMode, |
|
87 const TSize& aSize, |
|
88 const TTimeIntervalMicroSeconds32& aFrameDelay, |
|
89 const TBool aScalingEnabled, |
|
90 const TInt aRepeatCount ); |
|
91 |
|
92 /** |
|
93 * Set the file name identifying the tone to play and other properties that |
|
94 * affect how the tone is played. |
|
95 * From CSAnimEngine. |
|
96 * |
|
97 * @since S60 3.2 |
|
98 * |
|
99 * @param aToneFileName Identifies the tone file to use. |
|
100 * @param aVolume Volume level to use. |
|
101 * @param aVolumeRamp Volume ramp: the period over which the volume level is |
|
102 * to rise smoothly from nothing to the normal volume level. |
|
103 * @param aRepeatCount How many times to repeat the tone. |
|
104 * Zero indicates infinite. |
|
105 * @return KErrNone if file was found, a plug-in for the file type was found |
|
106 * and successfully loaded. One of the system-wide error codes otherwise. |
|
107 */ |
|
108 virtual TInt SetToneProperties( |
|
109 const TDesC& aToneFileName, |
|
110 const TInt aVolume, |
|
111 const TTimeIntervalMicroSeconds& aVolumeRamp, |
|
112 const TInt aRepeatCount ); |
|
113 |
|
114 /** |
|
115 * Load the parts of the show (image/animation and/or tone) from file(s). |
|
116 * Completes immediately with KErrNone if the show has no parts. |
|
117 * From CSAnimEngine. |
|
118 * |
|
119 * @since S60 3.2 |
|
120 * |
|
121 * @param aStatus Request to complete when loading is complete. |
|
122 */ |
|
123 virtual void Load( TRequestStatus& aStatus ); |
|
124 |
|
125 /** |
|
126 * Get the backgroud colour of the image. |
|
127 * Should only be called after successfully loading the image. |
|
128 * From CSAnimEngine. |
|
129 * |
|
130 * @since S60 3.2 |
|
131 * |
|
132 * @return The backgroud colour requested for the image. |
|
133 */ |
|
134 virtual TRgb BackroundColour() const; |
|
135 |
|
136 /** |
|
137 * Start the show (image/animation and/or tone). |
|
138 * Completes immediately with KErrNone if the show has no parts. |
|
139 * From CSAnimEngine. |
|
140 * |
|
141 * @since S60 3.2 |
|
142 * |
|
143 * @param aStatus Request to complete when all parts of the show have |
|
144 * finished. |
|
145 */ |
|
146 virtual void Start( TRequestStatus& aStatus ); |
|
147 |
|
148 /** |
|
149 * Cancel activity. |
|
150 * From CSAnimEngine. |
|
151 * |
|
152 * @since S60 3.2 |
|
153 */ |
|
154 virtual void Cancel(); |
|
155 |
|
156 private: |
|
157 |
|
158 /** |
|
159 * Store client request status to member variable. |
|
160 * |
|
161 * @since S60 3.2 |
|
162 * |
|
163 * @param aStatus Request status from client. |
|
164 */ |
|
165 void SetClientRequest( TRequestStatus& aStatus ); |
|
166 |
|
167 /** |
|
168 * Set client request to pending state. |
|
169 * |
|
170 * @since S60 3.2 |
|
171 */ |
|
172 void SetRequestPending(); |
|
173 |
|
174 /** |
|
175 * Complete client request with the given status code. |
|
176 * |
|
177 * @since S60 3.2 |
|
178 * |
|
179 * @param aStatusCode KErrNone or one of Symbian error codes. |
|
180 */ |
|
181 void CompleteClientRequest( const TInt aStatusCode ); |
|
182 |
|
183 private: |
|
184 |
|
185 /** Copy constructor. */ |
|
186 CSAnimEngineImpl( const CSAnimEngineImpl& ); |
|
187 /** Assignment operator. */ |
|
188 CSAnimEngineImpl& operator=( const CSAnimEngineImpl& ); |
|
189 |
|
190 protected: // data |
|
191 |
|
192 /** File server session. */ |
|
193 RFs& iFs; |
|
194 |
|
195 /** Observer for animation events. */ |
|
196 MSAnimObserver& iObserver; |
|
197 |
|
198 /** Controller for the image plug-in. Owned. May be NULL. */ |
|
199 CSAnimPluginCtrl* iImagePluginCtrl; |
|
200 |
|
201 /** Controller for the tone plug-in. Owned. May be NULL. */ |
|
202 CSAnimPluginCtrl* iTonePluginCtrl; |
|
203 |
|
204 /** To be used to inform client about request completion. May be NULL. Not owned. */ |
|
205 TRequestStatus* iClientStatus; |
|
206 |
|
207 }; |
|
208 |
|
209 #endif // SANIMENGINEIMPL_H |