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