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 "Utils/Settings/SayonaraClass.h"
25 #include "Utils/Singleton.h"
26 #include "Utils/Pimpl.h"
27 
28 #include <QList>
29 #include <QObject>
30 
31 class QMenu;
32 namespace Library
33 {
34  class Info;
35  class Container;
36 
41  class PluginHandler :
42  public QObject,
43  protected SayonaraClass
44  {
45  Q_OBJECT
46  PIMPL(PluginHandler)
47  SINGLETON(PluginHandler)
48 
49  signals:
50  void sig_current_library_changed(const QString& name);
51  void sig_libraries_changed();
52 
53  private:
59  void init_library(Container* container);
60 
61 
62  public:
67  void init(const QList<Container*>& containers);
68 
69 
75 
76  void local_library_added(LibraryId id);
77  void local_library_renamed(LibraryId id);
78  void local_library_removed(LibraryId id);
79  void local_library_moved(LibraryId id, int from, int to);
80 
81  Container* current_library() const;
82  QMenu* current_library_menu() const;
83 
84  private slots:
85  void current_library_changed(int library_idx);
86 
87  public slots:
88  void set_current_library(const QString& name);
89  void set_current_library(Container* container);
90  };
91 }
92 
93 #endif // LIBRARYPLUGINLOADER_H
Definition: LibraryContainer.h:47
The SayonaraClass class provides access to Settings and notifications.
Definition: SayonaraClass.h:29
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:31
Library Plugin Manager.
Definition: LibraryPluginHandler.h:41
Definition: org_mpris_media_player2_adaptor.h:20