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