-#ifndef FOLDERPANEL_H\r
-#define FOLDERPANEL_H\r
-\r
-#include <QWidget>\r
-#include <QDir>\r
-#include <QTableWidget>\r
-#include <QFileIconProvider>\r
-#include <QFileSystemWatcher>\r
-#include "filetablewidget.h"\r
-class MainWindow;\r
-\r
-namespace Ui {\r
-class FolderPanel;\r
-}\r
-\r
-class FolderPanel : public QWidget\r
-{\r
- Q_OBJECT\r
-\r
-public:\r
- explicit FolderPanel(QWidget *parent = 0);\r
- ~FolderPanel();\r
-\r
- FileTableWidget* fileTable();\r
- const FileTableWidget* fileTable() const;\r
-\r
- QDir* dir() { return &m_dir; }\r
- const QDir* dir() const { return &m_dir; }\r
-\r
- void setCurrentFolder(const QString &path);\r
- void InstallWatcher();\r
- void UninstallWatcher();\r
-\r
- void beginUpdate() { m_bUpdating = true; }\r
- void endUpdate() { m_bUpdating = false; onUpdateMark(0, 0);}\r
- bool isUpdating() const { return m_bUpdating; }\r
-\r
-private:\r
- Ui::FolderPanel *ui;\r
- QDir m_dir;\r
- QFileIconProvider m_IconFactory;\r
- QFileSystemWatcher *m_fsWatcher;\r
- bool m_bUpdating;\r
-\r
-private slots:\r
- void onUpdateMark(int, int);\r
- void on_locationField_editingFinished();\r
- void on_directoryChanged(QString);\r
- void on_fileTable_itemSelectionChanged();\r
-};\r
-\r
-#endif // FOLDERPANEL_H\r
+#ifndef FOLDERPANEL_H
+#define FOLDERPANEL_H
+
+#include <QWidget>
+class QLabel;
+class LocationBox;
+class FolderView;
+class SearchBox;
+class MainWindow;
+
+namespace Ui {
+class FolderPanel;
+}
+
+class FolderPanel : public QWidget
+{
+ Q_OBJECT
+
+public:
+ explicit FolderPanel(QWidget *parent = 0);
+ ~FolderPanel();
+
+ void initialize(MainWindow *mainWnd);
+
+ // getter
+ LocationBox* locationBox() const;
+ FolderView* folderView() const;
+ SearchBox* searchBox() const;
+ QLabel* filterLabel() const;
+
+ // setter
+ void setNameFilters(const QString &filters = QString());
+
+private:
+ Ui::FolderPanel *ui;
+ MainWindow *m_mainWnd;
+
+ void showNameFilters();
+
+public slots:
+ void dataChange();
+ void addBookmark();
+ void itemFound();
+ void itemNotFound();
+ void searchItem(const QString& text);
+
+ // QWidget interface
+protected:
+ void focusInEvent(QFocusEvent *);
+};
+
+#endif // FOLDERPANEL_H