OSDN Git Service

Model/View構造への変更。一旦コミット。
[gefu/Gefu.git] / folderpanel.h
1 #ifndef FOLDERPANEL_H\r
2 #define FOLDERPANEL_H\r
3 \r
4 #include <QWidget>\r
5 #include <QDir>\r
6 #include <QTableWidget>\r
7 #include <QFileIconProvider>\r
8 #include <QFileSystemWatcher>\r
9 #include "filetableview.h"\r
10 class MainWindow;\r
11 \r
12 namespace Ui {\r
13 class FolderPanel;\r
14 }\r
15 \r
16 class FolderPanel : public QWidget\r
17 {\r
18     Q_OBJECT\r
19 \r
20 public:\r
21     explicit FolderPanel(QWidget *parent = 0);\r
22     ~FolderPanel();\r
23 \r
24     QTableView *fileTable();\r
25     const QTableView* fileTable() const;\r
26 \r
27     QDir* dir() { return &m_dir; }\r
28     const QDir* dir() const { return &m_dir; }\r
29 \r
30     void setCurrentFolder(const QString &path);\r
31     void InstallWatcher();\r
32     void UninstallWatcher();\r
33 \r
34     void beginUpdate() {\r
35         m_bUpdating = true;\r
36 //        setUpdatesEnabled(false);\r
37     }\r
38     void endUpdate() {\r
39         m_bUpdating = false;\r
40 //        setUpdatesEnabled(true);\r
41         //onUpdateMark(0, 0);\r
42     }\r
43     bool isUpdating() const { return m_bUpdating; }\r
44 \r
45     const QString side() const;\r
46     void setSide(const QString &side);\r
47 \r
48 private:\r
49     Ui::FolderPanel *ui;\r
50     QDir m_dir;\r
51     QFileIconProvider m_IconFactory;\r
52     QFileSystemWatcher *m_fsWatcher;\r
53     bool m_bUpdating;\r
54 \r
55 private slots:\r
56     void onStateChanged(int checkedFolders, int checkedFiles, quint64 totalSize);\r
57     void on_locationField_editingFinished();\r
58     void on_directoryChanged(QString);\r
59 //    void on_fileTable_itemSelectionChanged();\r
60 };\r
61 \r
62 #endif // FOLDERPANEL_H\r