/* This file is part of Clementine. Clementine 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 3 of the License, or (at your option) any later version. Clementine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Clementine. If not, see . */ #ifndef LIBRARYFILTERWIDGET_H #define LIBRARYFILTERWIDGET_H #include #include #include "ui_libraryfilterwidget.h" #include "librarymodel.h" class GroupByDialog; class LibraryConfigDialog; class QMenu; class QActionGroup; class QSignalMapper; class LibraryFilterWidget : public QWidget { Q_OBJECT public: LibraryFilterWidget(QWidget* parent = 0); ~LibraryFilterWidget(); void SetFilterHint(const QString& hint); void SetAgeFilterEnabled(bool enabled); void SetGroupByEnabled(bool enabled); void SetConfigDialogEnabled(bool enabled); void SetSettingsGroup(const QString& group) { settings_group_ = group; } void SetLibraryModel(LibraryModel* model); signals: void LibraryConfigChanged(); public slots: void ShowConfigDialog(); private slots: void GroupingChanged(const LibraryModel::Grouping& g); void GroupByClicked(QAction* action); void ClearFilter(); private: Ui::LibraryFilterWidget ui_; LibraryModel* model_; boost::scoped_ptr group_by_dialog_; boost::scoped_ptr library_config_dialog_; QMenu* filter_age_menu_; QMenu* group_by_menu_; QAction* config_action_; QActionGroup* group_by_group_; QSignalMapper* filter_age_mapper_; QString settings_group_; }; #endif // LIBRARYFILTERWIDGET_H