Sayonara Player
LibraryFileExtensionBar.h
1 /* LibraryFileExtensionBar.h */
2 
3 /* Copyright (C) 2011-2019 Lucio Carreras
4  *
5  * This file is part of sayonara player
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11 
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16 
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 
22 
23 #ifndef LIBRARYFILEEXTENSIONBAR_H
24 #define LIBRARYFILEEXTENSIONBAR_H
25 
26 #include "Gui/Utils/Widgets/Widget.h"
27 #include "Utils/Pimpl.h"
28 
29 namespace Gui
30 {
31  class ExtensionSet;
32 }
33 
34 class AbstractLibrary;
35 
36 namespace Library
37 {
43  {
44  Q_OBJECT
45  PIMPL(FileExtensionBar)
46 
47  signals:
48  void sig_close_clicked();
49 
50  public:
51  explicit FileExtensionBar(QWidget* parent=nullptr);
52  ~FileExtensionBar() override;
53 
58  void init(AbstractLibrary* library);
59 
64  void refresh();
65 
69  void clear();
70 
75  bool has_extensions() const;
76 
77  protected:
78  void language_changed() override;
79 
80  private slots:
81  void button_toggled(bool b);
82  void close_clicked();
83  };
84 }
85 
86 #endif // LIBRARYFILEEXTENSIONBAR_H
void init(AbstractLibrary *library)
This method needs to be called before any other operation.
Definition: AbstractLibrary.h:36
bool has_extensions() const
has_extensions
Definition: AbstractLibrary.h:41
void clear()
clears all buttons and the layout
Widget with Settings connection. Also contains triggers for language_changed() and skin_changed() wi...
Definition: Widget.h:37
void refresh()
refetches all tracks with extensions, clears the layout, adds new buttons
An interface class needed when implementing a library plugin.
Definition: LocalLibraryWatcher.h:32
The FileExtensionBar class.
Definition: LibraryFileExtensionBar.h:42