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();
|
|
156 |
|
|
157 |
protected: // Data
|
|
158 |
|
|
159 |
/**
|
|
160 |
* Not owned.
|
|
161 |
* Actual drawing place of the content.
|
|
162 |
*/
|
|
163 |
MMMADisplayWindow* iWindow;
|
|
164 |
|
|
165 |
/**
|
|
166 |
* Source contents size.
|
|
167 |
*/
|
|
168 |
TSize iSourceSize;
|
|
169 |
|
|
170 |
/**
|
|
171 |
* Indicates visibility set from from Java.
|
|
172 |
*/
|
|
173 |
TBool iVisible;
|
|
174 |
|
|
175 |
/**
|
|
176 |
* Screenmode set from Java.
|
|
177 |
*/
|
|
178 |
TBool iFullScreen;
|
|
179 |
|
|
180 |
/**
|
|
181 |
* Is native container visible.
|
|
182 |
*/
|
|
183 |
TBool iContainerVisible;
|
|
184 |
|
|
185 |
/**
|
|
186 |
* Draw rect set from java.
|
|
187 |
*/
|
|
188 |
TRect iUserRect;
|
|
189 |
|
|
190 |
/**
|
|
191 |
* Not owned, obtained from lcdui components.
|
|
192 |
*/
|
|
193 |
MDirectContainer* iDirectContainer;
|
|
194 |
|
|
195 |
/**
|
|
196 |
* Clip rectangle currently set to LCDUI.
|
|
197 |
* NOTE: need to be removed at last during destruction phase!
|
|
198 |
*/
|
|
199 |
TRect iClipRect;
|
|
200 |
/**
|
|
201 |
* Is midlet is in foreground ?
|
|
202 |
*/
|
|
203 |
TBool iIsForeground;
|
|
204 |
|
|
205 |
/**
|
|
206 |
* Indicates that iUserRect has been changed
|
|
207 |
* during container invisibility
|
|
208 |
*/
|
|
209 |
TBool iResetDrawRect;
|
|
210 |
};
|
|
211 |
|
|
212 |
#endif // CMMADISPLAY_H
|