OSDN Git Service

Ver0.19
[gefu/Gefu.git] / folderview.h
index 3b23544..cc22009 100644 (file)
@@ -5,6 +5,7 @@
 #include "history.h"
 
 #include <QTableView>
+class MainWindow;
 
 class FolderView : public QTableView
 {
@@ -15,7 +16,7 @@ public:
     QString side() const;
 
     // actions
-    void initialize();
+    void initialize(MainWindow *mainWnd);
     void updateAppearance();
     void refresh();
 
@@ -31,10 +32,10 @@ public:
     bool historyBack();
     bool historyForward();
 
-
     // getter
     QFileInfo currentItem() const;
     QString dir() const { return m_model.absolutePath(); }
+    QFileInfoList checkedItems() const;
     QFileInfoList selectedItems() const;
     const History* history() const { return &m_history; }
     QStringList nameFilters() const { return m_model.nameFilters(); }
@@ -44,27 +45,40 @@ public:
     void setFilter(QDir::Filters filter, bool enable);
     void setHistoryIndexAt(int index);
     void setNameFilters(const QStringList &list);
-    void setSorting(QDir::SortFlags flags);
+    void setSorting();
 
 private:
+    MainWindow *m_mainWnd;
     FileTableModel m_model;
     History m_history;
-
+    QPoint m_dragStartPos;
+    bool m_dragging;
 
 signals:
-    void itemFound(FolderView *view);
-    void itemNotFound(FolderView *view);
+    void currentChanged(const QFileInfo &info);
+    void dataChanged();
+    void dropAccepted(const QFileInfoList &list);
+    void itemFound();
+    void itemNotFound();
     void retrieveStarted(const QString &path);
-    void retrieveFinished();
-    void keyPressed(FolderView *view, QKeyEvent *event);
+    void requestContextMenu(QContextMenuEvent *event);
+//    void keyPressed(QKeyEvent *event);
 
 public slots:
 
+    // QAbstractItemView interface
+protected slots:
+    void currentChanged(const QModelIndex &current, const QModelIndex &previous);
+    void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles = QVector<int>());
 
     // QWidget interface
 protected:
     void keyPressEvent(QKeyEvent *event);
-
+    void mousePressEvent(QMouseEvent *event);
+    void mouseMoveEvent(QMouseEvent *event);
+    void dragEnterEvent(QDragEnterEvent *event);
+    void dropEvent(QDropEvent *event);
+    void contextMenuEvent(QContextMenuEvent *event);
 };
 
 #endif // FOLDERVIEW_H