|
1 /* |
|
2 * Copyright (c) 2006 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: Base class for location acquisition strategy implmentations. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef C_LBTSTRATEGYBASE_H |
|
21 #define C_LBTSTRATEGYBASE_H |
|
22 |
|
23 |
|
24 //#include <lbttriggerentry.h> |
|
25 #include <lbtcommon.h> |
|
26 |
|
27 #include "lbttriggeringsupervisionobserver.h" |
|
28 |
|
29 |
|
30 class CLbtBaseStrategyExtension; |
|
31 |
|
32 |
|
33 const TUid KLocAcquisitionStrategyInterfaceUid = { 0x10283133 }; |
|
34 |
|
35 |
|
36 /** |
|
37 * Abstract base class for location acquisition strategy plug-ins implementation. |
|
38 * |
|
39 * A strategy plug-in is responsible for the trigger supervision process, |
|
40 * i.e. acquiring locations with suitable intervals and providing notifications |
|
41 * when triggers are fired. |
|
42 * |
|
43 * A location acquisition strategy plug-in must implement a subclass of |
|
44 * this base class. This base class defines interface between Location |
|
45 * Triggering Server and the strategy plug-in. |
|
46 * |
|
47 * @lib ltstrategypluginapi.lib |
|
48 * @since S60 4.0 |
|
49 */ |
|
50 class CLbtStrategyBase : public CBase |
|
51 |
|
52 { |
|
53 |
|
54 public: // Constructors and destructor |
|
55 |
|
56 /** |
|
57 * Creates a new instance of a strategy implementation. |
|
58 * |
|
59 * @param[in] aConstructionParameters Construction parameters for |
|
60 * CLbtBaseStrategy. Must by passed to BaseConstructL() by the |
|
61 * strategy implementation. |
|
62 * @return The strategy implementation. |
|
63 */ |
|
64 IMPORT_C static CLbtStrategyBase* NewL( |
|
65 TAny* aConstructionParameters ); |
|
66 |
|
67 /** |
|
68 * Destructor. |
|
69 */ |
|
70 IMPORT_C ~CLbtStrategyBase(); |
|
71 |
|
72 protected: // Constructors |
|
73 |
|
74 /** |
|
75 * C++ default constructor. |
|
76 */ |
|
77 IMPORT_C CLbtStrategyBase(); |
|
78 |
|
79 /** |
|
80 * Creates the internals of the strategy. |
|
81 * |
|
82 * This function must be called first in the strategy's |
|
83 * ConstructL() method. |
|
84 * |
|
85 * @param[in] aConstructionParameters The construction parameters supplied |
|
86 * in the factory call. |
|
87 */ |
|
88 IMPORT_C void BaseConstructL( TAny* aConstructionParameters ); |
|
89 |
|
90 public: // New functions |
|
91 |
|
92 /** |
|
93 * Start supervision process. |
|
94 * |
|
95 * This function must be implemented by the strategy plug-in. |
|
96 * Location Triggering Server calls this function to start supervision |
|
97 * process. If the supervision process is already started when this |
|
98 * method is called, location acquisition strategy plug-in shall do |
|
99 * nothing. |
|
100 */ |
|
101 IMPORT_C virtual void StartSupervision() = 0; |
|
102 |
|
103 /** |
|
104 * Stop supervision process. |
|
105 * |
|
106 * This function must be implemented by the strategy plug-in. |
|
107 * Location Triggering Server calls this function to stop |
|
108 * supervision process. The strategy plug-in shall release |
|
109 * all resources used for supervision process when this function |
|
110 * is called. |
|
111 * |
|
112 * If the supervision process is not started |
|
113 * when this method is called, location acquisition strategy plug-in |
|
114 * shall do nothing. |
|
115 */ |
|
116 IMPORT_C virtual void StopSupervision() = 0; |
|
117 |
|
118 /** |
|
119 * Inform Location Triggering Server that a trigger shall be |
|
120 * fired. |
|
121 * |
|
122 * When a trigger is fired, the strategy plug-in calls this |
|
123 * function to inform Location Triggering Server. |
|
124 * |
|
125 * When more than one trigger is fired simultaneously, strategy |
|
126 * plug-in shall call this function separately for each the |
|
127 * fired trigger. |
|
128 * |
|
129 * @param[in] aId The ID of the firing trigger. |
|
130 * @param[in] aPosInfo The position information associated with the firing |
|
131 * event. Only basic position information is returned in this parameter. |
|
132 */ |
|
133 IMPORT_C void TriggerFiredL( CLbtGeoAreaBase::TGeoAreaType aAreaType,TLbtTriggerId aId, |
|
134 const TPositionInfo& aPosInfo ); |
|
135 |
|
136 /** |
|
137 * Inform Location Triggering Server about the location |
|
138 * triggering supervision dynamic information. |
|
139 * |
|
140 * Location acquisition strategy plug-in shall use this |
|
141 * method to update the supervision dynamic information to Location |
|
142 * Triggering Server every time a location request is completed. |
|
143 * |
|
144 * @param[in] aDynInfo Contains the new triggering supervision |
|
145 * dynamic information. |
|
146 */ |
|
147 IMPORT_C void SetTriggeringSupervisionDynamicInfo( |
|
148 const TLbtStrategySupervisionDynamicInfo& aDynInfo); |
|
149 |
|
150 /** |
|
151 * Inform location acquisition strategy plug-in that system settings |
|
152 * related to trigger supervision are changed. |
|
153 * |
|
154 * This function must be implemented by the strategy plug-in. |
|
155 * Location Triggering Server calls this function every time when |
|
156 * triggering supervision settings is change. |
|
157 */ |
|
158 virtual void TriggeringSupervisionSettingsChanged() = 0; |
|
159 |
|
160 /** |
|
161 * Get system settings related to triggering supervision from |
|
162 * Location Triggering Server. |
|
163 * |
|
164 * @param[out] aSettings In return, contains system settings |
|
165 * related to triggering supervision. |
|
166 */ |
|
167 IMPORT_C void GetTriggeringSupervisionSettings( |
|
168 TLbtStrategyTriggeringSupervisionSettings& aSettings); |
|
169 |
|
170 private: |
|
171 |
|
172 // Reserved for future expansion |
|
173 IMPORT_C virtual void CLbtStrategy_Reserved1(); |
|
174 |
|
175 IMPORT_C virtual void CLbtStrategy_Reserved2(); |
|
176 |
|
177 private: // Data |
|
178 |
|
179 TUid iDtorIdKey; |
|
180 |
|
181 CLbtBaseStrategyExtension* iExtension; |
|
182 |
|
183 MLbtTriggeringSupervisionObserver* iStrategyObserver; |
|
184 |
|
185 }; |
|
186 |
|
187 |
|
188 #endif // C_LBTSTRATEGYBASE_H |