|
1 /* |
|
2 * Copyright (c) 2006 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: MPX Screen Saver Plugin container |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_CMPXSCREENSAVERPLUGINCONTAINER_H |
|
20 #define C_CMPXSCREENSAVERPLUGINCONTAINER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include "mpxscreensaverplugin.hrh" |
|
24 |
|
25 // CLASS DECLARATION |
|
26 class CEikonEnv; |
|
27 class MAknsSkinInstance; |
|
28 class TAknsItemID; |
|
29 class MScreensaverPluginHost; |
|
30 class CEikLabel; |
|
31 |
|
32 /** |
|
33 * Screen saver plugin container for music player now playing view |
|
34 * @lib mpxscreensaverplugin.lib |
|
35 * @since 3.0 |
|
36 */ |
|
37 |
|
38 class CMPXScreenSaverPluginContainer: public CBase |
|
39 { |
|
40 public: |
|
41 /** |
|
42 * Default Constructor |
|
43 * @since 3.0 |
|
44 */ |
|
45 CMPXScreenSaverPluginContainer( MScreensaverPluginHost *aHost ); |
|
46 |
|
47 /** |
|
48 * 2nd phase constructor |
|
49 * @since 3.0 |
|
50 */ |
|
51 void ConstructL(); |
|
52 |
|
53 /** |
|
54 * Destructor. |
|
55 */ |
|
56 virtual ~CMPXScreenSaverPluginContainer(); |
|
57 |
|
58 public: |
|
59 /** |
|
60 * @param aGc window GC for drawing |
|
61 * @param aPlaybackState current play state |
|
62 * @since 3.0 |
|
63 */ |
|
64 virtual TInt DrawL( CWindowGc& aGc, TMPXPlaybackState aPlaybackState ); |
|
65 |
|
66 /** |
|
67 * Sets song properties |
|
68 * @since 3.0 |
|
69 */ |
|
70 void SetSongPropertiesL( const CMPXMedia& aMedia ); |
|
71 |
|
72 /** |
|
73 * Set parameter |
|
74 * @param aType parameter type |
|
75 * @param aValue parameter value |
|
76 */ |
|
77 void SetParam( MPXScreenSaverPluginParam aType, TInt aValue ); |
|
78 |
|
79 /** |
|
80 * Set profile name |
|
81 * |
|
82 * @param aName profile name |
|
83 * @param aDisplay ETrue to display the profile name, otherwise EFalse |
|
84 */ |
|
85 void SetProfileNameL( const TDesC& aName, TBool aDisplay ); |
|
86 |
|
87 /** |
|
88 * Called to get display info |
|
89 * @since 3.0 |
|
90 */ |
|
91 void RefreshDisplayInfo(); |
|
92 |
|
93 private: |
|
94 |
|
95 /** |
|
96 * Creates the icons. |
|
97 * |
|
98 * @since 3.0 |
|
99 * @return CGulIcon Indicator graphic and mask. Ownership |
|
100 * transferred to caller. |
|
101 */ |
|
102 void CreateIconsL(); |
|
103 |
|
104 /** |
|
105 * Create a color icon. |
|
106 * |
|
107 * @param aID skin id of the icon |
|
108 * @param aColorId Item ID of the color table. if KAknsIIDNone is used, the icon |
|
109 * created will use the original color specified in the file |
|
110 * @param aColorIndex Index in the color table. |
|
111 * @param aBitmapFilename Filename to be used to construct the item. |
|
112 * @param aFileBitmapId ID of the bitmap in the file. |
|
113 * @param aFileMaskId ID of the mask in the file. |
|
114 * @param aIsIndicator ETrue if it's an indicator, it'll change the icon color |
|
115 * to match other indicator's color. EFalse will not change |
|
116 * icon color |
|
117 */ |
|
118 CGulIcon* CreateIconL( |
|
119 const TAknsItemID& aID, |
|
120 const TAknsItemID& aColorId, |
|
121 TInt aColorIndex, |
|
122 const TDesC& aBitmapFilename, |
|
123 TInt aFileBitmapId, |
|
124 TInt aFileMaskId, |
|
125 TBool aIsIndicator ); |
|
126 |
|
127 /** |
|
128 * Load the backgrounds, and resize them to screen size |
|
129 * |
|
130 */ |
|
131 void LoadBackgroundsL(); |
|
132 |
|
133 /** |
|
134 * Draws the clock |
|
135 * @since 3.0 |
|
136 */ |
|
137 void DrawClockL( CBitmapContext& aGc ); |
|
138 |
|
139 /** |
|
140 * Draws background |
|
141 * @since 3.0 |
|
142 */ |
|
143 void DrawBackground( CBitmapContext& aGc, TInt aColorIndex ); |
|
144 |
|
145 /** |
|
146 * Draws playback information (playback status, song title) |
|
147 * @since 3.0 |
|
148 */ |
|
149 void DrawPlaybackStatusL( CBitmapContext& aGc, TMPXPlaybackState aPlaybackState ); |
|
150 |
|
151 /** |
|
152 * Draws indicators |
|
153 * @since 3.0 |
|
154 */ |
|
155 void DrawIndicatorsL( CBitmapContext& aGc ); |
|
156 |
|
157 /** |
|
158 * Draws indicators on offscreenbitmap |
|
159 * @since 3.0 |
|
160 */ |
|
161 void DoDrawIndicatorsL( CBitmapContext& aGc, |
|
162 TInt aDisplayNumber, CGulIcon* aDisplayIcon, |
|
163 CFont* aFont, TRect aRect, TSize aSize ); |
|
164 |
|
165 /** |
|
166 * Get layout data for an graphical indicator. |
|
167 * |
|
168 * @since 3.0 |
|
169 * @param aIndicator Enumeration value identifying the indicator |
|
170 * @return Layout data |
|
171 */ |
|
172 TRect IndicatorLayout( |
|
173 MPXScreenSaverPluginControl aControl ); |
|
174 |
|
175 /* |
|
176 * Get layout data for an label indicator. |
|
177 * |
|
178 * @since 3.0 |
|
179 * @param aIndicator Enumeration value identifying the indicator |
|
180 */ |
|
181 void LabelLayoutL( |
|
182 MPXScreenSaverPluginControl aControl ); |
|
183 |
|
184 /* |
|
185 * Get background height. |
|
186 * |
|
187 * @since 3.0 |
|
188 * @return background height for current resolution |
|
189 */ |
|
190 TInt BackgroundHeightL(); |
|
191 |
|
192 /** |
|
193 * Get draw position and background color index, draw position is stored |
|
194 * in member variable iStartY |
|
195 * |
|
196 * @return background color index |
|
197 */ |
|
198 TInt GetDrawPositionAndColorIndexL(); |
|
199 |
|
200 /** |
|
201 * Resizes all the icons and rects to match current screen size |
|
202 */ |
|
203 void UpdateLayoutL(); |
|
204 |
|
205 private: |
|
206 // Pointer to the screen saver host |
|
207 MScreensaverPluginHost* iScreenSaverHost; |
|
208 |
|
209 CCoeControl* iParentControl; |
|
210 CEikonEnv* iEikEnv; |
|
211 HBufC* iProfileName; |
|
212 TInt iStartY; |
|
213 TInt iStartX; |
|
214 TInt iNewMessage; |
|
215 TInt iMissedCall; |
|
216 TInt iNewInstantMessage; |
|
217 TInt iNewVoiceMessage; |
|
218 TInt iNewEmail; |
|
219 TInt iKeyguard; |
|
220 TBool iIsSilent; |
|
221 |
|
222 CGulIcon* iPlayIcon; // owned |
|
223 CGulIcon* iPauseIcon; // owned |
|
224 CGulIcon* iMessageIcon; |
|
225 CGulIcon* iMissedCallIcon; |
|
226 CGulIcon* iNewInstantMessageIcon; |
|
227 CGulIcon* iNewVoiceMessageIcon; |
|
228 CGulIcon* iNewEmailIcon; |
|
229 CGulIcon* iKeyguardIcon; |
|
230 RPointerArray<CGulIcon> iBackground; |
|
231 |
|
232 CEikLabel* iTitleLabel; |
|
233 CEikLabel* iClockLabel; |
|
234 CEikLabel* iAmPmLabel; |
|
235 CFont* iIndicatorFont; |
|
236 |
|
237 CFbsBitmap* iOffScreenBitmap; // owned |
|
238 CFbsBitGc* iOSBitmapContext; // owned |
|
239 CFbsBitmapDevice* iOSBitmapDevice; // owned |
|
240 |
|
241 TSize iScreenSize; |
|
242 TRect iRectIndicators; |
|
243 TRect iRectPlaybackStatus; |
|
244 }; |
|
245 |
|
246 #endif // C_CMPXSCREENSAVERPLUGINCONTAINER_H |
|
247 |