Sayonara Player
LibraryPluginHandler.h
1 /* LibraryPluginLoader.h */
2 
3 /* Copyright (C) 2011-2017 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 #ifndef LIBRARYPLUGINLOADER_H
22 #define LIBRARYPLUGINLOADER_H
23 
24 #include "Helper/Settings/SayonaraClass.h"
25 #include "Helper/Pimpl.h"
26 
27 #include <QList>
28 #include <QObject>
29 
36  public QObject,
37  protected SayonaraClass
38 {
39  Q_OBJECT
40 
41 signals:
42  void sig_idx_changed(int);
43 
44 private:
46 
47 
52  void init_library(int idx);
53 
54 
55 public:
56  explicit LibraryPluginHandler(QObject* parent=nullptr);
58 
59 
64  void init(const QList<LibraryContainerInterface*>& containers);
65 
70  void set_library_parent(QWidget* parent);
71 
72 
78 
84 
90  int get_cur_library_idx() const;
91 
92 
93 private slots:
98  void index_changed(int idx);
99 
103  void language_changed();
104 };
105 
106 #endif // LIBRARYPLUGINLOADER_H
The SayonaraClass class provides access to Settings and notifications.
Definition: SayonaraClass.h:29
void init(const QList< LibraryContainerInterface * > &containers)
Search for plugins and add some predefined plugins.
Library Plugin Manager.
Definition: LibraryPluginHandler.h:35
An interface class needed when implementing a library plugin.
Definition: LibraryContainer.h:40
int get_cur_library_idx() const
Get the current index of the library (indicated by current index in dropdown.
QList< LibraryContainerInterface * > get_libraries() const
Get a list for all found plugins. The ui is not necessarily initialized.
LibraryContainerInterface * get_cur_library() const
Get the current selected (and shown) library.
void set_library_parent(QWidget *parent)
Set the parent widget for library plugins.
Definition: org_mpris_media_player2_adaptor.h:20