|
1 /* |
|
2 * Copyright (c) 2000-2009 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 the License "Symbian Foundation License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef __CT_LBS_CLIENT_POS_HOLDER_H__ |
|
21 #define __CT_LBS_CLIENT_POS_HOLDER_H__ |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include "ctlbsportedstepbase.h" |
|
26 |
|
27 // CONSTANTS |
|
28 |
|
29 // FUNCTION TYPES |
|
30 |
|
31 // FORWARD DECLARATIONS |
|
32 class CPositionInfo; |
|
33 class CPositioner; |
|
34 class CT_LbsPosClient; |
|
35 |
|
36 // CLASS DECLARATION |
|
37 |
|
38 /** |
|
39 * Active object used to make position requests |
|
40 * |
|
41 */ |
|
42 class CT_LbsPosClientHolder : public CActive |
|
43 { |
|
44 public: // Constructors and destructor |
|
45 |
|
46 /** |
|
47 * C++ default constructor. |
|
48 */ |
|
49 static CT_LbsPosClientHolder* NewLC( |
|
50 TInt aRequestCount = 1, TUid aPsy = TUid::Uid(KUidDynDbTestPsy), TBool aSameServer = EFalse); |
|
51 |
|
52 /** |
|
53 * Destructor. |
|
54 */ |
|
55 ~CT_LbsPosClientHolder(); |
|
56 |
|
57 private: |
|
58 |
|
59 void ConstructL(TInt aRequestCount, TUid aPsy, TBool aSameServer); |
|
60 |
|
61 /** |
|
62 * C++ default constructor. |
|
63 */ |
|
64 CT_LbsPosClientHolder(); |
|
65 |
|
66 public: // Functions from base classes |
|
67 |
|
68 /** |
|
69 * Starts a position request |
|
70 */ |
|
71 void MakeRequests(); |
|
72 |
|
73 void StopRequests(); |
|
74 |
|
75 void SetCancelTime(TTimeIntervalMicroSeconds32 aTimeInterval); |
|
76 |
|
77 /** |
|
78 * Get result |
|
79 */ |
|
80 void GetResult( |
|
81 TInt& aStatus, |
|
82 TPositionInfo& aModuleInfo, |
|
83 TTimeIntervalMicroSeconds& aRequestTime, |
|
84 TInt aRequesterIndex = 0 |
|
85 ); |
|
86 |
|
87 void HandleRequestDone(); |
|
88 |
|
89 void SetRequesterWillCancelL( |
|
90 TInt aIndex = 0 |
|
91 ); |
|
92 |
|
93 protected: |
|
94 |
|
95 void RunL(); |
|
96 |
|
97 void DoCancel(); |
|
98 |
|
99 private: |
|
100 |
|
101 RPointerArray<CT_LbsPosClient> iRequesters; |
|
102 RPositionServer iPosServer; |
|
103 TInt iNofRequestsDone; |
|
104 RTimer iTimer; |
|
105 RArray<TInt> iRequestersWhoWillCancel; |
|
106 TBool iRequestsActive; |
|
107 TTimeIntervalMicroSeconds32 iCancelTime; |
|
108 }; |
|
109 |
|
110 #endif // __CT_LBS_CLIENT_POS_HOLDER_H__ |
|
111 |
|
112 // End of File |