21 |
21 |
22 //Headers needed |
22 //Headers needed |
23 #include <f32file.h> //RFs |
23 #include <f32file.h> //RFs |
24 #include <d32dbms.h> //RDbNamedDatabase,RDbView |
24 #include <d32dbms.h> //RDbNamedDatabase,RDbView |
25 |
25 |
26 // maptile database column names |
26 #include "mylocationsdefines.h" |
27 _LIT( NCntColUid, "cntuid" ); |
|
28 _LIT( NAppColFilePath, "filepath" ); |
|
29 _LIT( NColSource, "source" ); |
|
30 |
|
31 // maptile lookup database name |
|
32 _LIT( KMapTileLookupDatabaseName, "mylocationsmaptilelookup.db" ); |
|
33 |
|
34 // maptile database table name |
|
35 _LIT( KMapTileLookupTable, "cntmaptilelookuptable" ); |
|
36 |
|
37 _LIT( KLookupDbPath, "c:\\mylocations\\" ); |
|
38 |
|
39 // uid column number |
|
40 const TInt KColumnUid = 1; |
|
41 // source type column number |
|
42 const TInt KColumnSource = 2; |
|
43 // source type column number |
|
44 const TInt KColumnFilePath = 3; |
|
45 |
|
46 |
|
47 /** |
|
48 * Maptile database lookup entry |
|
49 */ |
|
50 class TLookupItem |
|
51 { |
|
52 public: |
|
53 // Uid of the source entry |
|
54 TUint32 iUid; |
|
55 |
|
56 // Source type |
|
57 TUint32 iSource; |
|
58 |
|
59 // Landmark uid in the landmarks database |
|
60 TUint32 iLmId; |
|
61 |
|
62 // Uid of the Application |
|
63 TUint32 iAppUid; |
|
64 |
|
65 // File Path |
|
66 TFileName iFilePath; |
|
67 }; |
|
68 |
|
69 /** |
|
70 * Defines uid source type |
|
71 */ |
|
72 enum TUidSourceType |
|
73 { |
|
74 /** Uid Source type calendar plain address */ |
|
75 ESourceCalendar = 0, |
|
76 /** Uid Source type contacts default/prefered address */ |
|
77 ESourceContactsPref = 3, |
|
78 /** Uid Source type contacts work address */ |
|
79 ESourceContactsWork, |
|
80 /** Uid Source type contacts home address */ |
|
81 ESourceContactsHome, |
|
82 |
|
83 }; |
|
84 |
|
85 /** |
27 /** |
86 * CLookupMapTileDatabase class. |
28 * CLookupMapTileDatabase class. |
87 * This class handles all the operations related to maptile lookup database. |
29 * This class handles all the operations related to maptile lookup database. |
88 * |
30 * |
89 */ |
31 */ |
113 * Finds an entry in the lookup table. |
55 * Finds an entry in the lookup table. |
114 * @param[in/out] aLookupItem The lookup item to be found in the database. |
56 * @param[in/out] aLookupItem The lookup item to be found in the database. |
115 * The source iUid is passed in the lookup item |
57 * The source iUid is passed in the lookup item |
116 */ |
58 */ |
117 void FindEntryL( TLookupItem& aLookupItem ); |
59 void FindEntryL( TLookupItem& aLookupItem ); |
|
60 |
|
61 /** |
|
62 * Finds the number of address present in db associated with the aId. |
|
63 * @param id, entry (calendar/contact) uid. |
|
64 * @return Number of address a contact has. |
|
65 */ |
|
66 int FindNumberOfAddressL( int& aId ); |
118 |
67 |
119 private: |
68 private: |
120 |
69 |
121 // default constructor |
70 // default constructor |
122 CLookupMapTileDatabase(); |
71 CLookupMapTileDatabase(); |