|
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: This header file describes the class that handles cell id to |
|
15 * co-ordinate mapping database |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef LBTCELLIDDATABASE_H_ |
|
20 #define LBTCELLIDDATABASE_H_ |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <lbsposition.h> |
|
24 /** |
|
25 * This class provides the inteface to access Cell ID Database |
|
26 * |
|
27 * @since S60 v5.1 |
|
28 */ |
|
29 class CLbtCellIdDatabase : public CBase |
|
30 { |
|
31 /** |
|
32 * Data to store cell information |
|
33 */ |
|
34 struct TCellIdCoordinateData |
|
35 { |
|
36 TInt32 iCountryCode; |
|
37 TInt32 iNetworkID; |
|
38 TInt32 iLac; |
|
39 TInt32 iCellId; |
|
40 TLocality iLocality; |
|
41 }; |
|
42 |
|
43 public: // Constructor and destructor |
|
44 /** |
|
45 * Constructs a new instance of CLbtCellIdDatabase. |
|
46 * |
|
47 * @return The new instance of CLbtCellIdDatabase. |
|
48 * @leave System wide error code if the object creation fails. |
|
49 */ |
|
50 static CLbtCellIdDatabase* NewL( ); |
|
51 |
|
52 /** |
|
53 * Destructor. |
|
54 */ |
|
55 ~CLbtCellIdDatabase(); |
|
56 |
|
57 public: // Methods to for functionality |
|
58 /** |
|
59 * Inserts a recods which maps a perticular CGI information |
|
60 * to co-ordinates |
|
61 * |
|
62 * @param[in] aCountryCode the country code of the cell |
|
63 * @param[in] aNetworkID the network identifier |
|
64 * @param[in] aLac the location area code |
|
65 * @param[in] aCellId the cell identifier |
|
66 * @param[in] aLocality the co-ordinate information which is |
|
67 * encompassed in the cell id. As of now only the latitude |
|
68 * longitude and horizontal accuracy values are stored from |
|
69 * specified aCoordinate |
|
70 * |
|
71 * @Leave Any one of the symbian error codes. Specifically |
|
72 * - KErrNone of the information is commited into the database |
|
73 * - KErrNoMemory if the system does not container enough memory to |
|
74 * process the request |
|
75 */ |
|
76 void InsertCidLocation( TInt32 aCountryCode, |
|
77 TInt32 aNetworkID, |
|
78 TInt32 aLac, |
|
79 TInt32 aCellId, |
|
80 TLocality aLocality ); |
|
81 |
|
82 /** |
|
83 * For a specified CGI information, retreives the location information. |
|
84 * In the current implementation the retreived location information only |
|
85 * contains the latitude, logitude and horizontal accuracy information |
|
86 * |
|
87 * @param[in] aCountryCode the country code of the cell |
|
88 * @param[in] aNetworkID the network identifier |
|
89 * @param[in] aLac the location area code |
|
90 * @param[in] aCellId the cell identifier |
|
91 * @param[out] aLocality the co-ordinate information which is |
|
92 * encompassed in the cell id. As of now only the latitude |
|
93 * longitude and horizontal accuracy values are stored in |
|
94 * aLocality |
|
95 * |
|
96 * @return Any one of the symbian error codes. Specifically |
|
97 * - KErrNotSupported if this method is invoked before invoking |
|
98 * method CacheDataForNetwork() |
|
99 * - KErrNone of the information is commited into the database |
|
100 * - KErrNotFound if no location information is found for the database |
|
101 * - KErrNoMemory if the system does not container enough memory to |
|
102 * process the request |
|
103 * |
|
104 */ |
|
105 TInt GetLocationForCid( TInt32 aCountryCode, |
|
106 TInt32 aNetworkID, |
|
107 TInt32 aLac, |
|
108 TInt32 aCellId, |
|
109 TLocality& aLocality ); |
|
110 |
|
111 private: |
|
112 /** |
|
113 * C++ default constructor |
|
114 */ |
|
115 CLbtCellIdDatabase(); |
|
116 |
|
117 /** |
|
118 * Symbian second phase contructor |
|
119 */ |
|
120 void ConstructL(); |
|
121 |
|
122 /** |
|
123 * Method to check if an entry is already present in the database |
|
124 */ |
|
125 TBool IsDuplicateEntry( TInt32 aCountryCode, |
|
126 TInt32 aNetworkID, |
|
127 TInt32 aLac, |
|
128 TInt32 aCellId, |
|
129 TLocality aLocality ); |
|
130 |
|
131 private://data |
|
132 // Write request array |
|
133 RArray<TCellIdCoordinateData> iCellIdDbArray; |
|
134 }; |
|
135 |
|
136 #endif /*LBTCELLIDDATABASE_H_*/ |