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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CMMADCDISPLAY_H |
|
20 #define CMMADCDISPLAY_H |
|
21 |
|
22 // INCLUDES |
|
23 #include "mmmadisplay.h" |
|
24 #include "mmmadirectcontent.h" |
|
25 #include "cmmadisplay.h" |
|
26 |
|
27 // CONSTANTS |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class MMMAGuiPlayer; |
|
31 class MMMADisplayWindow; |
|
32 class MMMAContainer; |
|
33 class MMAFunctionServer; |
|
34 class CMMADCRepaintEvent; |
|
35 |
|
36 // CLASS DECLARATION |
|
37 /** |
|
38 * This class is used with dynamic display mode to render direct content |
|
39 * using direct container. |
|
40 */ |
|
41 NONSHARABLE_CLASS(CMMADCDisplay): |
|
42 public CMMADisplay, |
|
43 public MMMADirectContent |
|
44 { |
|
45 public: |
|
46 /** |
|
47 * Creates new instance. |
|
48 * @param aPlayer provides content |
|
49 */ |
|
50 static CMMADCDisplay* NewLC(MMMAGuiPlayer* aPlayer, |
|
51 MMAFunctionServer* aEventSource, |
|
52 jobject aGUIObject); |
|
53 virtual ~CMMADCDisplay(); |
|
54 |
|
55 public: // From MMMADisplay |
|
56 void DrawFrameL(const CFbsBitmap* aBitmap); |
|
57 void SetDisplaySizeL(const TSize& aSize); |
|
58 void SetDisplayLocationL(const TPoint& aPosition); |
|
59 TPoint DisplayLocation(); |
|
60 void SetFullScreenL(TBool aFullScreen); |
|
61 void SourceSizeChanged(const TSize& aSourceSize); |
|
62 TBool IsVisible(); |
|
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 (ESWT or MMAPI) |
|
79 */ |
|
80 void UIGetDSAResources( |
|
81 MUiEventConsumer& aConsumer, |
|
82 MMMADisplay::TThreadType aThreadType); |
|
83 |
|
84 /** |
|
85 * Invokes a callback in ESWT thread |
|
86 * |
|
87 * @since S60 v5.0 |
|
88 * @param "aConsumer" A consumer of callback |
|
89 * @param "aCallbackId" A number identifying the callback |
|
90 */ |
|
91 void UIGetCallback(MUiEventConsumer& aConsumer, TInt aCallbackId); |
|
92 |
|
93 public: // From MMMADirectContent |
|
94 void MdcContainerVisibilityChanged(TBool aVisible); |
|
95 void MdcContentRectChanged(const TRect& aContentRect, |
|
96 const TRect& aClipRect); |
|
97 void MdcContainerWindowRectChanged(const TRect& aRect); |
|
98 void MdcContainerDestroyed(); |
|
99 void MdcSetContainer(MMMAContainer* aContainer); |
|
100 CFbsBitmap* MdcFrameBuffer() const; |
|
101 TSize MdcSourceSize(); |
|
102 |
|
103 public: // From CMMADisplay |
|
104 void MdcContentBoundsChanged(const TRect& aRect); |
|
105 |
|
106 private: // new methods |
|
107 /** |
|
108 * Creates bitmap when bitmap mode is used |
|
109 * @return error code |
|
110 */ |
|
111 TInt InitBitmapMode(); |
|
112 |
|
113 static void SetDrawRectL(CMMADCDisplay* aDisplay, |
|
114 TSize* aSize); |
|
115 |
|
116 CMMADCDisplay(MMMAGuiPlayer* aPlayer, |
|
117 MMAFunctionServer* aEventSource, |
|
118 jobject aGUIObject); |
|
119 private: // data |
|
120 |
|
121 // Not own. |
|
122 MMMAContainer* iContainer; |
|
123 |
|
124 // Own. |
|
125 CFbsBitmap* iBitmap; |
|
126 |
|
127 // Not own |
|
128 MMAFunctionServer* iEventSource; |
|
129 |
|
130 // direct content java object |
|
131 jobject iGUIObject; |
|
132 |
|
133 // Own |
|
134 CMMADCRepaintEvent* iRepaint; |
|
135 |
|
136 // Not own |
|
137 MMMAGuiPlayer* iPlayer; |
|
138 }; |
|
139 |
|
140 #endif // CMMADCDISPLAY_H |
|