|
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 JNIEnv* aJni, |
|
53 jobject aGUIObject); |
|
54 virtual ~CMMADCDisplay(); |
|
55 |
|
56 public: // From MMMADisplay |
|
57 void DrawFrameL(const CFbsBitmap* aBitmap); |
|
58 //void SetDisplaySizeL(const TSize& aSize); |
|
59 void SetDisplayLocationL(const TPoint& aPosition); |
|
60 TPoint DisplayLocation(); |
|
61 void SetFullScreenL(TBool aFullScreen); |
|
62 void SourceSizeChanged(const TSize& aSourceSize); |
|
63 void SourceSizeChanged(TInt aJavaControlWidth, TInt aJavaControlHeight,TInt x, TInt y,TRect aBoundsRect); |
|
64 TBool IsVisible(); |
|
65 |
|
66 /** |
|
67 * Gets notification that there is container to draw assigned |
|
68 * |
|
69 * @return ETrue if container have been set |
|
70 * EFalse if container is not set |
|
71 */ |
|
72 virtual TBool HasContainer(); |
|
73 |
|
74 /** |
|
75 * Gets resources necessary to start DirectScreenAccess |
|
76 * Doesn't run in mmapi event server thread! |
|
77 * |
|
78 * @since S60 v5.0 |
|
79 * @param "aConsumer" A consumer of callback |
|
80 * @param "aThreadType" Indicates the thread type (ESWT or MMAPI) |
|
81 */ |
|
82 void UIGetDSAResources( |
|
83 MUiEventConsumer& aConsumer, |
|
84 MMMADisplay::TThreadType aThreadType); |
|
85 |
|
86 /** |
|
87 * Invokes a callback in ESWT thread |
|
88 * |
|
89 * @since S60 v5.0 |
|
90 * @param "aConsumer" A consumer of callback |
|
91 * @param "aCallbackId" A number identifying the callback |
|
92 */ |
|
93 void UIGetCallback(MUiEventConsumer& aConsumer, TInt aCallbackId); |
|
94 |
|
95 public: // From MMMADirectContent |
|
96 void MdcContainerVisibilityChanged(TBool aVisible); |
|
97 void MdcContentRectChanged(const TRect& aContentRect, |
|
98 const TRect& aClipRect); |
|
99 void MdcContainerWindowRectChanged(const TRect& aRect); |
|
100 void MdcContainerDestroyed(); |
|
101 void MdcSetContainer(MMMAContainer* aContainer); |
|
102 CFbsBitmap* MdcFrameBuffer() const; |
|
103 TSize MdcSourceSize(); |
|
104 |
|
105 public: // From CMMADisplay |
|
106 void MdcContentBoundsChanged(const TRect& aRect); |
|
107 |
|
108 private: // new methods |
|
109 /** |
|
110 * Creates bitmap when bitmap mode is used |
|
111 * @return error code |
|
112 */ |
|
113 TInt InitBitmapMode(); |
|
114 |
|
115 static void SetDrawRectL(CMMADCDisplay* aDisplay, |
|
116 TSize* aSize); |
|
117 |
|
118 CMMADCDisplay(MMMAGuiPlayer* aPlayer, |
|
119 MMAFunctionServer* aEventSource, |
|
120 jobject aGUIObject); |
|
121 private: // data |
|
122 |
|
123 // Not own. |
|
124 MMMAContainer* iContainer; |
|
125 |
|
126 // Own. |
|
127 CFbsBitmap* iBitmap; |
|
128 |
|
129 // Not own |
|
130 MMAFunctionServer* iEventSource; |
|
131 |
|
132 // direct content java object |
|
133 jobject iGUIObject; |
|
134 |
|
135 // Own |
|
136 CMMADCRepaintEvent* iRepaint; |
|
137 |
|
138 // Not own |
|
139 MMMAGuiPlayer* iPlayer; |
|
140 }; |
|
141 |
|
142 #endif // CMMADCDISPLAY_H |