|
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 class that manages assistance data |
|
15 // during active location requests. |
|
16 // |
|
17 // |
|
18 |
|
19 /** |
|
20 @file |
|
21 @internalComponent |
|
22 @test |
|
23 */ |
|
24 |
|
25 #ifndef __CASSISTDATAMGR_H__ |
|
26 #define __CASSISTDATAMGR_H__ |
|
27 |
|
28 #include <e32base.h> |
|
29 #include <lbs/lbsassistancedatabuilderset.h> |
|
30 |
|
31 /** Assistance Data Manager class. |
|
32 |
|
33 This class manages assistance data requests and responses. It oversees the |
|
34 process whereby the data that is requested by LBS is retrieved from the |
|
35 network, or associated error responses are provided. |
|
36 |
|
37 Note: In this first implementation there is no provision for requesting |
|
38 additional assistance data on behalf of LBS i.e. only the default data |
|
39 set provided by the network is returned to LBS. Future enhancements could |
|
40 introduce support for requesting additional data and handling any network |
|
41 interactions relating to errors and cancellations. |
|
42 */ |
|
43 NONSHARABLE_CLASS(CAssistDataMgr) : public CBase |
|
44 { |
|
45 |
|
46 public: |
|
47 |
|
48 static CAssistDataMgr* NewL(); |
|
49 ~CAssistDataMgr(); |
|
50 |
|
51 void Error(TInt aReason); |
|
52 void StoreData(const RLbsAssistanceDataBuilderSet& aData); |
|
53 TBool ProcessDataRequest(const TLbsAsistanceDataGroup& aDataRequestMask); |
|
54 |
|
55 const RLbsAssistanceDataBuilderSet& ValidData(); |
|
56 const TLbsAsistanceDataGroup& RequestMask() const; |
|
57 const TLbsAsistanceDataGroup& ValidGroupMask() const; |
|
58 const TLbsAsistanceDataGroup& ErrorGroupMask() const; |
|
59 const TLbsAsistanceDataGroup& RequestErrorMask() const; |
|
60 |
|
61 TBool IsDataToBeRequested() const; |
|
62 TBool IsDataToBeReported() const; |
|
63 TBool IsErrorToBeReported() const; |
|
64 TBool IsRequestErrorToBeReported() const; |
|
65 TInt ErrorReason() const; |
|
66 |
|
67 void SetDataNotReceived(); |
|
68 void SendingRequest(); |
|
69 void RequestSent(); |
|
70 void DataReported(); |
|
71 void ErrorReported(); |
|
72 void RequestErrorReported(); |
|
73 void ResetData(); |
|
74 |
|
75 private: |
|
76 |
|
77 CAssistDataMgr(); |
|
78 void ConstructL(); |
|
79 |
|
80 |
|
81 private: |
|
82 |
|
83 /** Requested data mask |
|
84 This reflects the set of data requested by a client. |
|
85 Additional data requests from LBS are added to this mask. |
|
86 If an error is reported then the problematic items are |
|
87 removed from the set i.e. they should not be re-requested. |
|
88 */ |
|
89 TLbsAsistanceDataGroup iDataRequestMask; |
|
90 |
|
91 /** Missing data mask |
|
92 This shows the set of data requested by a client that is missing |
|
93 from the received data. It is used when re-requesting data. |
|
94 */ |
|
95 TLbsAsistanceDataGroup iMissingDataMask; |
|
96 |
|
97 /** Erroneous data mask |
|
98 This shows the set of data requested by a client that has been received |
|
99 with errors identified. |
|
100 */ |
|
101 TLbsAsistanceDataGroup iErrorDataMask; |
|
102 |
|
103 /** Valid data mask |
|
104 This shows the set of data requested by a client that has been received |
|
105 without an error. |
|
106 */ |
|
107 TLbsAsistanceDataGroup iValidDataMask; |
|
108 |
|
109 /** Erroneous request data mask |
|
110 This shows invalid parts of a request from a client. |
|
111 */ |
|
112 TLbsAsistanceDataGroup iRequestErrorMask; |
|
113 |
|
114 /** Valid assistance data storage |
|
115 This is the stored set of valid assistance data. |
|
116 */ |
|
117 RLbsAssistanceDataBuilderSet iValidData; |
|
118 |
|
119 /** Assistance data response error. |
|
120 This indicates any general assistance data error that was reported. |
|
121 */ |
|
122 TInt iDataResponseError; |
|
123 |
|
124 /** Indicates if an assistance data response is expected from network. |
|
125 */ |
|
126 TBool iExpectingResponse; |
|
127 |
|
128 /** Indicates if an assistance data response must be sent to LBS. |
|
129 */ |
|
130 TBool iIsResponseWaiting; |
|
131 |
|
132 /** Indicates if data response (or error) has been reported by network. |
|
133 */ |
|
134 TBool iIsDataReported; |
|
135 |
|
136 }; |
|
137 |
|
138 #endif // __CASSISTDATAMGR_H__ |