|
1 /* |
|
2 * Copyright (c) 2005 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: |
|
15 * ?description_line |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef CCOMPOSITESEARCHRESULT_H |
|
21 #define CCOMPOSITESEARCHRESULT_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <f32file.h> |
|
26 #include "Ft_CSearchResultBase.h" |
|
27 #include <StifLogger.h> |
|
28 |
|
29 |
|
30 class CPosLmCompositeCriteria; |
|
31 // CONSTANTS |
|
32 |
|
33 |
|
34 class CCompositeSearchResult : public CSearchResultBase |
|
35 { |
|
36 |
|
37 public: // Constructors and destructor |
|
38 |
|
39 /** |
|
40 * Two-phased constructor. |
|
41 */ |
|
42 static CCompositeSearchResult* NewL(CStifLogger* aLog); |
|
43 |
|
44 /** |
|
45 * Destructor. |
|
46 */ |
|
47 ~CCompositeSearchResult(); |
|
48 |
|
49 public: |
|
50 |
|
51 TBool GetCompositeSearchResultsL(CPosLmCompositeCriteria& aComposite); |
|
52 |
|
53 //RArray<TPosLmItemId>& GetSearchResult(); |
|
54 |
|
55 public: // data |
|
56 RArray<TPosLmItemId> iResultIds; |
|
57 |
|
58 TReal64 iSouthLat; |
|
59 TReal64 iNorthLat; |
|
60 TReal64 iWestLong; |
|
61 TReal64 iEastLong; |
|
62 |
|
63 private: |
|
64 |
|
65 CCompositeSearchResult(); |
|
66 |
|
67 void ConstructL(CStifLogger* aLog); |
|
68 |
|
69 TInt ReadLn(RFile& aFile, TDes& aDes); |
|
70 |
|
71 void ParseAreaL(const TDesC& aDes); |
|
72 |
|
73 void ParseTextL(const TDesC& aDes); |
|
74 |
|
75 void ParseCategoryL(const TDesC& aDes); |
|
76 |
|
77 void ParseNearestL(const TDesC& aDes); |
|
78 |
|
79 void ParseIdListL(const TDesC& aDes); |
|
80 |
|
81 void ParseResultL(const TDesC& aDes); |
|
82 |
|
83 void ExtractIdFields(const TDesC& aDes, RArray<TUint>& aList); |
|
84 |
|
85 private: |
|
86 |
|
87 // By default, prohibit copy constructor |
|
88 CCompositeSearchResult(const CCompositeSearchResult&); |
|
89 // Prohibit assigment operator |
|
90 CCompositeSearchResult& operator=(const CCompositeSearchResult&); |
|
91 |
|
92 private: // Data |
|
93 |
|
94 enum TAreaValueIndex |
|
95 { |
|
96 ESouthLat =1, |
|
97 ENorthLat =2, |
|
98 EWestLong =3, |
|
99 EEastLong =4, |
|
100 }; |
|
101 |
|
102 enum TCategoryValueIndex |
|
103 { |
|
104 ECategoryName =1, |
|
105 ECategoryId =2, |
|
106 }; |
|
107 |
|
108 enum TTextValueIndex |
|
109 { |
|
110 ETextCriteria =1, |
|
111 EAttributes =2, |
|
112 EPositionFields =3, |
|
113 }; |
|
114 |
|
115 enum TNearestValueIndex |
|
116 { |
|
117 ELatitude =1, |
|
118 ELongitude =2, |
|
119 EUseCoverageRadius =3, |
|
120 EMaxDistance =4, |
|
121 }; |
|
122 |
|
123 enum TIdListValueIndex |
|
124 { |
|
125 ELmIdList =1, |
|
126 }; |
|
127 |
|
128 enum TResultValueIndex |
|
129 { |
|
130 ELmResultIdList =1, |
|
131 ERedefined =2 |
|
132 }; |
|
133 |
|
134 |
|
135 // Test log, used for debug text |
|
136 CStifLogger* iLog; |
|
137 |
|
138 RFs iFileSession; |
|
139 RFile iFile; |
|
140 |
|
141 HBufC* iTextCriteria; |
|
142 HBufC* iCategoryName; |
|
143 TInt iCategoryId; |
|
144 |
|
145 CPosLandmark::TAttributes iTextAttributes; |
|
146 |
|
147 RArray<TUint> iIdList; |
|
148 RArray<TUint> iPositionList; |
|
149 |
|
150 TReal64 iLatitude; |
|
151 TReal64 iLongitude; |
|
152 TBool iUseCoverageRadius; |
|
153 TReal32 iMaxDistance; |
|
154 |
|
155 TBool iTextEnabled; |
|
156 TBool iAreaEnabled; |
|
157 TBool iNearestEnabled; |
|
158 TBool iCategoryEnabled; |
|
159 TBool iIdListEnabled; |
|
160 |
|
161 TInt iTestCounter; |
|
162 |
|
163 }; |
|
164 |
|
165 #endif // CCompositeSearchResult_H |
|
166 |
|
167 // End of File |
|
168 |