1 /* |
|
2 * Copyright (c) 2006 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 MCEDISPLAYSINK_H |
|
20 #define MCEDISPLAYSINK_H |
|
21 |
|
22 // INCLUDES |
|
23 #include "mcemediasink.h" |
|
24 |
|
25 // FORWARD DECLARATIONS |
|
26 class CMceManager; |
|
27 class RWindow; |
|
28 class CWindowGc; |
|
29 class CMccScreen; |
|
30 |
|
31 // DATA TYPES |
|
32 const TMceSinkType KMceDisplaySink = 3; |
|
33 |
|
34 |
|
35 // CLASS DECLARATION |
|
36 |
|
37 /** |
|
38 * Class representing display in MCE. |
|
39 * |
|
40 * CMceDisplaySink can be used to show video on screen or as a viewfinder |
|
41 * of the camera. |
|
42 * |
|
43 * Enable and Disable operations to it are considered to be local, |
|
44 * so they are not signalled to remote terminal. |
|
45 * |
|
46 * @lib mceclient.lib |
|
47 */ |
|
48 class CMceDisplaySink : public CMceMediaSink |
|
49 { |
|
50 |
|
51 public: |
|
52 |
|
53 enum TRotation |
|
54 { |
|
55 ENone, |
|
56 EClockwise90Degree, |
|
57 EClockwise180Degree, |
|
58 EClockwise270Degree |
|
59 }; |
|
60 |
|
61 public: // Constructors and destructor |
|
62 |
|
63 /** |
|
64 * Two-phased constructor. |
|
65 * @param aManager reference to the manager |
|
66 */ |
|
67 IMPORT_C static CMceDisplaySink* NewL( CMceManager& aManager ); |
|
68 |
|
69 /** |
|
70 * Two-phased constructor. |
|
71 * @param aManager reference to the manager |
|
72 */ |
|
73 IMPORT_C static CMceDisplaySink* NewLC( CMceManager& aManager ); |
|
74 |
|
75 /// Not in the real implementation |
|
76 IMPORT_C static CMceDisplaySink* NewL(); |
|
77 |
|
78 /// Not in the real implementation |
|
79 IMPORT_C static CMceDisplaySink* NewLC(); |
|
80 |
|
81 /** |
|
82 * Destructor. |
|
83 */ |
|
84 IMPORT_C ~CMceDisplaySink(); |
|
85 |
|
86 |
|
87 public: // From CMceMediaSink |
|
88 |
|
89 /** |
|
90 * Enables the sink explicitly. |
|
91 */ |
|
92 IMPORT_C void EnableL(); |
|
93 |
|
94 /** |
|
95 * Disables the sink explicitly. |
|
96 */ |
|
97 IMPORT_C void DisableL(); |
|
98 |
|
99 |
|
100 public: // New functions |
|
101 |
|
102 /** |
|
103 * Gets the number of available displays on the device. |
|
104 * @return number of available displays |
|
105 */ |
|
106 IMPORT_C TInt DisplaysAvailable() const; |
|
107 |
|
108 /** |
|
109 * Sets index of physical display to be used. |
|
110 * @param aDisplayIndex, index of the display to be used; number of |
|
111 * available displays can be retrieved by calling |
|
112 * CMceDisplaySink::DisplaysAvailable |
|
113 * @leave KErrNotSupported if requested display cannot be used |
|
114 */ |
|
115 IMPORT_C void SetDisplayIndexL( TInt aDisplayIndex ); |
|
116 |
|
117 /** |
|
118 * Sets display resources. |
|
119 * @param aWindow handle to the display window of the user |
|
120 * @param aGc graphics context of the user |
|
121 */ |
|
122 IMPORT_C void SetDisplay( RWindow& aWindow, CWindowGc& aGc ); |
|
123 |
|
124 /** |
|
125 * Sets display rectangle. Display data is drawn to the given area. |
|
126 * @param aRect display area |
|
127 */ |
|
128 IMPORT_C void SetDisplayRectL( const TRect& aRect ); |
|
129 |
|
130 /** |
|
131 * Gets current display rectagle. |
|
132 * @return current display rectangle |
|
133 */ |
|
134 IMPORT_C const TRect DisplayRectL(); |
|
135 |
|
136 /* |
|
137 * Sets display sink priority. Priority value 0 is the highest priority. |
|
138 * Display sink with higher priority draws over less priority display |
|
139 * if display rectangles overlap. |
|
140 * @param aPriority priority value |
|
141 */ |
|
142 IMPORT_C void SetPriorityL( TUint aPriority ); |
|
143 |
|
144 /* |
|
145 * Display sink's current priority. |
|
146 * @return priority value |
|
147 */ |
|
148 IMPORT_C TUint PriorityL(); |
|
149 |
|
150 /* |
|
151 * Sets display sink rotation. |
|
152 * @param aRotation rotation value |
|
153 */ |
|
154 IMPORT_C void SetRotationL( TRotation aRotation ); |
|
155 |
|
156 /* |
|
157 * Display sink's current rotation. |
|
158 * @return rotation value |
|
159 */ |
|
160 IMPORT_C TRotation RotationL(); |
|
161 |
|
162 |
|
163 public: // internal |
|
164 |
|
165 /** |
|
166 * Initializes |
|
167 * @param aManager the manager. Ownership is NOT transferred |
|
168 */ |
|
169 void InitializeL( CMceManager* aManager ); |
|
170 |
|
171 |
|
172 private: |
|
173 |
|
174 /** |
|
175 * C++ constructor. |
|
176 */ |
|
177 CMceDisplaySink(); |
|
178 |
|
179 private: // Reserved for future use |
|
180 |
|
181 TAny* iReserved; |
|
182 |
|
183 public: // stub data |
|
184 |
|
185 TInt iDisplayIndex; |
|
186 |
|
187 TRect iDisplayRect; |
|
188 |
|
189 TUint iDisplayPriority; |
|
190 |
|
191 TRotation iRotation; |
|
192 |
|
193 CMccScreen* iScreen; |
|
194 |
|
195 }; |
|
196 |
|
197 #endif |
|