Sayonara Player
LibraryPluginHandler.h
1 /* LibraryPluginLoader.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 #ifndef LIBRARYPLUGINLOADER_H
22 #define LIBRARYPLUGINLOADER_H
23 
24 #include "Utils/Singleton.h"
25 #include "Utils/Pimpl.h"
26 
27 #include <QObject>
28 
29 class QMenu;
30 namespace Library
31 {
32  class Info;
33  class Container;
34 
39  class PluginHandler :
40  public QObject
41  {
42  Q_OBJECT
43  PIMPL(PluginHandler)
44  SINGLETON(PluginHandler)
45 
46  signals:
47  void sig_current_library_changed(const QString& name);
48  void sig_libraries_changed();
49 
50  private:
56  void init_library(Container* container);
57 
58 
59  public:
64  void init(const QList<Container*>& containers);
65 
66 
72 
73  void local_library_added(LibraryId id);
74  void local_library_renamed(LibraryId id);
75  void local_library_removed(LibraryId id);
76  void local_library_moved(LibraryId id, int from, int to);
77 
78  Container* current_library() const;
79  QMenu* current_library_menu() const;
80 
81  private slots:
82  void current_library_changed(int library_idx);
83 
84  public slots:
85  void set_current_library(const QString& name);
86  void set_current_library(Container* container);
87  };
88 }
89 
90 #endif // LIBRARYPLUGINLOADER_H
Definition: LibraryContainer.h:46
QList< Container * > get_libraries() const
Get a list for all found plugins. The ui is not necessarily initialized.
void init(const QList< Container *> &containers)
Search for plugins and add some predefined plugins.
An interface class needed when implementing a library plugin.
Definition: CachingThread.h:29
Library Plugin Manager.
Definition: LibraryPluginHandler.h:39
Definition: org_mpris_media_player2_adaptor.h:20