author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 15 Sep 2010 12:05:25 +0300 | |
branch | RCL_3 |
changeset 77 | 7cee158cb8cd |
parent 71 | d5e927d5853b |
child 83 | 26b2b12093af |
permissions | -rw-r--r-- |
66 | 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: This class implements MMMADisplay |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
#ifndef CMMADISPLAY_H |
|
20 |
#define CMMADISPLAY_H |
|
21 |
||
22 |
// INCLUDES |
|
23 |
#include <reflcdui.h> |
|
24 |
#include "mmmadisplay.h" |
|
25 |
||
26 |
// CONSTANTS |
|
27 |
||
28 |
// FORWARD DECLARATIONS |
|
29 |
class MMMADisplayWindow; |
|
30 |
||
31 |
// CLASS DECLARATION |
|
32 |
/** |
|
33 |
* This class implements MMMADisplay |
|
34 |
* |
|
35 |
* |
|
36 |
*/ |
|
37 |
||
38 |
NONSHARABLE_CLASS(CMMADisplay): public CBase, |
|
39 |
public MMMADisplay, |
|
40 |
public MDirectContent |
|
41 |
{ |
|
42 |
public: |
|
43 |
// Constructors and destructors |
|
44 |
~CMMADisplay(); // Destructor () |
|
45 |
||
46 |
protected: // Constructors and destructors |
|
47 |
// Default constructor, protected to allow derivation |
|
48 |
CMMADisplay(); |
|
49 |
||
50 |
void Construct(MDirectContainer* aDirectContainer); |
|
51 |
||
52 |
public: // Methods derived from MMMADisplay |
|
53 |
void DrawFrameL(const CFbsBitmap* aBitmap); |
|
54 |
TSize DisplaySize(); |
|
55 |
void SetDisplaySizeL(const TSize& aSize); |
|
56 |
void SetVisible(TBool aValue); |
|
57 |
void SetWindowL(MMMADisplayWindow* aWindow); |
|
58 |
MMMADisplayWindow* Window(); |
|
59 |
TBool IsVisible(); |
|
60 |
TBool IsFullScreen(); |
|
61 |
virtual void SetForeground(TBool aIsForeground, TBool UseEventServer); |
|
62 |
virtual void FixUIOrientation(TBool aFix); |
|
77
7cee158cb8cd
Revision: v2.2.13
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
63 |
/** |
7cee158cb8cd
Revision: v2.2.13
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
64 |
* Allow player to free the clipping rect for |
7cee158cb8cd
Revision: v2.2.13
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
65 |
* UI usage. required in case of RTSP live streaming player |
7cee158cb8cd
Revision: v2.2.13
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
66 |
* stop and then start, to avoid the black screen in that time gap |
7cee158cb8cd
Revision: v2.2.13
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
67 |
*/ |
7cee158cb8cd
Revision: v2.2.13
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
68 |
virtual void RemoveClippingRegionPublic(); |
7cee158cb8cd
Revision: v2.2.13
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
69 |
|
7cee158cb8cd
Revision: v2.2.13
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
70 |
/** |
7cee158cb8cd
Revision: v2.2.13
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
71 |
* Allow player to get the clipping rect from |
7cee158cb8cd
Revision: v2.2.13
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
72 |
* UI usage. required in case of RTSP live streaming player |
7cee158cb8cd
Revision: v2.2.13
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
73 |
* start after stop, to avoid the black screen while its playing video |
7cee158cb8cd
Revision: v2.2.13
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
74 |
*/ |
7cee158cb8cd
Revision: v2.2.13
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
75 |
virtual void SetClippingRegionPublic(); |
66 | 76 |
|
77 |
/** |
|
78 |
* Gets notification that there is container to draw assigned |
|
79 |
* |
|
80 |
* @return ETrue if container have been set |
|
81 |
* EFalse if container is not set |
|
82 |
*/ |
|
83 |
virtual TBool HasContainer(); |
|
84 |
||
85 |
/** |
|
86 |
* Gets resources necessary to start DirectScreenAccess |
|
87 |
* Doesn't run in mmapi event server thread! |
|
88 |
* |
|
89 |
* @since S60 v5.0 |
|
90 |
* @param "aConsumer" A consumer of callback |
|
91 |
* @param "aThreadType" Indicates the thread type (UI or MMAPI) |
|
92 |
*/ |
|
93 |
void UIGetDSAResources( |
|
94 |
MUiEventConsumer& aConsumer, |
|
95 |
MMMADisplay::TThreadType aThreadType); |
|
96 |
||
97 |
/** |
|
98 |
* Invokes a callback in UI thread |
|
99 |
* |
|
100 |
* @since S60 v5.0 |
|
101 |
* @param "aConsumer" A consumer of callback |
|
102 |
* @param "aCallbackId" A number identifying the callback |
|
103 |
*/ |
|
104 |
virtual void UIGetCallback( |
|
105 |
MUiEventConsumer& aConsumer, |
|
106 |
TInt aCallbackId); |
|
107 |
||
108 |
public: // Methods derived from MDirectContent |
|
109 |
/** |
|
110 |
* Used to obtain RWindow rect |
|
111 |
*/ |
|
112 |
virtual void MdcContainerWindowRectChanged(const TRect& aRect); |
|
113 |
||
114 |
/** |
|
115 |
* Same functionality is shared in canvas and item displays. |
|
116 |
*/ |
|
117 |
virtual void MdcContainerVisibilityChanged(TBool aVisible); |
|
118 |
||
119 |
/** |
|
120 |
* Default implementation, panics in debug build. Must be written in |
|
121 |
* derived classes if needed. |
|
122 |
*/ |
|
123 |
virtual void MdcItemContentRectChanged(const TRect& aContentRect, |
|
124 |
const TRect& aScreenRect); |
|
125 |
||
126 |
/** |
|
127 |
* Notify content that container is about to be destoryed. |
|
128 |
*/ |
|
129 |
virtual void MdcContainerDestroyed(); |
|
130 |
/** |
|
131 |
* Notify player's window that any drawing |
|
132 |
* via direct screen access must be aborted |
|
133 |
*/ |
|
134 |
void MdcAbortDSA(); |
|
135 |
||
136 |
/** |
|
137 |
* Allow player's window to draw |
|
138 |
* via direct screen access after MdcAbortDSA |
|
139 |
*/ |
|
140 |
void MdcResumeDSA(); |
|
141 |
||
142 |
protected:// New Methods |
|
143 |
/** |
|
144 |
* Scales drawarea to full screen. Aspect ratio of the source size |
|
145 |
* will be maintained. |
|
146 |
*/ |
|
147 |
TRect ScaleToFullScreen(const TSize& aFullScreenSize, |
|
148 |
const TSize& aSourceSize); |
|
149 |
||
150 |
/** |
|
151 |
* Set clipping region to LCDUI UI component according |
|
152 |
* to current window drawrect so that the LCDUI component |
|
153 |
* does not paint over the area that is occupied by video. |
|
154 |
* Based on current visibility of video image, this method |
|
155 |
* either sets or removes the clipping region. |
|
156 |
* LCDUI component is then redrawn. |
|
157 |
*/ |
|
158 |
void SetClippingRegion(); |
|
159 |
||
160 |
/** |
|
161 |
* Remove currently set clip region and refresh canvas |
|
162 |
*/ |
|
163 |
void RemoveClippingRegion(); |
|
164 |
||
165 |
/** |
|
166 |
* Add clip region |
|
167 |
*/ |
|
168 |
void AddClippingRegion(); |
|
71
d5e927d5853b
Revision: v2.2.11
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
169 |
|
d5e927d5853b
Revision: v2.2.11
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
170 |
/** |
d5e927d5853b
Revision: v2.2.11
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
171 |
* Set whether java side had set the size or not |
d5e927d5853b
Revision: v2.2.11
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
172 |
*/ |
d5e927d5853b
Revision: v2.2.11
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
173 |
void UserRectSet(); |
d5e927d5853b
Revision: v2.2.11
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
174 |
|
d5e927d5853b
Revision: v2.2.11
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
175 |
/** |
d5e927d5853b
Revision: v2.2.11
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
176 |
* Is user rect set |
d5e927d5853b
Revision: v2.2.11
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
177 |
*/ |
d5e927d5853b
Revision: v2.2.11
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
178 |
TBool IsUserRectSet(); |
66 | 179 |
|
180 |
protected: // Data |
|
181 |
||
182 |
/** |
|
183 |
* Not owned. |
|
184 |
* Actual drawing place of the content. |
|
185 |
*/ |
|
186 |
MMMADisplayWindow* iWindow; |
|
187 |
||
188 |
/** |
|
189 |
* Source contents size. |
|
190 |
*/ |
|
191 |
TSize iSourceSize; |
|
192 |
||
193 |
/** |
|
194 |
* Indicates visibility set from from Java. |
|
195 |
*/ |
|
196 |
TBool iVisible; |
|
197 |
||
198 |
/** |
|
199 |
* Screenmode set from Java. |
|
200 |
*/ |
|
201 |
TBool iFullScreen; |
|
202 |
||
203 |
/** |
|
204 |
* Is native container visible. |
|
205 |
*/ |
|
206 |
TBool iContainerVisible; |
|
207 |
||
208 |
/** |
|
209 |
* Draw rect set from java. |
|
210 |
*/ |
|
211 |
TRect iUserRect; |
|
71
d5e927d5853b
Revision: v2.2.11
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
212 |
|
d5e927d5853b
Revision: v2.2.11
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
213 |
/** |
d5e927d5853b
Revision: v2.2.11
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
214 |
* Is User Rect Set? |
d5e927d5853b
Revision: v2.2.11
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
215 |
*/ |
d5e927d5853b
Revision: v2.2.11
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
216 |
TBool iUserRectSet; |
66 | 217 |
|
218 |
/** |
|
219 |
* Not owned, obtained from lcdui components. |
|
220 |
*/ |
|
221 |
MDirectContainer* iDirectContainer; |
|
222 |
||
223 |
/** |
|
224 |
* Clip rectangle currently set to LCDUI. |
|
225 |
* NOTE: need to be removed at last during destruction phase! |
|
226 |
*/ |
|
227 |
TRect iClipRect; |
|
228 |
/** |
|
229 |
* Is midlet is in foreground ? |
|
230 |
*/ |
|
231 |
TBool iIsForeground; |
|
232 |
||
233 |
/** |
|
234 |
* Indicates that iUserRect has been changed |
|
235 |
* during container invisibility |
|
236 |
*/ |
|
237 |
TBool iResetDrawRect; |
|
238 |
}; |
|
239 |
||
240 |
#endif // CMMADISPLAY_H |