Sayonara Player
LibraryPluginHandler.h
1/* LibraryPluginLoader.h */
2
3/* Copyright (C) 2011-2020 Michael Lugmair (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
29class QMenu;
30namespace Library
31{
32 class Info;
33 class AbstractContainer;
34
40 public QObject
41 {
42 Q_OBJECT
43 PIMPL(PluginHandler)
44 SINGLETON(PluginHandler)
45
46 signals:
47 void sigNewLibraryRequested(const QString& name, const QString& path);
48 void sigCurrentLibraryChanged();
49 void sigLibrariesChanged();
50
51 private:
52 void initLibraries(const QList<AbstractContainer*>& containers);
53 void initDllLibraries();
54
55 public:
60 void init(const QList<AbstractContainer*>& containers, AbstractContainer* fallback_library);
61 void shutdown();
62
67 QList<AbstractContainer*> libraries(bool also_empty) const;
68
69 AbstractContainer* currentLibrary() const;
70 QWidget* currentLibraryWidget() const;
71
72 void addLocalLibrary(AbstractContainer* container);
73 void renameLocalLibrary(const QString& old_name, const QString& new_name);
74 void removeLocalLibrary(const QString& name);
75 void moveLocalLibrary(int old_local_library_index, int new_local_library_index);
76
77 public slots:
78 void setCurrentLibrary(const QString& name);
79 void setCurrentLibrary(int index);
80 void setCurrentLibrary(AbstractContainer* container);
81 };
82}
83
84#endif // LIBRARYPLUGINLOADER_H
This container is only used internally to avoid Ui dependencies in the Components....
Definition: AbstractLibraryContainer.h:20
Library Plugin Manager.
Definition: LibraryPluginHandler.h:41
void init(const QList< AbstractContainer * > &containers, AbstractContainer *fallback_library)
Search for plugins and add some predefined plugins.
QList< AbstractContainer * > libraries(bool also_empty) const
Get a list for all found plugins. The ui is not necessarily initialized.
Definition: EngineUtils.h:33
An interface class needed when implementing a library plugin.
Definition: LocalLibraryWatcher.h:31