#include "history.h"
#include <QTableView>
+class MainWindow;
class FolderView : public QTableView
{
QString side() const;
// actions
- void initialize();
+ void initialize(MainWindow *mainWnd);
void updateAppearance();
void refresh();
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(); }
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 ¤t, 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