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 <QObject>
29 
30 class QMenu;
31 namespace Library
32 {
33  class Info;
34  class Container;
35 
40  class PluginHandler :
41  public QObject,
42  protected SayonaraClass
43  {
44  Q_OBJECT
45  PIMPL(PluginHandler)
46  SINGLETON(PluginHandler)
47 
48  signals:
49  void sig_current_library_changed(const QString& name);
50  void sig_libraries_changed();
51 
52  private:
58  void init_library(Container* container);
59 
60 
61  public:
66  void init(const QList<Container*>& containers);
67 
68 
74 
75  void local_library_added(LibraryId id);
76  void local_library_renamed(LibraryId id);
77  void local_library_removed(LibraryId id);
78  void local_library_moved(LibraryId id, int from, int to);
79 
80  Container* current_library() const;
81  QMenu* current_library_menu() const;
82 
83  private slots:
84  void current_library_changed(int library_idx);
85 
86  public slots:
87  void set_current_library(const QString& name);
88  void set_current_library(Container* container);
89  };
90 }
91 
92 #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:29
Library Plugin Manager.
Definition: LibraryPluginHandler.h:40
Definition: org_mpris_media_player2_adaptor.h:20