|
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef __CT_LBS_TEST_ACTIVE_MANAGER_H__ |
|
17 #define __CT_LBS_TEST_ACTIVE_MANAGER_H__ |
|
18 |
|
19 #include <e32base.h> |
|
20 #include <lbs/test/posserverwatch.h> |
|
21 #include "ctlbshybridmolrstep.h" |
|
22 |
|
23 class MTestFlowObserver |
|
24 { |
|
25 public: |
|
26 virtual void OnReadyL(TInt aObjectId) = 0; |
|
27 virtual void OnTimedOutL(TInt aObjectId) = 0; |
|
28 virtual void OnGetLastKnownPositionL(TInt aObjectId, TInt32 aErr, const TPositionInfoBase& aPosInfo) = 0; |
|
29 virtual void OnNotifyPositionUpdateL(TInt aObjectId, TInt32 aErr, const TPositionInfoBase& aPosInfo) = 0; |
|
30 virtual void StopTest() = 0; |
|
31 virtual void OnSignalNetworkStep(TInt aSessionId, TInt aSessionStep) = 0; |
|
32 }; |
|
33 |
|
34 class CT_LbsTestActiveManager : public CTimer, public MPosServerObserver |
|
35 { |
|
36 public: |
|
37 static CT_LbsTestActiveManager* NewL(TInt aObjectId, MTestFlowObserver& aObserver, TPriority aPriority, CTestStep& aStep); |
|
38 ~CT_LbsTestActiveManager(); |
|
39 |
|
40 void StartL(TTimeIntervalMicroSeconds32 aDelay); |
|
41 void WaitForPosition(TTimeIntervalMicroSeconds32 aDelay); |
|
42 void Deactivate(); |
|
43 TBool IsDeactivated(); |
|
44 |
|
45 // MPosServerObserver |
|
46 void OnGetLastKnownPosition(TInt32 aErr, const TPositionInfoBase& aPosInfo); |
|
47 void OnNotifyPositionUpdate(TInt32 aErr, const TPositionInfoBase& aPosInfo); |
|
48 |
|
49 private: |
|
50 CT_LbsTestActiveManager(TInt aObjectId, MTestFlowObserver& aObserver, TPriority aPriority, CTestStep& aStep); |
|
51 |
|
52 void RunL(); |
|
53 TInt RunError(TInt aError); |
|
54 |
|
55 |
|
56 private: |
|
57 enum TState |
|
58 { |
|
59 EStateNone, |
|
60 EStateWaitingToStart, |
|
61 EStateWaitingForPosition |
|
62 }; |
|
63 |
|
64 private: |
|
65 TState iState; |
|
66 TInt iObjectId; |
|
67 TBool iWaiting; |
|
68 TBool iIsDeactivated; |
|
69 MTestFlowObserver& iObserver; |
|
70 CTestStep& iStep; |
|
71 }; |
|
72 |
|
73 #endif __CT_LBS_TEST_ACTIVE_MANAGER_H__ |