|
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: Interface for displays, which can show images. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef MMMADISPLAY_H |
|
20 #define MMMADISPLAY_H |
|
21 |
|
22 #include "jni.h" |
|
23 // FORWARD DECLARATIONS |
|
24 class CFbsBitmap; |
|
25 class MMMADisplayWindow; |
|
26 class MUiEventConsumer; |
|
27 class MMMAGuiPlayer; |
|
28 |
|
29 // CLASS DEFINITION |
|
30 /* |
|
31 ----------------------------------------------------------------------------- |
|
32 |
|
33 DESCRIPTION |
|
34 |
|
35 Interface for displays, which can show images. Display properties |
|
36 can be changed through this interface. |
|
37 |
|
38 ----------------------------------------------------------------------------- |
|
39 */ |
|
40 NONSHARABLE_CLASS(MMMADisplay) |
|
41 { |
|
42 public: |
|
43 /** |
|
44 * Describes the currently running thread type. |
|
45 */ |
|
46 enum TThreadType |
|
47 { |
|
48 EMmaThread = 0, // MMAPI thread |
|
49 EUiThread = 1 // UI thread (LCDUI or ESWT) |
|
50 }; |
|
51 |
|
52 /** |
|
53 * Display can be deleted through this interface. |
|
54 */ |
|
55 virtual ~MMMADisplay() |
|
56 { |
|
57 }; |
|
58 |
|
59 /** |
|
60 * Draws bitmap. Implementation may ignore <code>aBitmap</code> |
|
61 * parameter and implements own drawing procedure. This method must also redraw |
|
62 * the display if needed. |
|
63 * |
|
64 * @param aBitmap Bitmap to be drawn. |
|
65 */ |
|
66 virtual void DrawFrameL(const CFbsBitmap* aBitmap) = 0; |
|
67 |
|
68 /** |
|
69 * Getter for display's size. |
|
70 * |
|
71 * @return Display size. |
|
72 */ |
|
73 virtual TSize DisplaySize() = 0; |
|
74 |
|
75 /** |
|
76 * Sets display size or leaves if not supported or |
|
77 * size cannot be changed. |
|
78 * |
|
79 * @param aSize New size for the display. |
|
80 */ |
|
81 virtual void SetDisplaySizeL(const TSize& aSize) = 0; |
|
82 |
|
83 /** |
|
84 * Sets display location. |
|
85 * |
|
86 * @param aPosition New position for the display. |
|
87 */ |
|
88 virtual void SetDisplayLocationL(const TPoint& aPosition) = 0; |
|
89 |
|
90 /** |
|
91 * Returns position where display is drawn. |
|
92 * |
|
93 * @return Display location. |
|
94 */ |
|
95 virtual TPoint DisplayLocation() = 0; |
|
96 |
|
97 /** |
|
98 * Sets display fullscreen mode on/off. |
|
99 * |
|
100 * @param aFullScreen Fullscreen mode. |
|
101 */ |
|
102 virtual void SetFullScreenL(TBool aFullScreen) = 0; |
|
103 |
|
104 /** |
|
105 * Sets display visible or hides it. |
|
106 * |
|
107 * @param aVisible ETrue if display is visible, |
|
108 * EFalse if display is invisible. |
|
109 */ |
|
110 virtual void SetVisible(TBool aVisible) = 0; |
|
111 |
|
112 /** |
|
113 * Called when source size is changed. This is also called when |
|
114 * source size is available for the first time. |
|
115 * |
|
116 * @param aSourceSize New content's size. |
|
117 */ |
|
118 virtual void SourceSizeChanged(const TSize& aSourceSize) = 0; |
|
119 |
|
120 virtual void SourceSizeChanged(TInt aJavaControlWidth, TInt aJavaControlHeight,TInt x, TInt y,TRect aBoundsRect) = 0; |
|
121 |
|
122 virtual TSize SourceSize() = 0; |
|
123 |
|
124 virtual void SetUIPlayer(MMMAGuiPlayer* player) = 0; |
|
125 /** |
|
126 * Sets display's window. Ownership is not transfered. |
|
127 * |
|
128 * @param aWindow New window used for drawing. |
|
129 **/ |
|
130 virtual void SetWindowL(MMMADisplayWindow* aWindow) = 0; |
|
131 |
|
132 /** |
|
133 * Getter for window. |
|
134 * |
|
135 * @return Display's window or NULL if not set. |
|
136 */ |
|
137 virtual MMMADisplayWindow* Window() = 0; |
|
138 |
|
139 /** |
|
140 * Returns visibility of the display. |
|
141 * |
|
142 * @return ETrue if display is visible, |
|
143 * EFalse if display is invisible. |
|
144 */ |
|
145 virtual TBool IsVisible() = 0; |
|
146 |
|
147 /** |
|
148 * Returns fullscreen state of the display. |
|
149 * |
|
150 * @return ETrue if display is fullscreen, |
|
151 * EFalse if display is not fullscreen. |
|
152 */ |
|
153 virtual TBool IsFullScreen() = 0; |
|
154 /** |
|
155 *Sets the foreground state of the midlet |
|
156 * |
|
157 * @param ETrue if midlet is in foreground, |
|
158 * EFalse if midlet is in background |
|
159 */ |
|
160 virtual void SetForeground(TBool aForeground, TBool aUseEventServer) = 0; |
|
161 |
|
162 /** |
|
163 * Gets notification that there is container to draw assigned |
|
164 * |
|
165 * @return ETrue if container have been set |
|
166 * EFalse if container is not set |
|
167 */ |
|
168 virtual TBool HasContainer() = 0; |
|
169 |
|
170 /** |
|
171 * Gets resources necessary to start DirectScreenAccess |
|
172 * Doesn't run in mmapi event server thread! |
|
173 * |
|
174 * @since S60 v5.0 |
|
175 * @param "aConsumer" A consumer of callback |
|
176 * @param "aThreadType" Indicates the thread type (UI or MMAPI) |
|
177 */ |
|
178 /* virtual void UIGetDSAResources( |
|
179 MUiEventConsumer& aConsumer, |
|
180 TThreadType aThreadType) = 0; |
|
181 */ |
|
182 /** |
|
183 * Invokes a callback in UI thread |
|
184 * |
|
185 * @since S60 v5.0 |
|
186 * @param "aConsumer" A consumer of callback |
|
187 * @param "aCallbackId" A number identifying the callback |
|
188 */ |
|
189 /* virtual void UIGetCallback( |
|
190 MUiEventConsumer& aConsumer, |
|
191 TInt aCallbackId) = 0; |
|
192 */ |
|
193 |
|
194 /** |
|
195 * Trigger a function call CalledBackInUiThread() from java in UI thread |
|
196 * arg 'placeholder' is used to identify the function, to be called back from UI Thread |
|
197 */ |
|
198 virtual void GetCallbackInUiThread(TInt placeholder) = 0; |
|
199 |
|
200 /** |
|
201 * Called from java in UI thread context |
|
202 * arg 'placeholder' is used to identify the function, to be called back from UI Thread |
|
203 */ |
|
204 virtual void CalledBackInUiThread(TInt placeholder) = 0; |
|
205 |
|
206 /** |
|
207 * To check if the Display is eSWT or not |
|
208 */ |
|
209 virtual TBool iseSWT() = 0; |
|
210 virtual void SetFullscreenSize(TSize& aFullscreenSize) = 0; |
|
211 }; |
|
212 |
|
213 #endif // MMMADISPLAY_H |