|
1 /* |
|
2 * Copyright (c) 2005-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: |
|
15 * MsgEditor Svgt media control - a Message Editor Base control |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #ifndef MSGSVGTCONTROL_H |
|
22 #define MSGSVGTCONTROL_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <msgmediacontrol.h> |
|
26 |
|
27 // CONSTANTS |
|
28 |
|
29 // MACROS |
|
30 |
|
31 // DATA TYPES |
|
32 |
|
33 // FUNCTION PROTOTYPES |
|
34 |
|
35 // FORWARD DECLARATIONS |
|
36 class CMsgEditorView; |
|
37 class TAknsItemID; |
|
38 class CMsgBitmapControl; |
|
39 class CMsgSvgUtils; |
|
40 |
|
41 // CLASS DECLARATION |
|
42 |
|
43 // ========================================================== |
|
44 |
|
45 /** |
|
46 * Message Editor Base control for handling svgt |
|
47 */ |
|
48 class CMsgSvgControl : public CMsgMediaControl |
|
49 { |
|
50 |
|
51 public: // Constructor and destructor |
|
52 |
|
53 /** |
|
54 * Two-phased constructor. |
|
55 * @param aObserver Control state observer. |
|
56 * @param aParent Parent control. |
|
57 * |
|
58 * @return new object |
|
59 */ |
|
60 IMPORT_C static CMsgSvgControl* NewL( CMsgEditorView& aParent, |
|
61 MMsgAsyncControlObserver* aObserver ); |
|
62 |
|
63 /** |
|
64 * Destructor. |
|
65 */ |
|
66 virtual ~CMsgSvgControl(); |
|
67 |
|
68 public: // New functions |
|
69 |
|
70 /** |
|
71 * Loads SVG content indicator icon from specified file using bitmap id and mask id. |
|
72 * This indicator icon is superimposed on top of SVG icon. |
|
73 * |
|
74 * @param aId Item Id. |
|
75 * @param aFileName Name of the file that includes wanted icon bitmap |
|
76 * @param aFileBitmapId ID of the icon bitmap |
|
77 * @param aFileMaskId ID of the icon mask. -1 (default) if no mask needed. |
|
78 */ |
|
79 IMPORT_C void LoadIndicatorIconL( const TAknsItemID& aId, |
|
80 const TDesC& aFileName, |
|
81 const TInt aFileBitmapId, |
|
82 const TInt aFileMaskId = -1 ); |
|
83 |
|
84 public: |
|
85 |
|
86 /** |
|
87 * From MMsgAsyncControl |
|
88 * |
|
89 * LoadL |
|
90 */ |
|
91 void LoadL( RFile& aFileHandle ); |
|
92 |
|
93 /** |
|
94 * From MMsgAsyncControl |
|
95 * |
|
96 * Cancels the asyncronous operation if it is pending. |
|
97 */ |
|
98 void Cancel(); |
|
99 |
|
100 /** |
|
101 * From MMsgAsyncControl |
|
102 * |
|
103 * Closes control. Closing means freeing file |
|
104 * specific resources that other application can use the file. |
|
105 */ |
|
106 void Close(); |
|
107 |
|
108 /** |
|
109 * From CMsgMediaControl |
|
110 * |
|
111 * PlayL |
|
112 */ |
|
113 void PlayL(); |
|
114 |
|
115 /** |
|
116 * From CMsgMediaControl |
|
117 * |
|
118 * Stop |
|
119 */ |
|
120 void Stop(); |
|
121 |
|
122 /** |
|
123 * From CMsgMediaControl |
|
124 * |
|
125 * PauseL |
|
126 */ |
|
127 void PauseL(); |
|
128 |
|
129 public: // from CMsgBaseControl |
|
130 |
|
131 /** |
|
132 * Calculates and sets the size of the control and returns new size as |
|
133 * reference aSize. |
|
134 * From CMsgBaseControl |
|
135 */ |
|
136 void SetAndGetSizeL( TSize& aSize ); |
|
137 |
|
138 public: // from CCoeControl |
|
139 |
|
140 /** |
|
141 * Called when size is changed. |
|
142 * From CMsgBaseControl |
|
143 */ |
|
144 void SizeChanged(); |
|
145 |
|
146 /** |
|
147 * From CCoeControl. Handles resource change events. |
|
148 * @param aType |
|
149 */ |
|
150 void HandleResourceChange( TInt aType ); |
|
151 |
|
152 /** |
|
153 * From CCoeControl Return count of controls be included in this component |
|
154 */ |
|
155 TInt CountComponentControls() const; |
|
156 |
|
157 /** |
|
158 * From CCoeControl Return pointer to component in question. |
|
159 */ |
|
160 CCoeControl* ComponentControl( TInt aIndex ) const; |
|
161 |
|
162 /** |
|
163 * From CCoeControl,Draw. |
|
164 * @param aRect draw rect |
|
165 */ |
|
166 void Draw( const TRect& aRect ) const; |
|
167 |
|
168 private: |
|
169 |
|
170 /** |
|
171 * C++ default constructor. |
|
172 */ |
|
173 CMsgSvgControl(); |
|
174 |
|
175 /** |
|
176 * constructor |
|
177 * @param aFlags - CMsgImageControl::TFlags |
|
178 * @param aBaseControlObserver - observer to notify about changes. |
|
179 */ |
|
180 CMsgSvgControl( MMsgBaseControlObserver& aBaseControlObserver ); |
|
181 |
|
182 /** |
|
183 * By default Symbian constructor is private. |
|
184 * @param aParent - parent control. |
|
185 */ |
|
186 void ConstructL( CMsgEditorView& aParent, |
|
187 MMsgAsyncControlObserver* aObserver ); |
|
188 |
|
189 /** |
|
190 * Loads the thumbnail without setting the filehandle |
|
191 */ |
|
192 void DoLoadL(); |
|
193 |
|
194 /** |
|
195 * Calculates correct extent for icon control. |
|
196 */ |
|
197 void SetIconExtent(); |
|
198 |
|
199 /** |
|
200 * Calculates correct size for control. |
|
201 */ |
|
202 TSize CalculateControlSize( TSize aProposedSize ) const; |
|
203 |
|
204 private: //Data |
|
205 |
|
206 RFile iFileHandle; |
|
207 CMsgIconControl* iSvgIndicator; |
|
208 CMsgSvgUtils* iSvgUtils; |
|
209 }; |
|
210 |
|
211 #endif // MSGSVGTCONTROL_H |