51
|
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 |
|
|
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 |
bool mDefaultWildCard;
|
|
47 |
};
|
|
48 |
|
|
49 |
/**
|
|
50 |
* search results class.
|
|
51 |
*/
|
|
52 |
class SearchResults
|
|
53 |
{
|
|
54 |
public:
|
|
55 |
int mNumberOfFoundFiles;
|
|
56 |
QStringList *mFoundFilesList;
|
|
57 |
};
|
|
58 |
|
|
59 |
class FbSearchView : public HbView
|
|
60 |
{
|
|
61 |
Q_OBJECT
|
|
62 |
|
|
63 |
public:
|
|
64 |
explicit FbSearchView(EngineWrapper &engineWrapper);
|
|
65 |
~FbSearchView();
|
|
66 |
void open(const QString &path);
|
|
67 |
|
|
68 |
signals:
|
|
69 |
void finished(bool ok);
|
|
70 |
|
|
71 |
private slots:
|
|
72 |
void accept();
|
|
73 |
void reject();
|
|
74 |
|
|
75 |
private:
|
|
76 |
void initDataForm();
|
|
77 |
void createToolbar();
|
|
78 |
void loadAttributes();
|
|
79 |
void readFormItems();
|
|
80 |
|
|
81 |
void startFileSearch();
|
|
82 |
void fileSearchResults();
|
|
83 |
|
|
84 |
private:
|
|
85 |
/* EngineWrapper */
|
|
86 |
EngineWrapper &mEngineWrapper;
|
|
87 |
|
|
88 |
/* Search attributes */
|
|
89 |
SearchAttributes mAttributes;
|
|
90 |
/* Search results */
|
|
91 |
SearchResults mResults;
|
|
92 |
|
|
93 |
HbDataForm *mForm;
|
|
94 |
HbDataFormModelItem *mSearchFileNameItem;
|
|
95 |
HbDataFormModelItem *mWildCardItem;
|
|
96 |
HbDataFormModelItem *mHasString;
|
|
97 |
HbDataFormModelItem *mRecurse;
|
|
98 |
HbDataFormModelItem *mMinSize;
|
|
99 |
HbDataFormModelItem *mMaxSize;
|
|
100 |
HbDataFormModelItem *mMinDate;
|
|
101 |
HbDataFormModelItem *mMaxDate;
|
|
102 |
QString mPath;
|
|
103 |
HbProgressDialog *mProgressDialog;
|
|
104 |
};
|
|
105 |
|
|
106 |
#endif // FBSEARCHVIEW_H
|