|
1 // Copyright (c) 2006-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 // This file defines the interface to the LBS Assistance Data Source Module. |
|
15 // The interface is implemented by a SUPL protocol test module. |
|
16 // |
|
17 // |
|
18 |
|
19 /** |
|
20 @file |
|
21 @publishedPartner |
|
22 @test |
|
23 @released |
|
24 */ |
|
25 #include <e32base.h> |
|
26 #include <lbs/lbsassistancedatabuilderset.h> |
|
27 #include <lbsposition.h> |
|
28 #include <lbs/lbsassistancedatabase.h> |
|
29 |
|
30 #ifndef LBSASSISTANCEDATASOURCEMODULEBASE_H_ |
|
31 #define LBSASSISTANCEDATASOURCEMODULEBASE_H_ |
|
32 |
|
33 const TUid KAssistanceDataSourceModuleUid = {0x101F9421}; |
|
34 /** |
|
35 MLbsAssistanceDataSourceObserver used to inform the Network Simulator |
|
36 about completion of a request for Assistance Data. |
|
37 |
|
38 @see CLbsSuplTestMoudule |
|
39 */ |
|
40 class MLbsAssistanceDataSourceObserver |
|
41 { |
|
42 public: |
|
43 /** Call-back used to inform the Network Simulator |
|
44 about completion of a request to obtain Assistance Data using the SUPL test module. |
|
45 @param aError Standard Symbian OS error code |
|
46 */ |
|
47 virtual void DataSourceNotification(const TInt& aError) = 0; |
|
48 }; |
|
49 |
|
50 |
|
51 class TAssistanceDataSourceModuleConstructionParams |
|
52 /** |
|
53 This class is defines the construction parameters required by the |
|
54 CAssistanceDataSourceModuleBase ECom interface. |
|
55 @see CAssistanceDataSourceModuleBase |
|
56 */ |
|
57 { |
|
58 public: |
|
59 |
|
60 inline TAssistanceDataSourceModuleConstructionParams(MLbsAssistanceDataSourceObserver& aAssistanceDataSourceObserver); |
|
61 |
|
62 public: |
|
63 |
|
64 /** Reference to an assistance data source observer |
|
65 */ |
|
66 MLbsAssistanceDataSourceObserver& iAssistanceDataSourceObserver; |
|
67 }; |
|
68 |
|
69 /** |
|
70 CAssistanceDataSourceBase This class is used in partnership with MLbsAssistanceDataSourceObserver |
|
71 and CAssistanceDataSourceModuleBase and it represents a session with a remote server (i.e. a |
|
72 SUPL session). |
|
73 |
|
74 An instance of a specialization of this class is obtained by the Network Simulator by means |
|
75 of interface CAssistanceDataSourceModuleBase. |
|
76 |
|
77 The concrete subclass that gets instantiated will be determined by the implementation of interface |
|
78 CAssistanceDataSourceModuleBase that the Network Simulator is using (ie SUPL protocol), which is |
|
79 an ECom plug-in. |
|
80 |
|
81 The Network Simulator will use this interface to request retrieval of Assistance Data or to cancel |
|
82 a previous request. |
|
83 |
|
84 @see CLbsSuplTestMoudule |
|
85 */ |
|
86 class CAssistanceDataSourceBase |
|
87 { |
|
88 public: |
|
89 /** Call-back used to inform the Network Simulator |
|
90 about completion of a request to obtain Assistance Data using the SUPL test module. |
|
91 @param aError Standard Symbian OS error code |
|
92 */ |
|
93 virtual void GetAssistanceData(RLbsAssistanceDataBuilderSet& aBuilderSet, const TLbsAsistanceDataGroup& aAssistanceDataFilter, const TCoordinate& aPosition) = 0; |
|
94 virtual void CancelGetAssistanceData() = 0; |
|
95 inline virtual ~CAssistanceDataSourceBase (); |
|
96 }; |
|
97 |
|
98 /** |
|
99 The CAssistanceDataSourceModuleBase is the abstract interface to a |
|
100 assistance data source module (ex: SUPL). It is used by the |
|
101 LBS' Network Simulator to gather GPS Assistance Data from |
|
102 a remote network server. |
|
103 |
|
104 The CAssistanceDataSourceModuleBase class is used in partnership with |
|
105 MLbsAssistanceDataSourceObserver and CAssistanceDataSourceBase. The module |
|
106 instantiates a CAssistanceDataSourceBase (i.e. a SUPL protocol session) |
|
107 to gather the data and that object in turn responds to requests from the |
|
108 Network Simulator via the observer class. |
|
109 |
|
110 An actual implementation of an Assistance Data Source module will derive from |
|
111 CAssistanceDataSourceModuleBase to provide the specific implementation of the interface methods. |
|
112 |
|
113 @see MLbsAssistanceDataSourceObserver |
|
114 */ |
|
115 |
|
116 class CAssistanceDataSourceModuleBase : public CBase |
|
117 { |
|
118 public: |
|
119 |
|
120 // Instantiate SUPL protocol test module ECOM plug-in |
|
121 static CAssistanceDataSourceModuleBase* NewL(MLbsAssistanceDataSourceObserver& aObserver); |
|
122 |
|
123 // wraps ECom object instantiation of a implementation UID |
|
124 static CAssistanceDataSourceModuleBase* NewL(TUid aImplementationUid, MLbsAssistanceDataSourceObserver& aObserver); |
|
125 |
|
126 // wraps ECom object destruction |
|
127 ~CAssistanceDataSourceModuleBase(); |
|
128 |
|
129 inline CAssistanceDataSourceModuleBase(); |
|
130 |
|
131 //static void ListAllImplementationsL(RImplInfoPtrArray& aImplInfoArray); |
|
132 |
|
133 //Get a new session to obtain assistance data from |
|
134 virtual CAssistanceDataSourceBase* NewDataSourceL() = 0; |
|
135 |
|
136 private: |
|
137 // Instance identifier key |
|
138 TUid iDtor_ID_Key; |
|
139 }; |
|
140 |
|
141 |
|
142 #include <lbs/lbsassistancedatasourcemodule.inl> |
|
143 |
|
144 #endif // LBSASSISTANCEDATASOURCEMODULEBASE_H_ |