20
|
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: This file contains testclass implementation.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#include <e32base.h>
|
|
19 |
#include <systemtoneservice.h>
|
|
20 |
#include "systemtoneservicesactiveobj.h"
|
|
21 |
|
21
|
22 |
|
|
23 |
CStsActiveObj::CStsActiveObj() : CActive (CActive::EPriorityStandard)
|
20
|
24 |
{
|
21
|
25 |
|
|
26 |
}
|
|
27 |
|
|
28 |
|
|
29 |
void CStsActiveObj::ConstructL(MStsPlayAlarmObserver* aObserver, CStifLogger* aLogger)
|
|
30 |
{
|
|
31 |
iObserver = aObserver;
|
|
32 |
iLog = aLogger;
|
20
|
33 |
CActiveScheduler::Add(this);
|
|
34 |
}
|
|
35 |
|
21
|
36 |
CStsActiveObj* CStsActiveObj::NewL( MStsPlayAlarmObserver* aTestClass, CStifLogger* aLogger)
|
|
37 |
{
|
|
38 |
CStsActiveObj* self = new ( ELeave ) CStsActiveObj();
|
|
39 |
CleanupStack::PushL( self );
|
|
40 |
self->ConstructL( aTestClass, aLogger);
|
|
41 |
CleanupStack::Pop( self );
|
|
42 |
return self;
|
20
|
43 |
|
21
|
44 |
}
|
20
|
45 |
|
|
46 |
CStsActiveObj::~ CStsActiveObj()
|
|
47 |
{
|
|
48 |
if(IsActive())
|
|
49 |
{
|
|
50 |
Cancel();
|
|
51 |
}
|
|
52 |
}
|
|
53 |
|
|
54 |
|
|
55 |
void CStsActiveObj::RunL()
|
|
56 |
{
|
21
|
57 |
/*(if(IsActive())
|
20
|
58 |
{
|
|
59 |
Cancel();
|
|
60 |
}
|
|
61 |
|
21
|
62 |
SetActive();*/
|
20
|
63 |
}
|
|
64 |
|
|
65 |
|
|
66 |
void CStsActiveObj::DoCancel()
|
|
67 |
{
|
|
68 |
if(IsActive())
|
|
69 |
{
|
|
70 |
Cancel();
|
|
71 |
}
|
|
72 |
}
|
|
73 |
|
|
74 |
|
|
75 |
TInt CStsActiveObj::RunError( TInt aError )
|
|
76 |
{
|
|
77 |
|
|
78 |
iObserver->PlayAlarmComplete(aError);
|
|
79 |
return aError;
|
|
80 |
}
|
|
81 |
|