23 #include <qstringlist.h> |
23 #include <qstringlist.h> |
24 #include <qdatetime.h> |
24 #include <qdatetime.h> |
25 #include <qpixmap.h> |
25 #include <qpixmap.h> |
26 #include <hbicon.h> |
26 #include <hbicon.h> |
27 #include <displaymode.h> |
27 #include <displaymode.h> |
28 #include "Search_global.h" |
28 #include <xqappmgr.h> |
|
29 #include <xqaiwrequest.h> |
|
30 #include "search_global.h" |
|
31 |
|
32 //Uncomment to enable performance measurements. |
|
33 //#define OST_TRACE_COMPILER_IN_USE |
|
34 |
|
35 #ifdef OST_TRACE_COMPILER_IN_USE |
|
36 |
|
37 #define PERF_CAT_API_TIME_RESTART m_categorySearchApiTime.restart(); |
|
38 #define PERF_CAT_UI_TIME_RESTART m_categorySearchUiTime.restart(); |
|
39 #define PERF_CAT_TOTAL_TIME_RESTART m_totalSearchUiTime.restart(); |
|
40 #define PERF_CAT_API_ENDLOG qDebug() << "Search on category (API): " << mTemplist.at( mDatabasecount-1 ) << "took "<< m_categorySearchApiTime.elapsed() << " msec"; |
|
41 #define PERF_CAT_UI_ENDLOG qDebug() << "Search on category (UI): " << mTemplist.at( mDatabasecount-1 ) << "took "<< m_categorySearchUiTime.elapsed() << " msec"; |
|
42 #define PERF_TOTAL_UI_ENDLOG qDebug() << "Search on total (UI): took "<< m_totalSearchUiTime.elapsed() << " msec"; |
|
43 #define PERF_CAT_HITS_ENDLOG qDebug() << "Hits on category: " << mTemplist.at( mDatabasecount-1 ) << ": "<< aResultCount; |
|
44 #define PERF_CAT_GETDOC_TIME_RESTART m_categoryGetDocumentApiTime.restart(); |
|
45 #define PERF_CAT_GETDOC_TIME_ACCUMULATE m_getDocumentCatergoryTimeAccumulator += m_categoryGetDocumentApiTime.elapsed(); |
|
46 #define PERF_CAT_GETDOC_ACCUMULATOR_RESET m_getDocumentCatergoryTimeAccumulator = 0; |
|
47 #define PERF_CAT_GETDOC_ACCUMULATOR_ENDLOG qDebug() << "Get Doc on category (API): " << mTemplist.at( mDatabasecount-1 ) << "took " << m_getDocumentCatergoryTimeAccumulator << "msec"; |
|
48 |
|
49 #else |
|
50 |
|
51 #define PERF_CAT_API_TIME_RESTART |
|
52 #define PERF_CAT_UI_TIME_RESTART |
|
53 #define PERF_CAT_TOTAL_TIME_RESTART |
|
54 #define PERF_CAT_API_ENDLOG |
|
55 #define PERF_CAT_UI_ENDLOG |
|
56 #define PERF_TOTAL_UI_ENDLOG |
|
57 #define PERF_CAT_HITS_ENDLOG |
|
58 #define PERF_CAT_GETDOC_TIME_RESTART |
|
59 #define PERF_CAT_GETDOC_TIME_ACCUMULATE |
|
60 #define PERF_CAT_GETDOC_ACCUMULATOR_RESET |
|
61 #define PERF_CAT_GETDOC_ACCUMULATOR_ENDLOG |
|
62 |
|
63 #endif //OST_TRACE_COMPILER_IN_USE |
29 |
64 |
30 class HbMainWindow; |
65 class HbMainWindow; |
31 class HbView; |
66 class HbView; |
32 class HbListView; |
67 class HbListView; |
33 class HbDocumentLoader; |
68 class HbDocumentLoader; |
34 class QStandardItemModel; |
69 class QStandardItemModel; |
35 class HbSearchPanel; |
70 class HbSearchPanel; |
36 class QSortFilterProxyModel; |
|
37 |
|
38 class CFbsBitmap; |
71 class CFbsBitmap; |
39 |
|
40 class InDeviceHandler; |
72 class InDeviceHandler; |
41 class QCPixDocument; |
73 class QCPixDocument; |
42 |
74 |
43 SEARCH_CLASS( SearchStateProviderTest) |
75 SEARCH_CLASS( SearchStateProviderTest) |
44 /** @ingroup group_searchstateprovider |
76 /** @ingroup group_searchstateprovider |
102 /** |
134 /** |
103 * resizing the symbain icon . |
135 * resizing the symbain icon . |
104 * @since S60 ?S60_version. |
136 * @since S60 ?S60_version. |
105 */ |
137 */ |
106 CFbsBitmap *copyBitmapLC(CFbsBitmap *input); |
138 CFbsBitmap *copyBitmapLC(CFbsBitmap *input); |
|
139 |
|
140 /** |
|
141 * Constructing cpix handlers . |
|
142 * @since S60 ?S60_version. |
|
143 */ |
|
144 void constructHandlers(); |
|
145 |
|
146 /** |
|
147 * setting the categories . |
|
148 * @since S60 ?S60_version. |
|
149 */ |
|
150 void setSelectedCategories(); |
107 public slots: |
151 public slots: |
108 |
152 |
109 /** |
153 |
110 * slot connects to CSearchHandler to get the status of search result synchronously |
154 |
|
155 /** |
|
156 * slot connects to CSearchHandler to get the status of search result asynchronously |
111 * @since S60 ?S60_version. |
157 * @since S60 ?S60_version. |
112 * @param aError error code. |
158 * @param aError error code. |
113 * @param aResultCount number of results |
159 * @param aResultCount number of results |
114 */ |
160 */ |
115 void onSearchComplete(int aError, int aResultCount); |
|
116 |
|
117 /** |
|
118 * slot connects to CSearchHandler to get the status of search result asynchronously |
|
119 * @since S60 ?S60_version. |
|
120 * @param aError error code. |
|
121 * @param aResultCount number of results |
|
122 */ |
|
123 void onAsyncSearchComplete(int aError, int aResultCount); |
161 void onAsyncSearchComplete(int aError, int aResultCount); |
124 |
162 |
125 /** |
163 /** |
126 * slot connects to CSearchHandler to get the result item asynchronously |
164 * slot connects to CSearchHandler to get the result item asynchronously |
127 * @since S60 ?S60_version. |
165 * @since S60 ?S60_version. |
163 * @since S60 ?S60_version. |
201 * @since S60 ?S60_version. |
164 */ |
202 */ |
165 void _customizeGoButton(bool avalue); |
203 void _customizeGoButton(bool avalue); |
166 |
204 |
167 /** |
205 /** |
|
206 * slot implemented to avoid repeated search for the same category |
|
207 * selection when user search for mutiple times |
|
208 * @since S60 ?S60_version. |
|
209 */ |
|
210 void settingsaction(bool avalue); |
|
211 |
|
212 /** |
168 * slot connects to search state for internet search |
213 * slot connects to search state for internet search |
169 * @since S60 ?S60_version. |
214 * @since S60 ?S60_version. |
170 */ |
215 */ |
171 void settingsaction(bool avalue); |
|
172 |
|
173 /** |
|
174 * slot connects to search state for internet search |
|
175 * @since S60 ?S60_version. |
|
176 */ |
|
177 void cancelSearch(); |
216 void cancelSearch(); |
178 |
217 /** |
|
218 * slot connects to model for rows insert completion |
|
219 * @since S60 ?S60_version. |
|
220 */ |
|
221 void getrowsInserted(); |
|
222 |
|
223 /** |
|
224 * slot connects to model for rows delete completion |
|
225 * @since S60 ?S60_version. |
|
226 */ |
|
227 void getrowsRemoved(); |
|
228 /** |
|
229 * slot added for Application manager |
|
230 * @since S60 ?S60_version. |
|
231 */ |
|
232 |
|
233 void handleOk(const QVariant& var); |
|
234 |
|
235 /** |
|
236 * slot added for Application manager |
|
237 * @since S60 ?S60_version. |
|
238 */ |
|
239 |
|
240 void handleError(int ret, const QString& var); |
|
241 |
|
242 /** |
|
243 * Slot implemented for particular category search |
|
244 * @since S60 ?S60_version. |
|
245 */ |
|
246 |
|
247 |
|
248 QString filterDoc(const QCPixDocument* aDoc,const QString& filter); |
179 private: |
249 private: |
180 |
250 |
181 /** |
251 /** |
182 * initiate the fresh search for selected category separately |
252 * initiate the fresh search for selected category separately |
183 * |
253 * |
250 /** |
320 /** |
251 * The searchpanel widget. |
321 * The searchpanel widget. |
252 * Own. |
322 * Own. |
253 */ |
323 */ |
254 HbSearchPanel* mSearchPanel; |
324 HbSearchPanel* mSearchPanel; |
255 /** |
325 |
256 * proxymodel for list view |
|
257 * Own. |
|
258 */ |
|
259 QSortFilterProxyModel *proxyModel; |
|
260 |
|
261 /** |
326 /** |
262 * model for list view |
327 * model for list view |
263 * Own. |
328 * Own. |
264 */ |
329 */ |
265 QStandardItemModel* mModel; |
330 QStandardItemModel* mModel; |
266 |
331 |
267 /** |
332 /** |
268 * qt interface for CPix engine |
333 * qt interface for CPix engine |
269 * Own. |
334 * Own. |
270 */ |
335 */ |
|
336 QList<InDeviceHandler*> mSearchHandlerList; |
|
337 |
271 InDeviceHandler* mSearchHandler; |
338 InDeviceHandler* mSearchHandler; |
272 |
339 |
273 /** |
340 /** |
274 * Search Keyword |
341 * Search Keyword |
275 */ |
342 */ |
324 * |
391 * |
325 */ |
392 */ |
326 bool loadSettings; |
393 bool loadSettings; |
327 QList<HbIcon> mIconArray; |
394 QList<HbIcon> mIconArray; |
328 HbIcon mIcon; |
395 HbIcon mIcon; |
|
396 |
|
397 private: |
|
398 XQApplicationManager* mAiwMgr; |
|
399 XQAiwRequest* mRequest; |
|
400 |
|
401 #ifdef OST_TRACE_COMPILER_IN_USE |
|
402 QTime m_totalSearchUiTime; |
|
403 QTime m_categorySearchUiTime; |
|
404 QTime m_categorySearchApiTime; |
|
405 QTime m_categoryGetDocumentApiTime; |
|
406 //use long to safeguard overflow from long running operations. |
|
407 long m_getDocumentCatergoryTimeAccumulator; |
|
408 #endif |
329 |
409 |
330 SEARCH_FRIEND_CLASS (SearchStateProviderTest) |
410 SEARCH_FRIEND_CLASS (SearchStateProviderTest) |
331 |
411 |
332 }; |
412 }; |
333 |
413 |