|
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 |
|
20 #ifndef UT_MUSSTUBS_H |
|
21 #define UT_MUSSTUBS_H |
|
22 |
|
23 #include "musengsessiondurationtimerobserver.h" |
|
24 #include "musengaudioroutingobserver.h" |
|
25 #include "musengdisplayhandler.h" |
|
26 #include "mussipprofileuser.h" |
|
27 #include "muspropertyobserver.h" |
|
28 |
|
29 #include <lcsessionobserver.h> |
|
30 #include <lcuiprovider.h> |
|
31 #include <lcwindow.h> |
|
32 #include <lcaudiocontrol.h> |
|
33 #include <e32base.h> |
|
34 #include <ecom.h> |
|
35 |
|
36 // DUMMY CLASSES |
|
37 |
|
38 class CSIPTransactionBase |
|
39 { |
|
40 }; |
|
41 |
|
42 class CSIPServerTransaction |
|
43 { |
|
44 }; |
|
45 |
|
46 class CSIPDialog |
|
47 { |
|
48 }; |
|
49 |
|
50 class CSIPClientTransaction |
|
51 { |
|
52 }; |
|
53 |
|
54 class CSIPDialogAssocBase |
|
55 { |
|
56 }; |
|
57 |
|
58 class CSIPRegistrationBinding |
|
59 { |
|
60 }; |
|
61 |
|
62 class CSIPRefresh |
|
63 { |
|
64 }; |
|
65 |
|
66 /** |
|
67 * Class to implement all the interfaces provided by MusEngine |
|
68 */ |
|
69 class CMusEngObserverStub : public CBase, |
|
70 public MMusEngSessionDurationTimerObserver, |
|
71 public MMusEngAudioRoutingObserver, |
|
72 public MMusSipProfileUser |
|
73 { |
|
74 public: // Constructors and destructor |
|
75 |
|
76 CMusEngObserverStub(); |
|
77 ~CMusEngObserverStub(); |
|
78 |
|
79 public: // From MMusEngSessionDurationTimerObserver |
|
80 |
|
81 void UpdateTimerEvent(); |
|
82 |
|
83 public: // From MMusEngAudioRoutingObserver |
|
84 |
|
85 void AudioRoutingChanged(); |
|
86 |
|
87 public: // From MMusSipProfileUser |
|
88 |
|
89 TBool IsRoamingBetweenAPsAllowed(); |
|
90 void ProfileRegistered(); |
|
91 |
|
92 public: // Helper |
|
93 |
|
94 /** |
|
95 * ETrue if all boolean member variables are set to EFalse and all the |
|
96 * pointers are NULL |
|
97 */ |
|
98 TBool IsReseted(); |
|
99 |
|
100 /** |
|
101 * Resets all the boolean member variable values to EFalse and deletes |
|
102 * and nullifies all the pointer variables. |
|
103 */ |
|
104 void Reset(); |
|
105 |
|
106 public: // Data |
|
107 |
|
108 TBool iUpdateTimerEventCalled; |
|
109 TBool iAudioRoutingChangedCalled; |
|
110 TBool iRoamingBetweenAPsAllowed; |
|
111 TBool iProfileRegisteredCalled; |
|
112 }; |
|
113 |
|
114 class TMusEngDisplayHandlerStub : public MMusEngDisplayHandler |
|
115 { |
|
116 public: |
|
117 |
|
118 TMusEngDisplayHandlerStub(); |
|
119 |
|
120 void Reset(); |
|
121 |
|
122 public: // From MMusEngDisplayHandler |
|
123 |
|
124 TRect Rect() const; |
|
125 |
|
126 void SetRectL( const TRect& aRect ); |
|
127 |
|
128 void SetSecondaryRectL( const TRect& aSecondaryRect ); |
|
129 |
|
130 TRect SecondaryRect() const; |
|
131 |
|
132 void EnableDisplayL( TBool aEnable ); |
|
133 |
|
134 TBool IsDisplayEnabled(); |
|
135 |
|
136 TDisplayOrientation OrientationL(); |
|
137 |
|
138 void SetOrientationL( TDisplayOrientation aOrientation ); |
|
139 |
|
140 TBool IsDisplayActive(); |
|
141 |
|
142 public: |
|
143 |
|
144 TRect iRect; |
|
145 TRect iSecondaryRect; |
|
146 TBool iIsEnabled; |
|
147 TDisplayOrientation iOrientation; |
|
148 TBool iIsActive; |
|
149 }; |
|
150 |
|
151 class CLcSessionObserverStub : public CBase, public MLcSessionObserver |
|
152 { |
|
153 public: // Constructors and destructor |
|
154 |
|
155 CLcSessionObserverStub(); |
|
156 ~CLcSessionObserverStub(); |
|
157 |
|
158 public: // From MLcSessionObserver |
|
159 |
|
160 void StateChanged( MLcSession& aSession ); |
|
161 |
|
162 void StateChanged( MLcVideoPlayer& aPlayer ); |
|
163 |
|
164 void Updated( MLcSession& aSession ); |
|
165 |
|
166 void Updated( MLcVideoPlayer& aPlayer ); |
|
167 |
|
168 void Failed( |
|
169 MLcSession& aSession, |
|
170 TInt aError ); |
|
171 |
|
172 void Failed( |
|
173 MLcVideoPlayer& aPlayer, |
|
174 TInt aError ); |
|
175 |
|
176 void SessionTimeChanged( |
|
177 MLcSession& aSession, |
|
178 const TTimeIntervalSeconds& aSeconds ); |
|
179 |
|
180 public: // New functions |
|
181 |
|
182 void Reset(); |
|
183 TBool IsReseted(); |
|
184 |
|
185 public: // Data |
|
186 |
|
187 enum TCalledFunction |
|
188 { |
|
189 EUnknown, |
|
190 ESessionStateChanged, |
|
191 EPlayerStateChanged, |
|
192 ESessionUpdated, |
|
193 EPlayerUpdated, |
|
194 ESessionFailed, |
|
195 EPlayerFailed, |
|
196 ESessionTimeChanged |
|
197 }; |
|
198 |
|
199 TInt iCalledFunction; |
|
200 MLcSession* iCurrentSession; |
|
201 MLcVideoPlayer* iCurrentPlayer; |
|
202 TInt iSessionTime; |
|
203 TInt iError; |
|
204 }; |
|
205 |
|
206 |
|
207 class CLcUiProviderStub : public CBase, public MLcUiProvider |
|
208 { |
|
209 public: // Constructors and destructor |
|
210 |
|
211 CLcUiProviderStub(); |
|
212 ~CLcUiProviderStub(); |
|
213 |
|
214 public: // From MLcUiProvider |
|
215 |
|
216 TBool SelectRecipient( |
|
217 MDesCArray& aRecipientAddresses, |
|
218 TDes& aSelectedRecipientAddress ); |
|
219 |
|
220 TBool InputRecipient( TDes& aRecipientAddress ); |
|
221 |
|
222 void HandleForegroundStatus( TBool aForeground ); |
|
223 |
|
224 void BlockUi( TBool aBlocked ); |
|
225 |
|
226 public: // New functions |
|
227 |
|
228 void Reset(); |
|
229 |
|
230 public: // Data |
|
231 |
|
232 enum TCalledFunction |
|
233 { |
|
234 EUnknown, |
|
235 ESelectRecipient, |
|
236 EInputRecipient, |
|
237 EHandleForegroundStatus |
|
238 }; |
|
239 |
|
240 TInt iForeground; |
|
241 TInt iCalledFunction; |
|
242 TPtrC iRecipient; |
|
243 TBool iSimulatedReturnValue; |
|
244 }; |
|
245 |
|
246 |
|
247 class TLcWindowStub : public MLcWindow |
|
248 { |
|
249 public: // Constructor |
|
250 TLcWindowStub(); |
|
251 |
|
252 public: // From MLcWindow |
|
253 void EnableLcWindowL( TBool aEnable ); |
|
254 TBool IsLcWindowEnabled(); |
|
255 void SetLcWindowRectL( TRect aRect ); |
|
256 TRect LcWindowRect(); |
|
257 void SetLcWindowOrientationL( TLcWindowOrientation aOrientation ); |
|
258 TLcWindowOrientation LcWindowOrientationL(); |
|
259 |
|
260 public: // New functions |
|
261 |
|
262 void Reset(); |
|
263 |
|
264 private: // Data |
|
265 TBool iEnabled; |
|
266 TRect iRect; |
|
267 TLcWindowOrientation iOrientation; |
|
268 }; |
|
269 |
|
270 |
|
271 class TLcAudioControlStub : public MLcAudioControl |
|
272 { |
|
273 public: // Constructor |
|
274 TLcAudioControlStub(); |
|
275 |
|
276 public: |
|
277 TBool IsLcAudioMutedL(); |
|
278 void MuteLcAudioL( TBool aMute ); |
|
279 TBool IsLcMicMutedL(); |
|
280 void MuteLcMicL( TBool aMute ); |
|
281 TBool IsEnablingLcLoudspeakerAllowed(); |
|
282 void EnableLcLoudspeakerL( TBool aEnabled ); |
|
283 TBool IsLcLoudspeakerEnabled(); |
|
284 TInt LcVolumeL(); |
|
285 void SetLcVolumeL( TInt aValue ); |
|
286 void IncreaseLcVolumeL(); |
|
287 void DecreaseLcVolumeL(); |
|
288 |
|
289 public: // New functions |
|
290 |
|
291 void Reset(); |
|
292 |
|
293 private: // Data |
|
294 TBool iAudioMuted; |
|
295 TBool iMicMuted; |
|
296 TBool iEnablingLoudspeakerAllowed; |
|
297 TBool iLoudspeakerEnabled; |
|
298 TInt iVolume; |
|
299 }; |
|
300 |
|
301 class TMusPropertyObserverStub : public MMusPropertyObserver |
|
302 { |
|
303 public: |
|
304 |
|
305 enum TMusPropertyObserverFunction |
|
306 { |
|
307 ENone, // default value |
|
308 EPropertyChanged, |
|
309 EHandlePropertyError |
|
310 }; |
|
311 |
|
312 |
|
313 TMusPropertyObserverStub() |
|
314 { |
|
315 iCalledFunction = ENone; |
|
316 iKey = 0; |
|
317 iValue = 0; |
|
318 iReason = 0; |
|
319 } |
|
320 |
|
321 void PropertyChanged( const TUint aKey, const TInt aValue ) |
|
322 { |
|
323 iCalledFunction = EPropertyChanged; |
|
324 iKey = aKey; |
|
325 iValue = aValue; |
|
326 } |
|
327 |
|
328 |
|
329 void HandlePropertyError( const TInt aReason ) |
|
330 { |
|
331 iCalledFunction = EHandlePropertyError; |
|
332 iReason = aReason; |
|
333 } |
|
334 |
|
335 public: // data |
|
336 |
|
337 TMusPropertyObserverFunction iCalledFunction; |
|
338 TInt iKey; |
|
339 TInt iValue; |
|
340 TInt iReason; |
|
341 }; |
|
342 |
|
343 |
|
344 // Dummy implementations |
|
345 inline void CActiveScheduler::Start() |
|
346 { |
|
347 } |
|
348 |
|
349 inline void CActiveScheduler::Stop() |
|
350 { |
|
351 } |
|
352 |
|
353 |
|
354 #endif // UT_MUSSTUBS_H |
|
355 |