|
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 __CMCETESTUIENGINESESSION_H__ |
|
22 #define __CMCETESTUIENGINESESSION_H__ |
|
23 |
|
24 // USER INCLUDES |
|
25 |
|
26 // SYSTEM INCLUDES |
|
27 #include <e32base.h> |
|
28 #include <mcemediasource.h> |
|
29 |
|
30 |
|
31 // FORWARD DECLARATIONS |
|
32 |
|
33 class CMceManager; |
|
34 class CMceFCMsgExchange; |
|
35 class CMceSession; |
|
36 class CMCETestUIEngine; |
|
37 class CMCETestUIEngineCmdBase; |
|
38 class CMCETestUIEngineProfile; |
|
39 class CMCETestUIEngineAudioStream; |
|
40 class CMCETestUIEngineVideoStream; |
|
41 class CMceVideoCodec; |
|
42 |
|
43 const TInt KMceOutSession = 1; |
|
44 const TInt KMceInSession = 2; |
|
45 |
|
46 // CLASS DECLARATION |
|
47 /** |
|
48 * |
|
49 * CMCETestUIEngineSession provides a wrapper for CMCESession. |
|
50 * Class is not the traditional wrapper in a sense that it would |
|
51 * conform to interface provided by CMCESession. Instead class |
|
52 * implements interface MMCETestUIEngineCmdProvider to provide |
|
53 * same kind of functionality in controlled way on different levels |
|
54 * of abstraction. |
|
55 * |
|
56 * TODO: Wrappers for streams and use of them. |
|
57 * |
|
58 */ |
|
59 class CMCETestUIEngineSession : public CBase, |
|
60 public MMCETestUIEngineCmdProvider |
|
61 { |
|
62 public: // Constructors and destructors |
|
63 |
|
64 /** |
|
65 * Destructor. |
|
66 */ |
|
67 IMPORT_C virtual ~CMCETestUIEngineSession(); |
|
68 |
|
69 public: // From MMCETestUICommandProvider |
|
70 |
|
71 /** |
|
72 * Gets the commands applicaple to this session object. |
|
73 * |
|
74 * @return reference to array of commands |
|
75 */ |
|
76 IMPORT_C const RPointerArray<TMCETestUIEngineCmdBase>& |
|
77 GetCommandsL(); |
|
78 |
|
79 public: // New functions, pure virtual |
|
80 |
|
81 /** |
|
82 * @return Id of this particular session object |
|
83 */ |
|
84 IMPORT_C virtual TInt Id() const = 0; |
|
85 |
|
86 public: // New functions |
|
87 |
|
88 /** |
|
89 * @return Textual representation of the state of the wrapped MCESession |
|
90 */ |
|
91 IMPORT_C const TDesC& State() ; |
|
92 |
|
93 /** |
|
94 * @return Direction of the session |
|
95 */ |
|
96 IMPORT_C TDirection Direction() const; |
|
97 |
|
98 /** |
|
99 * @return Video Direction of the session |
|
100 */ |
|
101 IMPORT_C TVideoDirection VideoDirection() const; |
|
102 |
|
103 /** |
|
104 * @return Textual representation of session's direction |
|
105 */ |
|
106 IMPORT_C const TDesC16& TextualDirection() const; |
|
107 |
|
108 /** |
|
109 * @return Textual representation of session's Video direction |
|
110 */ |
|
111 IMPORT_C const TDesC16& TextualVideoDirection() const; |
|
112 |
|
113 /** |
|
114 * @return Audiostreams of a session |
|
115 */ |
|
116 IMPORT_C const RPointerArray<CMCETestUIEngineAudioStream>& |
|
117 AudioStreamsL(); |
|
118 |
|
119 IMPORT_C RPointerArray<CMCETestUIEngineAudioStream>& |
|
120 CurrentAudioStreams(); |
|
121 |
|
122 /** |
|
123 * @return Videostreams of a session |
|
124 */ |
|
125 IMPORT_C const RPointerArray<CMCETestUIEngineVideoStream>& |
|
126 VideoStreamsL(); |
|
127 |
|
128 IMPORT_C RPointerArray<CMCETestUIEngineVideoStream>& |
|
129 CurrentVideoStreams(); |
|
130 |
|
131 IMPORT_C TUint32 ProfileId(); |
|
132 public: // New functions, internal |
|
133 |
|
134 /** |
|
135 * Gets wrapped MCESession object |
|
136 * |
|
137 * @return wrapped MCESession |
|
138 */ |
|
139 CMceSession& Session(); |
|
140 |
|
141 /** |
|
142 * |
|
143 * Solves and sets the direction of session based on streams and |
|
144 * their properties. |
|
145 * |
|
146 * @return the newly set direction of session |
|
147 */ |
|
148 TDirection SolveDirection(); |
|
149 |
|
150 /** |
|
151 * |
|
152 * Solves and sets the Video direction of session based on streams and |
|
153 * their properties. |
|
154 * |
|
155 * @return the newly set direction of session |
|
156 */ |
|
157 TVideoDirection SolveVideoDirection(); |
|
158 |
|
159 IMPORT_C TInt StatusCode(); |
|
160 |
|
161 void EnableAudioL(); |
|
162 |
|
163 void EnableAudioStreamL( CMceMediaStream& aAudioStream ); |
|
164 |
|
165 void AdjustVideoCodecsL( const RPointerArray<CMceVideoCodec>& aCodecs ); |
|
166 |
|
167 CMceMediaStream* FindStreamForSourceL( CMceMediaStream& aStream, |
|
168 TMceSourceType aSourceType ); |
|
169 |
|
170 private: // private constructors |
|
171 |
|
172 /** |
|
173 * C++ default constructor. Not implemented. |
|
174 */ |
|
175 CMCETestUIEngineSession(); |
|
176 |
|
177 protected: |
|
178 |
|
179 /** |
|
180 * C++ first phase constructor. |
|
181 */ |
|
182 CMCETestUIEngineSession( |
|
183 CMCETestUIEngine& aEngine, |
|
184 TDirection aDirection, |
|
185 TVideoDirection aVideoDirection ); |
|
186 |
|
187 /** |
|
188 * Symbian second-phase constructor |
|
189 */ |
|
190 void BaseConstructL(); |
|
191 |
|
192 protected: // owned data |
|
193 |
|
194 // Commands applicable to all sessions. Owned. |
|
195 RPointerArray<TMCETestUIEngineCmdBase> iCommands; |
|
196 |
|
197 // Wrapppers for audiostreams |
|
198 RPointerArray<CMCETestUIEngineAudioStream> iAudioStreams; |
|
199 |
|
200 // Wrapppers for videostreams |
|
201 RPointerArray<CMCETestUIEngineVideoStream> iVideoStreams; |
|
202 |
|
203 protected: // not owned data |
|
204 |
|
205 CMCETestUIEngine& iEngine; |
|
206 |
|
207 // Pointer to wrapped OutSession/InSession |
|
208 CMceSession* iSession; |
|
209 |
|
210 // TInt iStatusCode; |
|
211 |
|
212 // Indicator of audio direction |
|
213 TDirection iDirection; |
|
214 // Indicator of video direction |
|
215 TVideoDirection iVideoDirection; |
|
216 public: |
|
217 |
|
218 TInt iType; |
|
219 |
|
220 TBool iHold; |
|
221 |
|
222 TBool iHoldInProgress; |
|
223 |
|
224 }; |
|
225 |
|
226 #endif |