|
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 MMMADisplayWindow functionality |
|
15 * in Direct Screen Access based displays for Helix engine. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef CMMADSAWINDOW_H |
|
21 #define CMMADSAWINDOW_H |
|
22 |
|
23 |
|
24 // INCLUDES |
|
25 #include <w32std.h> |
|
26 #include <e32std.h> |
|
27 #include <mmf/common/mmfstandardcustomcommands.h> |
|
28 #include "mmmadisplaywindow.h" |
|
29 #include "cmmaeventsource.h" |
|
30 #include "cmmaplayer.h" |
|
31 |
|
32 // CONSTANTS |
|
33 const TInt KMMAVideoMinDimension = 32; // minimum video width and height |
|
34 |
|
35 // CLASS DECLARATION |
|
36 /** |
|
37 * This class implements MMMADisplayWindow functionality |
|
38 * in Direct Screen Access based displays for Helix engine. |
|
39 */ |
|
40 NONSHARABLE_CLASS(CMMADSAWindow): public CBase, |
|
41 public MMMADisplayWindow |
|
42 { |
|
43 public: // Constructors and destructors |
|
44 static CMMADSAWindow* NewL( |
|
45 CMMAEventSource* aEventSource, |
|
46 CMMAPlayer* aPlayer, |
|
47 RMMFVideoPlayControllerCustomCommands* aVPCustomCommand); |
|
48 |
|
49 virtual ~CMMADSAWindow(); |
|
50 |
|
51 private: // Constructors and destructors |
|
52 CMMADSAWindow( |
|
53 CMMAEventSource* aEventSource, |
|
54 CMMAPlayer* aPlayer, |
|
55 RMMFVideoPlayControllerCustomCommands* aVPCustomCommand); |
|
56 |
|
57 void ConstructL(); |
|
58 |
|
59 public: // New methods |
|
60 TBool IsVisible() const; |
|
61 |
|
62 public: // Methods derived from MMMADisplayWindow |
|
63 void SetDestinationBitmapL(CFbsBitmap* aBitmap); |
|
64 void DrawFrameL(const CFbsBitmap* aBitmap); |
|
65 void SetDrawRect(const TRect& aRect); |
|
66 void SetDrawRectThread(const TRect& aRect); |
|
67 const TRect& DrawRect(); |
|
68 TSize WindowSize(); |
|
69 void SetPosition(const TPoint& aPosition); |
|
70 void SetVisible(TBool aVisible, TBool aUseEventServer = ETrue); |
|
71 void SetWindowRect(const TRect& aRect,MMMADisplay::TThreadType aThreadType); |
|
72 const TRect& WindowRect(); |
|
73 void ContainerDestroyed(); |
|
74 /** |
|
75 * Notifies window that any drawing |
|
76 * via direct screen access must be aborted |
|
77 */ |
|
78 void AbortDSA(); |
|
79 |
|
80 /** |
|
81 * Allows window to draw |
|
82 * via direct screen access after MdcAbortDSA |
|
83 */ |
|
84 void ResumeDSA(); |
|
85 |
|
86 private: |
|
87 static void StaticSetWindowPosition( |
|
88 CMMADSAWindow* aWindow, |
|
89 TPoint aPosition, |
|
90 CMMAEventSource* aEventSource, |
|
91 CMMAPlayer* aPlayer); |
|
92 |
|
93 static void SetWindowVisible( |
|
94 CMMADSAWindow* aWindow, |
|
95 TBool aVisible, |
|
96 CMMAEventSource* aEventSource, |
|
97 CMMAPlayer* aPlayer); |
|
98 |
|
99 static void StaticAbortDSA( |
|
100 CMMADSAWindow* aWindow, |
|
101 CMMAEventSource* aEventSource, |
|
102 CMMAPlayer* aPlayer); |
|
103 |
|
104 static void StaticResumeDSA( |
|
105 CMMADSAWindow* aWindow, |
|
106 CMMAEventSource* aEventSource, |
|
107 CMMAPlayer* aPlayer); |
|
108 private: // Data |
|
109 TRect iDrawRect; |
|
110 TRect iClientRect; |
|
111 |
|
112 /** |
|
113 * not owned, used for switching from UI thread to MMA thread |
|
114 */ |
|
115 CMMAEventSource* iEventSource; |
|
116 |
|
117 /** |
|
118 * We must depend on player's state because direct screen access may |
|
119 * not be resumed before player is started. |
|
120 */ |
|
121 CMMAPlayer* iPlayer; |
|
122 |
|
123 /** |
|
124 * not owned, used for controlling video position and visibility |
|
125 */ |
|
126 RMMFVideoPlayControllerCustomCommands* iVideoPlayControllerCustomCommands; |
|
127 |
|
128 /** |
|
129 * Indicates if content need to be drawn. |
|
130 */ |
|
131 TBool iVisible; |
|
132 |
|
133 /** |
|
134 * Indicates if DSA is aborted. |
|
135 */ |
|
136 TBool iDSAAborted; |
|
137 }; |
|
138 |
|
139 #endif // CMMADSAWINDOW_H |