1 /* |
|
2 * Copyright (c) 2010 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 * |
|
16 */ |
|
17 |
|
18 #ifndef SEARCHVIEW_H |
|
19 #define SEARCHVIEW_H |
|
20 |
|
21 #include <HbView> |
|
22 |
|
23 #include <QDateTime> |
|
24 |
|
25 class QStringList; |
|
26 |
|
27 class EngineWrapper; |
|
28 class HbDataForm; |
|
29 class HbDataFormModelItem; |
|
30 class HbProgressDialog; |
|
31 |
|
32 /** |
|
33 * Settings class that is used for |
|
34 */ |
|
35 class SearchAttributes |
|
36 { |
|
37 public: |
|
38 QString mSearchDir; |
|
39 QString mWildCards; |
|
40 QString mTextInFile; |
|
41 int mMinSize; |
|
42 int mMaxSize; |
|
43 QDate mMinDate; |
|
44 QDate mMaxDate; |
|
45 bool mRecurse; |
|
46 }; |
|
47 |
|
48 /** |
|
49 * search results class. |
|
50 */ |
|
51 class SearchResults |
|
52 { |
|
53 public: |
|
54 int mNumberOfFoundFiles; |
|
55 QStringList *mFoundFilesList; |
|
56 }; |
|
57 |
|
58 class SearchView : public HbView |
|
59 { |
|
60 Q_OBJECT |
|
61 |
|
62 public: |
|
63 explicit SearchView(EngineWrapper &engineWrapper); |
|
64 ~SearchView(); |
|
65 void open(const QString &path); |
|
66 |
|
67 signals: |
|
68 void finished(bool ok); |
|
69 |
|
70 private slots: |
|
71 void accept(); |
|
72 void reject(); |
|
73 |
|
74 private: |
|
75 void initDataForm(); |
|
76 void createToolbar(); |
|
77 void loadAttributes(); |
|
78 void readFormItems(); |
|
79 |
|
80 void startFileSearch(); |
|
81 void fileSearchResults(); |
|
82 |
|
83 private: |
|
84 /* EngineWrapper */ |
|
85 EngineWrapper &mEngineWrapper; |
|
86 |
|
87 /* Search attributes */ |
|
88 SearchAttributes mAttributes; |
|
89 /* Search results */ |
|
90 SearchResults mResults; |
|
91 |
|
92 HbDataForm *mForm; |
|
93 HbDataFormModelItem *mSearchFileNameItem; |
|
94 HbDataFormModelItem *mWildCardItem; |
|
95 HbDataFormModelItem *mHasString; |
|
96 HbDataFormModelItem *mRecurse; |
|
97 HbDataFormModelItem *mMinSize; |
|
98 HbDataFormModelItem *mMaxSize; |
|
99 HbDataFormModelItem *mMinDate; |
|
100 HbDataFormModelItem *mMaxDate; |
|
101 |
|
102 QString mPath; |
|
103 |
|
104 HbProgressDialog *mProgressDialog; |
|
105 }; |
|
106 |
|
107 #endif // SEARCHVIEW_H |
|