author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 13 Oct 2010 14:23:59 +0300 | |
branch | RCL_3 |
changeset 83 | 26b2b12093af |
parent 77 | 7cee158cb8cd |
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); |
|
63 |
||
64 |
/** |
|
65 |
* Gets notification that there is container to draw assigned |
|
66 |
* |
|
67 |
* @return ETrue if container have been set |
|
68 |
* EFalse if container is not set |
|
69 |
*/ |
|
70 |
virtual TBool HasContainer(); |
|
71 |
||
72 |
/** |
|
73 |
* Gets resources necessary to start DirectScreenAccess |
|
74 |
* Doesn't run in mmapi event server thread! |
|
75 |
* |
|
76 |
* @since S60 v5.0 |
|
77 |
* @param "aConsumer" A consumer of callback |
|
78 |
* @param "aThreadType" Indicates the thread type (UI or MMAPI) |
|
79 |
*/ |
|
80 |
void UIGetDSAResources( |
|
81 |
MUiEventConsumer& aConsumer, |
|
82 |
MMMADisplay::TThreadType aThreadType); |
|
83 |
||
84 |
/** |
|
85 |
* Invokes a callback in UI thread |
|
86 |
* |
|
87 |
* @since S60 v5.0 |
|
88 |
* @param "aConsumer" A consumer of callback |
|
89 |
* @param "aCallbackId" A number identifying the callback |
|
90 |
*/ |
|
91 |
virtual void UIGetCallback( |
|
92 |
MUiEventConsumer& aConsumer, |
|
93 |
TInt aCallbackId); |
|
94 |
||
95 |
public: // Methods derived from MDirectContent |
|
96 |
/** |
|
97 |
* Used to obtain RWindow rect |
|
98 |
*/ |
|
99 |
virtual void MdcContainerWindowRectChanged(const TRect& aRect); |
|
100 |
||
101 |
/** |
|
102 |
* Same functionality is shared in canvas and item displays. |
|
103 |
*/ |
|
104 |
virtual void MdcContainerVisibilityChanged(TBool aVisible); |
|
105 |
||
106 |
/** |
|
107 |
* Default implementation, panics in debug build. Must be written in |
|
108 |
* derived classes if needed. |
|
109 |
*/ |
|
110 |
virtual void MdcItemContentRectChanged(const TRect& aContentRect, |
|
111 |
const TRect& aScreenRect); |
|
112 |
||
113 |
/** |
|
114 |
* Notify content that container is about to be destoryed. |
|
115 |
*/ |
|
116 |
virtual void MdcContainerDestroyed(); |
|
117 |
/** |
|
118 |
* Notify player's window that any drawing |
|
119 |
* via direct screen access must be aborted |
|
120 |
*/ |
|
121 |
void MdcAbortDSA(); |
|
122 |
||
123 |
/** |
|
124 |
* Allow player's window to draw |
|
125 |
* via direct screen access after MdcAbortDSA |
|
126 |
*/ |
|
127 |
void MdcResumeDSA(); |
|
128 |
||
129 |
protected:// New Methods |
|
130 |
/** |
|
131 |
* Scales drawarea to full screen. Aspect ratio of the source size |
|
132 |
* will be maintained. |
|
133 |
*/ |
|
134 |
TRect ScaleToFullScreen(const TSize& aFullScreenSize, |
|
135 |
const TSize& aSourceSize); |
|
136 |
||
137 |
/** |
|
138 |
* Set clipping region to LCDUI UI component according |
|
139 |
* to current window drawrect so that the LCDUI component |
|
140 |
* does not paint over the area that is occupied by video. |
|
141 |
* Based on current visibility of video image, this method |
|
142 |
* either sets or removes the clipping region. |
|
143 |
* LCDUI component is then redrawn. |
|
144 |
*/ |
|
145 |
void SetClippingRegion(); |
|
146 |
||
147 |
/** |
|
148 |
* Remove currently set clip region and refresh canvas |
|
149 |
*/ |
|
150 |
void RemoveClippingRegion(); |
|
151 |
||
152 |
/** |
|
153 |
* Add clip region |
|
154 |
*/ |
|
155 |
void AddClippingRegion(); |
|
71
d5e927d5853b
Revision: v2.2.11
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
156 |
|
d5e927d5853b
Revision: v2.2.11
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
157 |
/** |
d5e927d5853b
Revision: v2.2.11
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
158 |
* 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
|
159 |
*/ |
d5e927d5853b
Revision: v2.2.11
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
160 |
void UserRectSet(); |
d5e927d5853b
Revision: v2.2.11
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
161 |
|
d5e927d5853b
Revision: v2.2.11
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
162 |
/** |
d5e927d5853b
Revision: v2.2.11
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
163 |
* Is user rect set |
d5e927d5853b
Revision: v2.2.11
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
164 |
*/ |
d5e927d5853b
Revision: v2.2.11
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
165 |
TBool IsUserRectSet(); |
66 | 166 |
|
167 |
protected: // Data |
|
168 |
||
169 |
/** |
|
170 |
* Not owned. |
|
171 |
* Actual drawing place of the content. |
|
172 |
*/ |
|
173 |
MMMADisplayWindow* iWindow; |
|
174 |
||
175 |
/** |
|
176 |
* Source contents size. |
|
177 |
*/ |
|
178 |
TSize iSourceSize; |
|
179 |
||
180 |
/** |
|
181 |
* Indicates visibility set from from Java. |
|
182 |
*/ |
|
183 |
TBool iVisible; |
|
184 |
||
185 |
/** |
|
186 |
* Screenmode set from Java. |
|
187 |
*/ |
|
188 |
TBool iFullScreen; |
|
189 |
||
190 |
/** |
|
191 |
* Is native container visible. |
|
192 |
*/ |
|
193 |
TBool iContainerVisible; |
|
194 |
||
195 |
/** |
|
196 |
* Draw rect set from java. |
|
197 |
*/ |
|
198 |
TRect iUserRect; |
|
71
d5e927d5853b
Revision: v2.2.11
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
199 |
|
d5e927d5853b
Revision: v2.2.11
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
200 |
/** |
d5e927d5853b
Revision: v2.2.11
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
201 |
* Is User Rect Set? |
d5e927d5853b
Revision: v2.2.11
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
202 |
*/ |
d5e927d5853b
Revision: v2.2.11
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
203 |
TBool iUserRectSet; |
66 | 204 |
|
205 |
/** |
|
206 |
* Not owned, obtained from lcdui components. |
|
207 |
*/ |
|
208 |
MDirectContainer* iDirectContainer; |
|
209 |
||
210 |
/** |
|
211 |
* Clip rectangle currently set to LCDUI. |
|
212 |
* NOTE: need to be removed at last during destruction phase! |
|
213 |
*/ |
|
214 |
TRect iClipRect; |
|
215 |
/** |
|
216 |
* Is midlet is in foreground ? |
|
217 |
*/ |
|
218 |
TBool iIsForeground; |
|
219 |
||
220 |
/** |
|
221 |
* Indicates that iUserRect has been changed |
|
222 |
* during container invisibility |
|
223 |
*/ |
|
224 |
TBool iResetDrawRect; |
|
225 |
}; |
|
226 |
||
227 |
#endif // CMMADISPLAY_H |