|
1 /* |
|
2 * Copyright (c) 2007-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 "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 CPOSDEFAULTPOSITIONER_H |
|
21 #define CPOSDEFAULTPOSITIONER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <lbs/epos_mposmodulesobserver.h> |
|
25 #include "EPos_CProxyPositioner.h" |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class CPosModules; |
|
29 class CPosRequestController; |
|
30 |
|
31 // CLASS DECLARATION |
|
32 |
|
33 /** |
|
34 * The CPosDefaultPositioner is a proxy positioner that delegates all |
|
35 * incoming requests to the positioner in the modules list with highest priority. |
|
36 * This is done by using a CPosRequestController object which handles the |
|
37 * position request functionality. |
|
38 */ |
|
39 class CPosDefaultPositioner : public CProxyPositioner |
|
40 { |
|
41 public: // Constructors and destructor |
|
42 |
|
43 /** |
|
44 * Two-phased constructor. |
|
45 * |
|
46 * @param aConstructionParameters Construction parameters. |
|
47 */ |
|
48 static CPosDefaultPositioner* NewL( |
|
49 TAny* aConstructionParameters |
|
50 ); |
|
51 |
|
52 /** |
|
53 * Destructor. |
|
54 */ |
|
55 ~CPosDefaultPositioner(); |
|
56 |
|
57 public: // Functions from base classes |
|
58 |
|
59 /** |
|
60 * From CPositioner. |
|
61 * Requests position info asynchronously. |
|
62 * |
|
63 * @param aPosInfo A reference to a position info object. This object |
|
64 * must be in scope until the request has completed. |
|
65 * @param aStatus The request status |
|
66 * |
|
67 */ |
|
68 void NotifyPositionUpdate( |
|
69 TPositionInfoBase& aPosInfo, |
|
70 TRequestStatus& aStatus |
|
71 ); |
|
72 |
|
73 /** |
|
74 * From CPositioner. |
|
75 * Cancels position info request. |
|
76 */ |
|
77 void CancelNotifyPositionUpdate(); |
|
78 |
|
79 /** |
|
80 * From CPositioner. |
|
81 * Cancels position info request with error code |
|
82 */ |
|
83 void CancelNotifyPositionUpdate(TInt aError); |
|
84 |
|
85 /** |
|
86 * From CPositioner. |
|
87 * Indicates that the PSY has overridden tracking. |
|
88 * |
|
89 * @return ETrue. |
|
90 */ |
|
91 TBool TrackingOverridden() const; |
|
92 |
|
93 /** |
|
94 * From CPositioner. |
|
95 * Initiate a tracking session. |
|
96 * |
|
97 * @param aInterval Interval for position requests. |
|
98 */ |
|
99 void StartTrackingL( |
|
100 const TTimeIntervalMicroSeconds& aInterval |
|
101 ); |
|
102 |
|
103 /** |
|
104 * From CPositioner. |
|
105 * Stop a periodic update session. |
|
106 */ |
|
107 void StopTracking(); |
|
108 |
|
109 /** |
|
110 * Returns current interval for an tracking session. |
|
111 * |
|
112 * @return Tracking interval in microseconds. 0 if no tracking session. |
|
113 */ |
|
114 TTimeIntervalMicroSeconds TrackingInterval() const; |
|
115 |
|
116 private: |
|
117 |
|
118 /** |
|
119 * C++ default constructor. |
|
120 */ |
|
121 CPosDefaultPositioner(); |
|
122 |
|
123 /** |
|
124 * EPOC constructor. |
|
125 */ |
|
126 void ConstructL(TAny* aConstructionParameters); |
|
127 |
|
128 // By default, prohibit copy constructor |
|
129 CPosDefaultPositioner(const CPosDefaultPositioner&); |
|
130 // Prohibit assigment operator |
|
131 CPosDefaultPositioner& operator= (const CPosDefaultPositioner&); |
|
132 |
|
133 private: // Data |
|
134 |
|
135 CPosRequestController* iRequestController; |
|
136 TTimeIntervalMicroSeconds iTrackingInterval; |
|
137 |
|
138 }; |
|
139 |
|
140 #endif // CPOSDEFAULTPOSITIONER_H |
|
141 |
|
142 // End of File |