|
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 CSAnimImagePlugin class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef SANIMIMAGEPLUGIN_H |
|
20 #define SANIMIMAGEPLUGIN_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <gdi.h> |
|
24 #include "sanimobserver.h" |
|
25 #include "sanimplugin.h" |
|
26 |
|
27 /** |
|
28 * Base class for all Startup Image plug-in implementations. |
|
29 * ECom interface UID for Start-up Image Plug-in API is 0x2000B118. |
|
30 * |
|
31 * @lib None |
|
32 * @since S60 3.2 |
|
33 */ |
|
34 class CSAnimImagePlugin : public CSAnimPlugin |
|
35 { |
|
36 |
|
37 protected: |
|
38 |
|
39 /** |
|
40 * Constructor. |
|
41 * |
|
42 * @param aConstructionParameters Construction parameters from ECom. |
|
43 * May NOT be NULL. |
|
44 * |
|
45 * Implement a factory method with this signature, and give the parameter |
|
46 * to this constructor. |
|
47 * |
|
48 * Example: |
|
49 * |
|
50 * CMyImagePlugIn* CMyImagePlugIn::NewL( TAny* aConstructionParameters ) |
|
51 * { |
|
52 * CMyImagePlugIn* self = |
|
53 * new( ELeave ) CMyImagePlugIn( aConstructionParameters ); |
|
54 * CleanupStack::PushL( self ); |
|
55 * self->ConstructL(); |
|
56 * CleanupStack::Pop( self ); |
|
57 * return self; |
|
58 * } |
|
59 * |
|
60 * CMyImagePlugIn::CMyImagePlugIn( TAny* aConstructionParameters ) |
|
61 * : CSAnimImagePlugin( aConstructionParameters ) |
|
62 * { |
|
63 * } |
|
64 */ |
|
65 IMPORT_C CSAnimImagePlugin( TAny* aConstructionParameters ); |
|
66 |
|
67 public: |
|
68 |
|
69 /** |
|
70 * Set requested display mode. |
|
71 * |
|
72 * @since S60 3.2 |
|
73 * |
|
74 * @param aDisplayMode Display mode to use, if supported by the image. |
|
75 */ |
|
76 IMPORT_C void SetDisplayMode( const TDisplayMode aDisplayMode ); |
|
77 |
|
78 /** |
|
79 * Set requested size for the image. If the image is scalable, it will be |
|
80 * scaled as near this size as possible. |
|
81 * |
|
82 * @since S60 3.2 |
|
83 * |
|
84 * @param aSize Requested size for the image. |
|
85 */ |
|
86 IMPORT_C void SetSize( const TSize& aSize ); |
|
87 |
|
88 /** |
|
89 * Set frame delay for the animation. The same value is used for all the |
|
90 * frames in the animation. The value is only used if frame delays are not |
|
91 * specified in the animation file. |
|
92 * |
|
93 * @since S60 3.2 |
|
94 * |
|
95 * @param aFrameDelay Frame delay to use. |
|
96 */ |
|
97 IMPORT_C void SetFrameDelay( const TTimeIntervalMicroSeconds32& aFrameDelay ); |
|
98 |
|
99 /** |
|
100 * Set scaling enabled/disabled for the animation. |
|
101 * The setting has only effect for those image formats for which scaling |
|
102 * can be enabled/disabled. |
|
103 * |
|
104 * @since S60 3.2 |
|
105 * |
|
106 * @param aEnable Indicates whether scaling should be enabled or disabled. |
|
107 */ |
|
108 IMPORT_C void SetScalingEnabled( const TBool aEnable ); |
|
109 |
|
110 /** |
|
111 * Get the backgroud colour of the image. |
|
112 * Should only be called after successfully loading the image. |
|
113 * |
|
114 * @since S60 3.2 |
|
115 * |
|
116 * @return The backgroud colour requested for the image. |
|
117 */ |
|
118 virtual TRgb BackroundColour() const = 0; |
|
119 |
|
120 private: |
|
121 |
|
122 /** Default constructor. */ |
|
123 CSAnimImagePlugin(); |
|
124 /** Copy constructor. */ |
|
125 CSAnimImagePlugin( const CSAnimImagePlugin& ); |
|
126 /** Assignment operator. */ |
|
127 CSAnimImagePlugin& operator=( const CSAnimImagePlugin& ); |
|
128 |
|
129 protected: // data |
|
130 |
|
131 /** Observer for animation events. */ |
|
132 MSAnimObserver& iObserver; |
|
133 |
|
134 /** Display mode to use, if supported by the image. */ |
|
135 TDisplayMode iDisplayMode; |
|
136 |
|
137 /** Requested size of the image. */ |
|
138 TSize iSize; |
|
139 |
|
140 /** |
|
141 * Frame delay for animation, unless specified in the animation file itself. |
|
142 */ |
|
143 TTimeIntervalMicroSeconds32 iFrameDelay; |
|
144 |
|
145 TAny* iReserved1; /** Reserved for future use. */ |
|
146 TAny* iReserved2; /** Reserved for future use. */ |
|
147 |
|
148 /** If ETrue, try to scale the image to fit the screen if possible. */ |
|
149 TBool iScalingEnabled; |
|
150 |
|
151 TInt iReserved4; /** Reserved for future use. */ |
|
152 |
|
153 }; |
|
154 |
|
155 #endif // SANIMIMAGEPLUGIN_H |