#define FOLDERPANEL_H
#include <QWidget>
-class QLabel;
-class QLineEdit;
-class LocationBox;
-class FolderView;
-class SearchBox;
+#include <QAbstractItemView>
+class FolderModel;
class MainWindow;
+
namespace Ui {
class FolderPanel;
}
explicit FolderPanel(QWidget *parent = 0);
~FolderPanel();
- void initialize(MainWindow *mainWnd);
- void updateAppearance(bool darker = false);
-
- // getter
- QLineEdit *locationBox() const;
- FolderView* folderView() const;
- SearchBox* searchBox() const;
- QLabel* filterLabel() const;
-
- // setter
- void setNameFilters(const QString &filters = QString());
+// FolderView* folderView() const;
+ void initialize(MainWindow *w);
+ QAbstractItemView* itemView() const;
+ FolderModel* model() const;
+ void searchNext(int step = 1);
+ void setModel(FolderModel *m);
+ void toggleSearch(bool checked);
+ void toggleView(bool checked);
+ void updateAppearance();
private:
Ui::FolderPanel *ui;
MainWindow *m_mainWnd;
- void showNameFilters();
+ void showSearchResult(const QModelIndex &index);
public slots:
- void dataChange();
- void addBookmark();
- void itemFound();
- void itemNotFound();
- void searchItem(const QString& text);
-
- // QWidget interface
-protected:
- void focusInEvent(QFocusEvent *);
+
+private slots:
+ void model_dataChanged(const QModelIndex & topLeft, const QModelIndex & bottomRight);
+ void model_Reset();
+ void on_searchBox_textEdited(const QString &arg1);
};
#endif // FOLDERPANEL_H