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