/* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #ifndef SEARCHDIALOG_H #define SEARCHDIALOG_H #include class QCheckBox; class QLineEdit; class QPushButton; class QComboBox; class SmTreeView; class SmTreeModel; class SmTreeItem; class QTreeView; class QSortFilterProxyModel; class QStandardItemModel; class FilenamesAndMetadata : public QWidget { Q_OBJECT public: FilenamesAndMetadata(QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::Widget); signals: void searchResultClicked(int); private slots: void search(); private: void appendChild(QVariant id, QVariant subject, QVariant name, QVariant sub, SmTreeItem *parent); void appendEmpty(SmTreeItem *parent); QLineEdit *mSearch; QTreeView *mResult; SmTreeModel *mModel; QSortFilterProxyModel *mProxy; }; class ActorsAndMore : public QWidget { Q_OBJECT public: enum SearchTypes { Actor, Title }; enum CustomRoles { IdRole = Qt::UserRole + 1 }; ActorsAndMore(QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::Widget); public slots: void doSearch(); private: void searchActor(const QString &actor); QComboBox *mTypeSel; QLineEdit *mSearch; QStandardItemModel *mResultModel; QStandardItemModel *mDataModel; QTreeView *mResultView; QTreeView *mDataView; }; class SearchDialog : public QDialog { Q_OBJECT public: SearchDialog(QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::Widget); void readSettings(); void writeSettings(); }; #endif // SEARCHDIALOG_H