1 /* |
|
2 * Copyright (c) 2010 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: Unit test for satappmainhandler |
|
15 * |
|
16 */ |
|
17 |
|
18 #include <QTimer> |
|
19 #include "ut_satapptoneprovider.h" |
|
20 #include "satapptoneprovider.h" |
|
21 #include "satappaction.h" |
|
22 |
|
23 // ----------------------------------------------------------------------------- |
|
24 // Ut_SatAppToneProvider::Ut_SatAppToneProvider |
|
25 // ----------------------------------------------------------------------------- |
|
26 // |
|
27 Ut_SatAppToneProvider::Ut_SatAppToneProvider(QObject *parent):QObject(parent) |
|
28 { |
|
29 } |
|
30 |
|
31 // ----------------------------------------------------------------------------- |
|
32 // Ut_SatAppToneProvider::testCreateProvider |
|
33 // |
|
34 // Connects to test object signal and verifies received data. |
|
35 // ----------------------------------------------------------------------------- |
|
36 void Ut_SatAppToneProvider::testCreateProvider_data() |
|
37 { |
|
38 QTest::addColumn<bool>("timer"); |
|
39 QTest::newRow("t01") << false; |
|
40 QTest::newRow("t01") << true; |
|
41 } |
|
42 |
|
43 // ----------------------------------------------------------------------------- |
|
44 // Ut_SatAppToneProvider::testCreateProvider |
|
45 // |
|
46 // Connects to test object signal and verifies received data. |
|
47 // ----------------------------------------------------------------------------- |
|
48 void Ut_SatAppToneProvider::testCreateProvider() |
|
49 { |
|
50 QFETCH(bool, timer); |
|
51 ToneProviderTest test; |
|
52 if(timer){ |
|
53 test.ConstructTimer(false); |
|
54 } |
|
55 QVERIFY(test.mTone); |
|
56 } |
|
57 |
|
58 // ----------------------------------------------------------------------------- |
|
59 // Ut_SatAppToneProvider::testClearScreen |
|
60 // |
|
61 // Connects to test object signal and verifies received data. |
|
62 // ----------------------------------------------------------------------------- |
|
63 void Ut_SatAppToneProvider::testClearScreen() |
|
64 { |
|
65 ToneProviderTest test; |
|
66 test.mTone->clearScreen(); |
|
67 QVERIFY(!test.isMessageBoxShown()); |
|
68 QVERIFY(!test.isTimerActive()); |
|
69 } |
|
70 |
|
71 |
|
72 // ----------------------------------------------------------------------------- |
|
73 // Ut_SatAppToneProvider::testPlayTone_data |
|
74 // |
|
75 // Connects to test object signal and verifies received data. |
|
76 // ----------------------------------------------------------------------------- |
|
77 void Ut_SatAppToneProvider::testPlayTone_data() |
|
78 { |
|
79 QTest::addColumn<QString>("text"); |
|
80 QTest::addColumn<int>("tone"); |
|
81 QTest::addColumn<int>("duration"); |
|
82 QTest::addColumn<int>("exp_result"); |
|
83 |
|
84 QTest::newRow("t01") << "Standard" << 0x01 << 0 << 0x32; // exp result changed |
|
85 QTest::newRow("t02") << "Standard" << 0x02 << 100 << 0; |
|
86 QTest::newRow("t03") << "Standard" << 0x03 << 1000 << 0; |
|
87 QTest::newRow("t04") << "Standard" << 0x04 << 0 << 0; |
|
88 QTest::newRow("t05") << "Standard" << 0x05 << 100 << 0; |
|
89 QTest::newRow("t06") << "Standard" << 0x07 << 1000 << 0; |
|
90 QTest::newRow("t07") << "" << 0x07 << 100 << 0; |
|
91 QTest::newRow("t08") << "" << 0x08 << 500 << 0; |
|
92 QTest::newRow("t09") << "" << 0x09 << 1000 << 0x32; // exp result changed |
|
93 QTest::newRow("t10") << "User" << 0x13 << 1000 << 0; |
|
94 QTest::newRow("t11") << "User" << 0x14 << 500 << 0; |
|
95 QTest::newRow("t12") << "Illegal" << 0x99 << 100 << 0x32; |
|
96 } |
|
97 |
|
98 // ----------------------------------------------------------------------------- |
|
99 // Ut_SatAppToneProvider::testPlayTone |
|
100 // ----------------------------------------------------------------------------- |
|
101 void Ut_SatAppToneProvider::testPlayTone() |
|
102 { |
|
103 QFETCH(QString, text); |
|
104 QFETCH(int, tone); |
|
105 QFETCH(int, duration); |
|
106 QFETCH(int, exp_result); |
|
107 |
|
108 ToneProviderTest test; |
|
109 TSatUiResponse resp(ESatSuccess); |
|
110 |
|
111 SatAppAction action(ESatPlayToneAction); |
|
112 action.set(KeyToneId,tone); |
|
113 action.set(KeyDuration,duration); |
|
114 action.set(KeyText,text); |
|
115 test.mTone->playTone(action); |
|
116 action.waitUntilCompleted(); |
|
117 resp = action.response(); |
|
118 |
|
119 QCOMPARE((int)resp, exp_result); |
|
120 } |
|
121 |
|
122 // ----------------------------------------------------------------------------- |
|
123 // Ut_SatAppToneProvider::testplayStandardTone_data |
|
124 // |
|
125 // Connects to test object signal and verifies received data. |
|
126 // ----------------------------------------------------------------------------- |
|
127 void Ut_SatAppToneProvider::testplayDoubleTone_data() |
|
128 { |
|
129 QTest::addColumn<QString>("text"); |
|
130 QTest::addColumn<int>("tone"); |
|
131 QTest::addColumn<int>("duration"); |
|
132 QTest::addColumn<bool>("timer"); |
|
133 QTest::addColumn<bool>("active"); |
|
134 |
|
135 QTest::newRow("t01") << "Standard" << 0x10 << 0 << false << false; |
|
136 QTest::newRow("t02") << "Standard" << 0x10 << 0 << true << true; |
|
137 QTest::newRow("t03") << "Standard" << 0x10 << 0 << true << false; |
|
138 QTest::newRow("t04") << "Standard" << 0x13 << 0 << false << false; |
|
139 QTest::newRow("t04") << "Standard" << 0x14 << 0 << true << true; |
|
140 QTest::newRow("t04") << "" << 0x13 << 0 << true << false; |
|
141 |
|
142 } |
|
143 |
|
144 // ----------------------------------------------------------------------------- |
|
145 // Ut_SatAppToneProvider::testplayStandardTone |
|
146 // ----------------------------------------------------------------------------- |
|
147 void Ut_SatAppToneProvider::testplayDoubleTone() |
|
148 { |
|
149 QFETCH(QString, text); |
|
150 QFETCH(int, tone); |
|
151 QFETCH(int, duration); |
|
152 QFETCH(bool, timer); |
|
153 QFETCH(bool, active); |
|
154 |
|
155 ToneProviderTest test; |
|
156 TSatUiResponse resp(ESatSuccess); |
|
157 if(timer){ |
|
158 test.ConstructTimer(active); |
|
159 } |
|
160 |
|
161 SatAppAction action(ESatPlayToneAction); |
|
162 action.set(KeyToneId,tone); |
|
163 action.set(KeyDuration,duration); |
|
164 action.set(KeyText,text); |
|
165 test.mTone->playTone(action); |
|
166 action.waitUntilCompleted(); |
|
167 resp = action.response(); |
|
168 } |
|
169 |
|
170 // ----------------------------------------------------------------------------- |
|
171 // Ut_SatAppToneProvider::testPlayToneAndClearScreen |
|
172 // ----------------------------------------------------------------------------- |
|
173 void Ut_SatAppToneProvider::testPlayToneAndClearScreen() |
|
174 { |
|
175 ToneProviderTest test; |
|
176 |
|
177 // timer for clearing screen after 1 sec. |
|
178 QTimer::singleShot(1000, test.mTone, SLOT(clearScreen())); |
|
179 |
|
180 // start playing |
|
181 TSatUiResponse result(ESatFailure); |
|
182 SatAppAction action(ESatPlayToneAction); |
|
183 action.set(KeyToneId,0x01); |
|
184 action.set(KeyDuration,3000); |
|
185 action.set(KeyText,QString("play")); |
|
186 test.mTone->playTone(action); |
|
187 action.waitUntilCompleted(); |
|
188 result = action.response(); |
|
189 |
|
190 // QCOMPARE(result, ESatSuccessToneNotPlayed); TODO:which? |
|
191 QCOMPARE(result, ESatSuccess); |
|
192 } |
|
193 |
|
194 // ----------------------------------------------------------------------------- |
|
195 // Ut_SatAppToneProvider::testMatoPlayComplete_data |
|
196 // |
|
197 // Connects to test object signal and verifies received data. |
|
198 // ----------------------------------------------------------------------------- |
|
199 void Ut_SatAppToneProvider::testMatoPrepareComplete_data() |
|
200 { |
|
201 QTest::addColumn<int>("error"); |
|
202 QTest::addColumn<bool>("tone"); |
|
203 QTest::newRow("error_0") << 0 << true; |
|
204 QTest::newRow("error_-1") << -1 << false; |
|
205 QTest::newRow("error_-2") << 0 << false; |
|
206 } |
|
207 |
|
208 // ----------------------------------------------------------------------------- |
|
209 // Ut_SatAppToneProvider::testMatoPlayComplete |
|
210 // |
|
211 // Connects to test object signal and verifies received data. |
|
212 // ----------------------------------------------------------------------------- |
|
213 void Ut_SatAppToneProvider::testMatoPrepareComplete() |
|
214 { |
|
215 QFETCH(int, error); |
|
216 QFETCH(bool, tone); |
|
217 ToneProviderTest test; |
|
218 |
|
219 if(tone) |
|
220 test.ConstructAudioTone(); |
|
221 |
|
222 test.mTone->MatoPrepareComplete(error); |
|
223 |
|
224 test.DestroyAudioTone(); |
|
225 } |
|
226 |
|
227 //// ----------------------------------------------------------------------------- |
|
228 //// Ut_SatAppToneProvider::testMatoPlayComplete_data |
|
229 //// |
|
230 //// Connects to test object signal and verifies received data. |
|
231 //// ----------------------------------------------------------------------------- |
|
232 //void Ut_SatAppToneProvider::testMatoPlayComplete_data() |
|
233 //{ |
|
234 // QTest::addColumn<int>("error"); |
|
235 // QTest::addColumn<bool>("tone"); |
|
236 // QTest::newRow("error_0") << 0 << true; |
|
237 // QTest::newRow("error_-1") << -1 << false; |
|
238 // QTest::newRow("error_-2") << 0 << false; |
|
239 //} |
|
240 // |
|
241 //// ----------------------------------------------------------------------------- |
|
242 //// Ut_SatAppToneProvider::testMatoPlayComplete |
|
243 //// |
|
244 //// Connects to test object signal and verifies received data. |
|
245 //// ----------------------------------------------------------------------------- |
|
246 //void Ut_SatAppToneProvider::testMatoPlayComplete() |
|
247 //{ |
|
248 // QFETCH(int, error); |
|
249 // QFETCH(bool, tone); |
|
250 // ToneProviderTest test; |
|
251 // |
|
252 // if(tone) |
|
253 // test.ConstructAudioTone(); |
|
254 // |
|
255 // test.mTone->MatoPrepareComplete(error); |
|
256 // test.mTone->MatoPlayComplete(error); |
|
257 // |
|
258 // test.DestroyAudioTone(); |
|
259 //} |
|
260 // |
|
261 //// ----------------------------------------------------------------------------- |
|
262 //// Ut_SatAppToneProvider::testMapcPlayComplete_data |
|
263 //// |
|
264 //// Connects to test object signal and verifies received data. |
|
265 //// ----------------------------------------------------------------------------- |
|
266 //void Ut_SatAppToneProvider::testMapcPlayComplete_data() |
|
267 //{ |
|
268 // QTest::addColumn<bool>("player"); |
|
269 // QTest::newRow("t_true") << true; |
|
270 // QTest::newRow("t_false") << false; |
|
271 //} |
|
272 // |
|
273 //// ----------------------------------------------------------------------------- |
|
274 //// Ut_SatAppToneProvider::testMapcPlayComplete |
|
275 //// |
|
276 //// Connects to test object signal and verifies received data. |
|
277 //// ----------------------------------------------------------------------------- |
|
278 //void Ut_SatAppToneProvider::testMapcPlayComplete() |
|
279 //{ |
|
280 // QFETCH(bool, player); |
|
281 // TInt error = 0; |
|
282 // ToneProviderTest test; |
|
283 // |
|
284 // if(player) |
|
285 // test.ConstructAudioPlayer(); |
|
286 // |
|
287 // test.mTone->MapcPlayComplete(error); |
|
288 // |
|
289 // test.DestroyAudioPlayer(); |
|
290 //} |
|
291 |
|
292 // ----------------------------------------------------------------------------- |
|
293 // Ut_SatAppToneProvider::testMapcInitComplete_data |
|
294 // |
|
295 // Connects to test object signal and verifies received data. |
|
296 // ----------------------------------------------------------------------------- |
|
297 void Ut_SatAppToneProvider::testMapcInitComplete_data() |
|
298 { |
|
299 QTest::addColumn<int>("error"); |
|
300 QTest::addColumn<bool>("player"); |
|
301 QTest::newRow("error_0") << 0 << false; |
|
302 QTest::newRow("error_-6") << -6 << true; |
|
303 QTest::newRow("error_-6") << -6 << false; |
|
304 } |
|
305 |
|
306 // ----------------------------------------------------------------------------- |
|
307 // Ut_SatAppToneProvider::testMapcInitComplete |
|
308 // |
|
309 // Connects to test object signal and verifies received data. |
|
310 // ----------------------------------------------------------------------------- |
|
311 void Ut_SatAppToneProvider::testMapcInitComplete() |
|
312 { |
|
313 QFETCH(int, error); |
|
314 QFETCH(bool, player); |
|
315 ToneProviderTest test; |
|
316 |
|
317 if(player) |
|
318 test.ConstructAudioPlayer(); |
|
319 |
|
320 test.mTone->MapcInitComplete(error, 0); |
|
321 |
|
322 test.DestroyAudioPlayer(); |
|
323 } |
|
324 |
|
325 // ----------------------------------------------------------------------------- |
|
326 // Ut_SatAppToneProvider::testRecognizeTone_data |
|
327 // |
|
328 // Connects to test object signal and verifies received data. |
|
329 // ----------------------------------------------------------------------------- |
|
330 void Ut_SatAppToneProvider::testRecognizeTone_data() |
|
331 { |
|
332 QTest::addColumn<int>("tone"); |
|
333 QTest::addColumn<int>("duration"); |
|
334 |
|
335 QTest::newRow("t01") << -1 << 0; |
|
336 QTest::newRow("t01") << -1 << 1; |
|
337 QTest::newRow("t01") << 0x01 << 0; |
|
338 QTest::newRow("t01") << 0x01 << 1; |
|
339 QTest::newRow("t01") << 0x02 << 0; |
|
340 QTest::newRow("t01") << 0x02 << 1; |
|
341 QTest::newRow("t01") << 0x03 << 0; |
|
342 QTest::newRow("t01") << 0x03 << 1; |
|
343 QTest::newRow("t01") << 0x04 << 0; |
|
344 QTest::newRow("t01") << 0x04 << 1; |
|
345 QTest::newRow("t01") << 0x05 << 0; |
|
346 QTest::newRow("t01") << 0x05 << 1; |
|
347 QTest::newRow("t01") << 0x06 << 0; |
|
348 QTest::newRow("t01") << 0x06 << 1; |
|
349 QTest::newRow("t01") << 0x07 << 0; |
|
350 QTest::newRow("t01") << 0x07 << 1; |
|
351 QTest::newRow("t01") << 0x08 << 0; |
|
352 QTest::newRow("t01") << 0x08 << 1; |
|
353 QTest::newRow("t01") << 0x09 << 0; |
|
354 |
|
355 QTest::newRow("t01") << 0x10 << 0; |
|
356 QTest::newRow("t01") << 0x10 << 1; |
|
357 QTest::newRow("t01") << 0x11 << 0; |
|
358 QTest::newRow("t01") << 0x11 << 1; |
|
359 QTest::newRow("t01") << 0x12 << 0; |
|
360 QTest::newRow("t01") << 0x12 << 1; |
|
361 QTest::newRow("t02") << 0x13 << 0; |
|
362 |
|
363 QTest::newRow("t02") << 0x14 << 0; |
|
364 |
|
365 |
|
366 } |
|
367 |
|
368 // ----------------------------------------------------------------------------- |
|
369 // Ut_SatAppToneProvider::testRecognizeTone |
|
370 // |
|
371 // Connects to test object signal and verifies received data. |
|
372 // ----------------------------------------------------------------------------- |
|
373 void Ut_SatAppToneProvider::testRecognizeTone() |
|
374 { |
|
375 QFETCH(int, tone); |
|
376 QFETCH(int, duration); |
|
377 |
|
378 ToneProviderTest test; |
|
379 test.TestRecognizeTone(tone, duration); |
|
380 } |
|
381 |
|
382 // ----------------------------------------------------------------------------- |
|
383 // Ut_SatAppToneProvider::testPrepareAudioToneUtility |
|
384 // |
|
385 // Connects to test object signal and verifies received data. |
|
386 // ----------------------------------------------------------------------------- |
|
387 void Ut_SatAppToneProvider::testPrepareAudioToneUtility() |
|
388 { |
|
389 ToneProviderTest test; |
|
390 test.ConstructAudioTone(); |
|
391 test.ConstructAudioTone(); |
|
392 } |
|
393 |
|
394 // --------------------------------------------------------------- |
|
395 // internal helper class |
|
396 // --------------------------------------------------------------- |
|
397 |
|
398 ToneProviderTest::ToneProviderTest() |
|
399 { |
|
400 mTone = new SatAppToneProvider(this); |
|
401 } |
|
402 |
|
403 ToneProviderTest::~ToneProviderTest() |
|
404 { |
|
405 cleanup(); |
|
406 } |
|
407 |
|
408 /** |
|
409 * Singleton Pattern - not used |
|
410 */ |
|
411 SatAppToneProvider* ToneProviderTest::getToneInstance() |
|
412 { |
|
413 |
|
414 } |
|
415 |
|
416 bool ToneProviderTest::isMessageBoxShown() |
|
417 { |
|
418 if (mTone->mPermanentNote) { |
|
419 return true; |
|
420 } |
|
421 return false; |
|
422 } |
|
423 |
|
424 bool ToneProviderTest::isTimerActive() |
|
425 { |
|
426 if (mTone->mTimer && mTone->mTimer->isActive()) { |
|
427 return true; |
|
428 } |
|
429 return false; |
|
430 } |
|
431 |
|
432 void ToneProviderTest::ConstructAudioTone() |
|
433 { |
|
434 QByteArray sequence; |
|
435 sequence = KNetToneSeqDial; |
|
436 TPtrC8 seq((unsigned char*)sequence.constData(),sequence.length()); |
|
437 if(mTone) |
|
438 QT_TRAP_THROWING(mTone->SymbianPrepareAudioToneUtilityL(seq)); |
|
439 } |
|
440 |
|
441 void ToneProviderTest::DestroyAudioTone() |
|
442 { |
|
443 if(mTone) |
|
444 mTone->SymbianStopAudioToneUtility(); |
|
445 } |
|
446 |
|
447 void ToneProviderTest::ConstructAudioPlayer() |
|
448 { |
|
449 int tone = ESatToneNotSet; |
|
450 int duration = 0; |
|
451 if(mTone) |
|
452 QT_TRAP_THROWING(mTone->SymbianPrepareAudioPlayerL(tone,duration)); |
|
453 } |
|
454 |
|
455 void ToneProviderTest::DestroyAudioPlayer() |
|
456 { |
|
457 if(mTone) |
|
458 mTone->SymbianStopAudioPlayer(); |
|
459 } |
|
460 |
|
461 void ToneProviderTest::ConstructTimer(bool active) |
|
462 { |
|
463 mTone->mTimer = new QTimer(mTone); |
|
464 connect(mTone->mTimer, SIGNAL(timeout()), |
|
465 mTone, SLOT(stopPlayTone())); |
|
466 if(active) |
|
467 mTone->mTimer->start(3000); |
|
468 } |
|
469 |
|
470 void ToneProviderTest::DestroyTimer() |
|
471 { |
|
472 |
|
473 } |
|
474 |
|
475 void ToneProviderTest::SetPlayToneResult(TSatUiResponse error) |
|
476 { |
|
477 mTone->mPlayToneError = error; |
|
478 } |
|
479 |
|
480 void ToneProviderTest::TestRecognizeTone(int tone, int duration) |
|
481 { |
|
482 QByteArray sequence; |
|
483 mTone->recognizeTone(tone, sequence, duration); |
|
484 } |
|
485 |
|
486 void ToneProviderTest::cleanup() |
|
487 { |
|
488 delete mTone; |
|
489 mTone = 0; |
|
490 } |
|
491 |
|
492 // **************************************************************************** |
|
493 // * ************************************************************************ * |
|
494 // * * SYMBIAN MOC PART * * |
|
495 // * ************************************************************************ * |
|
496 // **************************************************************************** |
|
497 |
|
498 |
|
499 // includes |
|
500 #include <e32cmn.h> |
|
501 #include <MProfile.h> |
|
502 #include <MProfileEngine.h> |
|
503 #include <MProfileTones.h> |
|
504 #include <TProfileToneSettings.h> |
|
505 #include <mdaaudiotoneplayer.h> //MMdaAudioToneObserver |
|
506 |
|
507 class CMocProfileTones : public MProfileTones |
|
508 { |
|
509 public: |
|
510 CMocProfileTones() |
|
511 { |
|
512 // Set TProfileToneSettings with specified value |
|
513 iToneSettings.iWarningAndGameTones = EFalse; |
|
514 TBuf<256> ringTone(_L("Z:\\Data\\Sounds\\Digital\\Nokia tune.aac")); |
|
515 TBuf<256> alertTone(_L("Z:\\Data\\Sounds\\Digital\\Message 1.aac")); |
|
516 iTone = ringTone; |
|
517 } |
|
518 virtual ~CMocProfileTones() {} |
|
519 |
|
520 public: |
|
521 virtual const TDesC& RingingTone1() const |
|
522 { |
|
523 //DONE |
|
524 return iTone; |
|
525 } |
|
526 virtual const TDesC& RingingTone2() const |
|
527 { |
|
528 //DONE |
|
529 return iTone; |
|
530 } |
|
531 virtual const TDesC& MessageAlertTone() const |
|
532 { |
|
533 //DONE |
|
534 return iTone; |
|
535 } |
|
536 virtual const TProfileToneSettings& ToneSettings() const |
|
537 { |
|
538 //DONE: Return TProfileToneSettings |
|
539 return iToneSettings; |
|
540 } |
|
541 private: |
|
542 TProfileToneSettings iToneSettings; |
|
543 TBuf<256> iTone; |
|
544 }; |
|
545 |
|
546 class CMocProFile : public MProfile |
|
547 { |
|
548 public: |
|
549 static CMocProFile* NewLC() |
|
550 { |
|
551 CMocProFile* self = new( ELeave ) CMocProFile; |
|
552 CleanupStack::PushL( self ); |
|
553 self->ConstructL(); |
|
554 return self; |
|
555 } |
|
556 virtual ~CMocProFile() {} |
|
557 protected: |
|
558 CMocProFile() {} |
|
559 void ConstructL() |
|
560 { |
|
561 iTones = new(ELeave) CMocProfileTones; |
|
562 } |
|
563 |
|
564 public: // New functions |
|
565 virtual void Release() {} |
|
566 virtual const TArray<TContactItemId> AlertForL() {} |
|
567 virtual TBool IsSilent() const { return EFalse; } |
|
568 virtual const MProfileName& ProfileName() const {} |
|
569 virtual const MProfileTones& ProfileTones() const |
|
570 { |
|
571 //DONE: return an MProfileTones object |
|
572 return *iTones; |
|
573 } |
|
574 virtual const MProfileExtraTones& ProfileExtraTones() const {} |
|
575 virtual const MProfileExtraSettings& ProfileExtraSettings() const {} |
|
576 |
|
577 private: |
|
578 MProfileTones* iTones; |
|
579 }; |
|
580 |
|
581 class CMocProfileEngine : public MProfileEngine |
|
582 { |
|
583 public: |
|
584 CMocProfileEngine() {}; |
|
585 virtual ~CMocProfileEngine() {}; |
|
586 public: |
|
587 virtual void Release() {}; |
|
588 virtual MProfile* ActiveProfileLC() |
|
589 { |
|
590 //DONE: Create an MProfile object |
|
591 MProfile* pf = CMocProFile::NewLC(); |
|
592 return pf; |
|
593 } |
|
594 virtual MProfile* ActiveProfileL() { return NULL; }; |
|
595 virtual TInt ActiveProfileId() { return 0; }; |
|
596 virtual MProfilesNamesArray* ProfilesNamesArrayLC() { return NULL; }; |
|
597 virtual void SetActiveProfileL( TInt /*aId*/ ) {}; |
|
598 virtual void SetTempRingingVolumeL( TProfileRingingVolume /*aVolume*/ ) {}; |
|
599 virtual TProfileRingingVolume TempRingingVolumeL() const { |
|
600 return EProfileRingingVolumeLevel1; |
|
601 } |
|
602 virtual void SetTempMediaVolumeL( TProfileRingingVolume /*aVolume*/ ) {}; |
|
603 virtual TProfileRingingVolume TempMediaVolumeL() const { |
|
604 return EProfileRingingVolumeLevel1; |
|
605 } |
|
606 virtual TBool IsFeatureSupported( |
|
607 TProfileFeatureId /*aFeatureId*/ ) const { return EFalse; }; |
|
608 virtual TBool IsActiveProfileTimedL() { return EFalse; }; |
|
609 |
|
610 }; |
|
611 |
|
612 // ---------------------------------------------------------------------------- |
|
613 // CreateProfileEngineL moc |
|
614 // create profile engine |
|
615 // ---------------------------------------------------------------------------- |
|
616 // |
|
617 //MProfileEngine* CreateProfileEngineL() |
|
618 // { |
|
619 // |
|
620 // MProfileEngine* pe = new( ELeave ) CMocProfileEngine; |
|
621 // return pe; |
|
622 // } |
|
623 |
|
624 // End of file |
|
625 |
|