1 /* |
|
2 * Copyright (c) 2009 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 * Zhiqiang Yang <zhiqiang.yang@nokia.com> |
|
14 * |
|
15 * Description: |
|
16 * The header file of the file find widget of file manager |
|
17 * |
|
18 */ |
|
19 |
|
20 #ifndef FMFINDWIDGET_H |
|
21 #define FMFINDWIDGET_H |
|
22 |
|
23 #include "fmcommon.h" |
|
24 #include "fmfindresultmodel.h" |
|
25 |
|
26 #include <hbwidget.h> |
|
27 |
|
28 class HbListView; |
|
29 class HbSearchPanel; |
|
30 class HbWidget; |
|
31 |
|
32 class QGraphicsLinearLayout; |
|
33 |
|
34 class FmFindWidget : public HbWidget |
|
35 { |
|
36 Q_OBJECT |
|
37 public: |
|
38 enum ContentWidgetType |
|
39 { |
|
40 EmptyTipWidget, |
|
41 ResultListView |
|
42 }; |
|
43 FmFindWidget( QGraphicsItem *parent = 0 ); |
|
44 ~FmFindWidget(); |
|
45 |
|
46 void find( const QString &keyword, const QString &path ); |
|
47 void stopFind(); |
|
48 void sortFiles( FmFindResultModel::SortFlag sortFlag ); |
|
49 |
|
50 void activeSearchPanel(); |
|
51 void deActiveSearchPanel(); |
|
52 |
|
53 signals: |
|
54 void finished(); |
|
55 void activated( const QString &pathName ); |
|
56 |
|
57 void startSearch( const QString &targetPath, const QString &criteria ); |
|
58 void setEmptyMenu( bool isMenuEmpty ); |
|
59 |
|
60 private slots: |
|
61 void itemActivated(const QModelIndex &index); |
|
62 |
|
63 void on_searchPanel_criteriaChanged( const QString &criteria ); |
|
64 void on_searchPanel_exitClicked(); |
|
65 |
|
66 void on_resultModel_finished(); |
|
67 void on_resultModel_modelCountChanged( int count ); |
|
68 |
|
69 private: |
|
70 void init(); |
|
71 void initSearchPanel(); |
|
72 void activateContentWidget( ContentWidgetType contentWidgetType ); |
|
73 |
|
74 private: |
|
75 HbListView *mListView; |
|
76 FmFindResultModel *mModel; |
|
77 HbWidget *mEmptyTipWidget; |
|
78 |
|
79 QGraphicsLinearLayout *mLayout; |
|
80 HbSearchPanel* mSearchPanel; |
|
81 QString mFindTargetPath; |
|
82 }; |
|
83 |
|
84 #endif |
|