|
1 /* |
|
2 * Copyright (c) 2002-2009 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: Abstract base class for windows. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef MMMADISPLAYWINDOW_H |
|
20 #define MMMADISPLAYWINDOW_H |
|
21 |
|
22 |
|
23 #include "mmmadisplay.h" |
|
24 #include "qwidget.h" |
|
25 #include "COECNTRL.h" |
|
26 #include "COEMAIN.h" |
|
27 // FORWARD DECLARATIONS |
|
28 class CFbsBitmap; |
|
29 class CMMAPlayer; |
|
30 |
|
31 // CLASS DEFINITION |
|
32 /* |
|
33 ----------------------------------------------------------------------------- |
|
34 |
|
35 DESCRIPTION |
|
36 |
|
37 Abstract base class for windows. |
|
38 |
|
39 ----------------------------------------------------------------------------- |
|
40 */ |
|
41 NONSHARABLE_CLASS(MMMADisplayWindow) |
|
42 { |
|
43 public: |
|
44 |
|
45 enum TDisplayWindowType |
|
46 { |
|
47 EDisplayWindowTypeNotSet = -1, |
|
48 EDisplayWindowTypeIsDSA, |
|
49 EDisplayWindowTypeIsBitmap, |
|
50 EDisplayWindowTypeIsCamera, |
|
51 }; |
|
52 |
|
53 /** |
|
54 * Can be deleted through this interface. |
|
55 */ |
|
56 virtual ~MMMADisplayWindow() |
|
57 { |
|
58 }; |
|
59 |
|
60 /** |
|
61 * Sets destination bitmap for <code>DrawFrameL</code> method |
|
62 * |
|
63 * @param aBitmap destination Bitmap where DrawFrameL draws. |
|
64 */ |
|
65 virtual void SetDestinationBitmapL(CFbsBitmap* aBitmap) = 0; |
|
66 |
|
67 /** |
|
68 * Draws bitmap to the rect set with <code>SetDrawRectL</code> |
|
69 * method. Bitmap may be scaled to fill whole rect. Implementation |
|
70 * may ignore <code>aBitmap</code> parameter and implements own |
|
71 * drawing procedure. |
|
72 * |
|
73 * @param aBitmap Bitmap to be drawn. |
|
74 */ |
|
75 virtual void DrawFrameL(const CFbsBitmap* aBitmap) = 0; |
|
76 |
|
77 /** |
|
78 * Sets drawing area which is used in <code>DrawFrameL</code> method. |
|
79 * |
|
80 * THE CALL CANNOT ORIGINATE FROM UI THREAD. |
|
81 * (including the call via MMA event server) |
|
82 * |
|
83 * use SetDrawRectThread when in UI thread |
|
84 * |
|
85 * @param aRect New drawing area. |
|
86 */ |
|
87 virtual void SetDrawRect(const TRect& aRect) = 0; |
|
88 |
|
89 /** |
|
90 * Calls SetDrawRect method through event source. This method must |
|
91 * be called instead of SetDrawRect if not executing in MMA |
|
92 * thread. |
|
93 * |
|
94 * THE CALL CANNOT ORIGINATE FROM MMA THREAD. |
|
95 * (including the call via UI event server) |
|
96 * |
|
97 * @param aRect New drawing area. |
|
98 */ |
|
99 virtual void SetDrawRectThread(const TRect& aRect) = 0; |
|
100 |
|
101 /** |
|
102 * Sets drawing position which is used in <code>DrawFrameL</code> method. |
|
103 * |
|
104 * @param aPosition New drawing position. |
|
105 */ |
|
106 virtual void SetPosition(const TPoint& aPosition) = 0; |
|
107 |
|
108 /** |
|
109 * Sets window visible or invisible. This method can be called from |
|
110 * MMA event server thread or from other context. aUseEventServer |
|
111 * must be set to EFalse if caller is already in MMA event server. |
|
112 * |
|
113 * @param aVisible visiblity |
|
114 * @param aUseEventServer Indicates if method must called through event |
|
115 * server. |
|
116 */ |
|
117 virtual void SetVisible(TBool aVisible, TBool aUseEventServer = ETrue) = 0; |
|
118 |
|
119 /** |
|
120 * Returns rect which is used for drawing frames. |
|
121 * |
|
122 * @return Drawing area |
|
123 */ |
|
124 virtual const TRect& DrawRect() = 0; |
|
125 |
|
126 /** |
|
127 * Returns whole window's size. |
|
128 * |
|
129 * @return Size of the window. |
|
130 */ |
|
131 virtual TSize WindowSize() = 0; |
|
132 |
|
133 /** |
|
134 * Sets window size. |
|
135 * |
|
136 * @param aRect Windows size. |
|
137 */ |
|
138 virtual void SetWindowRect(const TRect& aRect, MMMADisplay::TThreadType aThreadType) = 0; |
|
139 |
|
140 /** |
|
141 * Gets window rect. |
|
142 * |
|
143 * @returns Windows rect. |
|
144 */ |
|
145 virtual const TRect& WindowRect() = 0; |
|
146 |
|
147 virtual CMMAPlayer* UiPlayer() |
|
148 { |
|
149 } |
|
150 |
|
151 #ifdef RD_JAVA_NGA_ENABLED |
|
152 /** |
|
153 * Sets Crop region. used only in CMMASurfaceWindow |
|
154 * |
|
155 * @since S60 v5.2 |
|
156 */ |
|
157 virtual void SetVideoCropRegion(const TRect& /*aRect*/) |
|
158 { |
|
159 // Empty |
|
160 } |
|
161 |
|
162 /** |
|
163 * Sets RWindow rect. used only in CMMASurfaceWindow. |
|
164 * can be called from either MMA ES thread context or |
|
165 * UI thread context. |
|
166 * |
|
167 * @since S60 v5.2 |
|
168 */ |
|
169 virtual void SetRWindowRect(const TRect& /*aRect*/, |
|
170 MMMADisplay::TThreadType /*aThreadType*/) |
|
171 { |
|
172 // Empty |
|
173 } |
|
174 #endif |
|
175 |
|
176 /** |
|
177 * |
|
178 */ |
|
179 virtual TDisplayWindowType GetDisplayWindowType() const |
|
180 { |
|
181 return EDisplayWindowTypeNotSet; |
|
182 } |
|
183 |
|
184 /** |
|
185 * Gets window visible or invisible. |
|
186 * @retrun ETrue if visible else EFalse. Default implementation always returns ETrue |
|
187 */ |
|
188 virtual TBool IsVisible() const |
|
189 { |
|
190 return ETrue; |
|
191 } |
|
192 |
|
193 /** |
|
194 * Informs window that container which is window drawn on |
|
195 * is set from now. Implementation is now able to invoke |
|
196 * any UI callbacks |
|
197 * |
|
198 * @since S60 v5.0 |
|
199 */ |
|
200 virtual void ContainerSet() |
|
201 { |
|
202 // Empty |
|
203 } |
|
204 |
|
205 /** |
|
206 * Informs window that container which is window drawn on |
|
207 * is going to be deleted. Implementation should abort any |
|
208 * DirectScreenAccess and delete all the objects |
|
209 * instantiated within UI thread. |
|
210 * Called wihout mmapi event server directly from UI thread. |
|
211 * By default it doesn't do anything. |
|
212 * |
|
213 * @since S60 v5.0 |
|
214 */ |
|
215 virtual void ContainerDestroyed() |
|
216 { |
|
217 // Empty |
|
218 } |
|
219 |
|
220 /** |
|
221 * Notifies window that any drawing |
|
222 * via direct screen access must be aborted |
|
223 */ |
|
224 virtual void AbortDSA() |
|
225 { |
|
226 // default empty implementation |
|
227 } |
|
228 |
|
229 /** |
|
230 * Allows window to draw |
|
231 * via direct screen access after MdcAbortDSA |
|
232 */ |
|
233 virtual void ResumeDSA() |
|
234 { |
|
235 // default empty implementation |
|
236 } |
|
237 |
|
238 /** |
|
239 * gets window resources from QT |
|
240 */ |
|
241 virtual void ProcureWindowResourcesFromQWidget(RWsSession * aWs, |
|
242 CWsScreenDevice* aScreenDevice, |
|
243 RWindowBase* aWindow) |
|
244 { |
|
245 // default empty implementation |
|
246 } |
|
247 |
|
248 virtual void UICallback( TInt aCallbackId ) |
|
249 { |
|
250 } |
|
251 }; |
|
252 |
|
253 #endif // MMMADISPLAYWINDOW_H |