|
1 /* |
|
2 * Copyright (c) 2005 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef MUSUINAVIMEDIADECORATOR_H |
|
21 #define MUSUINAVIMEDIADECORATOR_H |
|
22 |
|
23 #include "musuidefinitions.h" |
|
24 #include "musuinavimediaanimatorobserver.h" |
|
25 |
|
26 #include <coecntrl.h> |
|
27 #include <AknUtils.h> |
|
28 |
|
29 class CAknIconArray; |
|
30 class CMusUiNaviMediaAnimator; |
|
31 class MAknsSkinInstance; |
|
32 |
|
33 /** |
|
34 * CMusUiNaviMediaDecorator |
|
35 * |
|
36 * @lib musui.exe |
|
37 */ |
|
38 class CMusUiNaviMediaDecorator : public CCoeControl, |
|
39 public MMusUiNaviMediaAnimatorObserver |
|
40 { |
|
41 |
|
42 public: // constructors and destructor |
|
43 |
|
44 /** |
|
45 * Two-phased constructor. |
|
46 * |
|
47 */ |
|
48 static CMusUiNaviMediaDecorator* NewL(); |
|
49 |
|
50 /** |
|
51 * |
|
52 * |
|
53 */ |
|
54 virtual ~CMusUiNaviMediaDecorator(); |
|
55 |
|
56 |
|
57 private: // constructors |
|
58 |
|
59 /** |
|
60 * C++ default constructor. |
|
61 * |
|
62 */ |
|
63 CMusUiNaviMediaDecorator(); |
|
64 |
|
65 /** |
|
66 * By default Symbian second-phase constructor is private. |
|
67 * |
|
68 */ |
|
69 void ConstructL(); |
|
70 |
|
71 |
|
72 public: // API |
|
73 |
|
74 /** |
|
75 * Updates left label (usually time string) in navi pane. |
|
76 * |
|
77 * @param aLabel New label |
|
78 */ |
|
79 void SetLeftLabelL( const TDesC& aLabel ); |
|
80 |
|
81 /** |
|
82 * Updates right label (usually time string) in navi pane. |
|
83 * |
|
84 * @param aLabel New label |
|
85 */ |
|
86 void SetRightLabelL( const TDesC& aLabel ); |
|
87 |
|
88 /** |
|
89 * Selects icon show |
|
90 * |
|
91 */ |
|
92 void ShowIcon( TMusUiNaviMediaDecorator aIcon ); |
|
93 |
|
94 |
|
95 protected: // from MMusUiNaviMediaAnimatorObserver |
|
96 |
|
97 void SetIcon( CGulIcon* aIcon ); |
|
98 |
|
99 |
|
100 protected: // from CCoeControl |
|
101 |
|
102 /** |
|
103 * Handles the size change events. |
|
104 * |
|
105 */ |
|
106 void SizeChanged(); |
|
107 |
|
108 /** |
|
109 * Draws the control. |
|
110 * |
|
111 * @param aRect The region of the control to be redrawn. |
|
112 */ |
|
113 void Draw( const TRect& aRect ) const; |
|
114 |
|
115 |
|
116 private: // HELPERS |
|
117 |
|
118 /** |
|
119 * Layouts the text depending on current situation. |
|
120 * |
|
121 */ |
|
122 void DoLayoutText(); |
|
123 |
|
124 |
|
125 void LoadImagesL(); |
|
126 |
|
127 void ConstructImageL( MAknsSkinInstance* aSkin, |
|
128 const TAknsItemID& aId, |
|
129 TInt aBitmapId, |
|
130 TInt aMaskId, |
|
131 TParse parse ); |
|
132 |
|
133 |
|
134 private: // DATA |
|
135 |
|
136 /** |
|
137 * |
|
138 * |
|
139 */ |
|
140 HBufC* iLeftLabel; |
|
141 |
|
142 /** |
|
143 * |
|
144 * |
|
145 */ |
|
146 HBufC* iRightLabel; |
|
147 |
|
148 |
|
149 CAknLayoutFont *iFont; |
|
150 |
|
151 /** |
|
152 * |
|
153 * |
|
154 */ |
|
155 TAknLayoutText iLeftTextLayout; |
|
156 |
|
157 /** |
|
158 * |
|
159 * |
|
160 */ |
|
161 TAknLayoutText iRightTextLayout; |
|
162 |
|
163 /** |
|
164 * |
|
165 * |
|
166 */ |
|
167 TAknLayoutRect iIconLayout; |
|
168 |
|
169 /** |
|
170 * |
|
171 * |
|
172 */ |
|
173 CAknIconArray* iIconArray; |
|
174 |
|
175 /** |
|
176 * |
|
177 * |
|
178 */ |
|
179 TInt iMiddle; |
|
180 |
|
181 TInt iIconLeft; |
|
182 |
|
183 /** |
|
184 * |
|
185 * |
|
186 */ |
|
187 TSize iLeftTextSize; |
|
188 |
|
189 /** |
|
190 * |
|
191 * |
|
192 */ |
|
193 TSize iRightTextSize; |
|
194 |
|
195 /** |
|
196 * |
|
197 * |
|
198 */ |
|
199 CGulIcon* iIcon; |
|
200 |
|
201 /** |
|
202 * resource file location ( eq. Z or C ) |
|
203 */ |
|
204 TBool iResourceRam; |
|
205 |
|
206 |
|
207 CMusUiNaviMediaAnimator* iAnimation; |
|
208 |
|
209 TSize iImageSize; |
|
210 |
|
211 }; |
|
212 |
|
213 #endif // MUSUINAVIMEDIADECORATOR_H |
|
214 |
|
215 // end of file |