|
1 /* |
|
2 * Copyright (c) 2005 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 |
|
20 |
|
21 #ifndef CMCECOMDISPLAYSINK_H |
|
22 #define CMCECOMDISPLAYSINK_H |
|
23 |
|
24 #include <e32std.h> |
|
25 #include "mcecommediasink.h" |
|
26 #include "mcedisplaysink.h" |
|
27 |
|
28 /** |
|
29 * |
|
30 * |
|
31 * @lib |
|
32 */ |
|
33 class CMceComDisplaySink : public CMceComMediaSink |
|
34 { |
|
35 |
|
36 public: // Constructors and destructor |
|
37 |
|
38 /** |
|
39 * Constructor |
|
40 */ |
|
41 static CMceComDisplaySink* NewL(); |
|
42 |
|
43 /** |
|
44 * Constructor |
|
45 */ |
|
46 static CMceComDisplaySink* NewLC(); |
|
47 |
|
48 /** |
|
49 * Destructor. |
|
50 */ |
|
51 ~CMceComDisplaySink(); |
|
52 |
|
53 public: // from CMceComMediaSink |
|
54 |
|
55 /** |
|
56 * Internalizes flat data |
|
57 * @param aReadStream read stream |
|
58 */ |
|
59 void InternalizeFlatL( RReadStream& aReadStream ); |
|
60 |
|
61 /** |
|
62 * Externalizes flat data |
|
63 * @param aWriteStream write stream |
|
64 */ |
|
65 void ExternalizeFlatL( RWriteStream& aWriteStream ); |
|
66 |
|
67 /** |
|
68 * Traversal event handler |
|
69 * @param aEvent the event |
|
70 * @return status, if event was consumed or not or object needs update |
|
71 */ |
|
72 TInt EventReceivedL( TMceComEvent& aEvent ); |
|
73 |
|
74 /** |
|
75 * Clones this object |
|
76 * @return the cloned object |
|
77 */ |
|
78 CMceComMediaSink* CloneL(); |
|
79 |
|
80 /** |
|
81 * Updates this object |
|
82 * @param aUpdate object updates this |
|
83 */ |
|
84 void UpdateL( CMceComMediaSink& aUpdate ); |
|
85 |
|
86 /** |
|
87 * Called endpoint proxy must be created |
|
88 * @return endpointProxy |
|
89 */ |
|
90 MMceComEndPointProxy* CreateEndpointProxyL() const; |
|
91 |
|
92 /** |
|
93 * Should this endpoint use endpoint proxy |
|
94 * @return ETrue, this endpoint uses endpoint proxy |
|
95 */ |
|
96 TBool UsesEndpointProxy() const; |
|
97 |
|
98 |
|
99 public: //new functions |
|
100 |
|
101 /** |
|
102 * Returns display size |
|
103 * @return display size |
|
104 */ |
|
105 TRect DisplayRect(); |
|
106 |
|
107 /** |
|
108 * Sets display size |
|
109 * @param aRect display size |
|
110 */ |
|
111 void SetDisplayRect( const TRect& aRect ); |
|
112 |
|
113 /** |
|
114 * converts (point, size ) => rect |
|
115 * @param aPoint point |
|
116 * @param aSize size |
|
117 * @param aRect display size |
|
118 */ |
|
119 static void ToRect( const TPoint& aPoint, const TSize& aSize, TRect& aRect ); |
|
120 |
|
121 /** |
|
122 * converts rect => (point, size ) |
|
123 * @param aRect display size |
|
124 * @param aPoint point |
|
125 * @param aSize size |
|
126 */ |
|
127 static void ToPointAndSize( const TRect& aRect, TPoint& aPoint, TSize& aSize ); |
|
128 |
|
129 |
|
130 #ifdef MCE_COMMON_SERVER_SIDE |
|
131 |
|
132 /** |
|
133 * Returns mcc type for mcc endpoint |
|
134 * @return mcc type |
|
135 */ |
|
136 const TUid MccType(); |
|
137 |
|
138 /** |
|
139 * Returns init param for mcc endpoint |
|
140 * @param aCodec codec |
|
141 * @return init param |
|
142 */ |
|
143 const TDesC8& InitParamL( const CMceComCodec& aCodec ); |
|
144 |
|
145 const TDesC8& DoInitParamL( const CMceComCodec& aCodec ); |
|
146 |
|
147 /** |
|
148 * Enables 'locally' this endpoint |
|
149 * @param aCodec the codec associated to this endpoint |
|
150 */ |
|
151 void EnableL( const CMceComCodec& aCodec ); |
|
152 |
|
153 /** |
|
154 * Disables 'locally' this endpoint |
|
155 */ |
|
156 void DisableL(); |
|
157 |
|
158 /** |
|
159 * Prepares this endpoint |
|
160 */ |
|
161 void PrepareL(); |
|
162 |
|
163 /** |
|
164 */ |
|
165 void SetViewFinder( TBool aIsViewFinder ); |
|
166 |
|
167 /** |
|
168 */ |
|
169 TUint32 MccParameterName() const; |
|
170 |
|
171 |
|
172 #endif//MCE_COMMON_SERVER_SIDE |
|
173 |
|
174 protected: |
|
175 |
|
176 /** |
|
177 * C++ default constructor. |
|
178 */ |
|
179 CMceComDisplaySink(); |
|
180 |
|
181 |
|
182 public: // Data |
|
183 |
|
184 public: // Serialized data |
|
185 |
|
186 TInt iDisplayIndex; |
|
187 TInt iDisplayRectTlX; |
|
188 TInt iDisplayRectTlY; |
|
189 TInt iDisplayRectBrX; |
|
190 TInt iDisplayRectBrY; |
|
191 TUint iPriority; |
|
192 TBool iIsViewFinder; |
|
193 CMceDisplaySink::TRotation iRotation; |
|
194 |
|
195 TInt iDisplaysAvailable; |
|
196 TBool iInitialInfoRetrieved; |
|
197 |
|
198 private: // Data |
|
199 |
|
200 HBufC8* iSettings; |
|
201 |
|
202 }; |
|
203 |
|
204 |
|
205 #endif |