Sayonara Player
Loading...
Searching...
No Matches
LibraryPluginHandler.h
1/* LibraryPluginLoader.h */
2
3/* Copyright (C) 2011-2024 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 <QList>
25#include <QObject>
26
27#include <memory>
28
29class QMenu;
30class QString;
31class QWidget;
32
33namespace Library
34{
35 class Info;
36 class LibraryContainer;
37
39 public QObject
40 {
41 Q_OBJECT
42
43 signals:
44 void sigNewLibraryRequested(const QString& name, const QString& path);
45 void sigCurrentLibraryChanged();
46 void sigLibrariesChanged();
47
48 public:
49 ~PluginHandler() override;
50
51 virtual void init(const QList<LibraryContainer*>& containers, LibraryContainer* fallbackLibrary) = 0;
52
53 [[nodiscard]] virtual QList<LibraryContainer*> libraries(bool alsoEmpty) const = 0;
54 [[nodiscard]] virtual LibraryContainer* currentLibrary() const = 0;
55 [[nodiscard]] virtual QWidget* currentLibraryWidget() const = 0;
56
57 // LocalLibraryWatcher
58 virtual void addLocalLibrary(LibraryContainer* container) = 0;
59 virtual void renameLocalLibrary(const QString& oldName, const QString& newName) = 0;
60 virtual void removeLocalLibrary(const QString& name) = 0;
61 virtual void moveLocalLibrary(int oldIndex, int newIndex) = 0;
62
63 static PluginHandler* create();
64
65 public slots: // NOLINT(readability-redundant-access-specifiers)
66 virtual void setCurrentLibrary(const QString& name) = 0;
67 virtual void setCurrentLibrary(int index) = 0;
68 virtual void setCurrentLibrary(LibraryContainer* currentLibrary) = 0;
69 };
70
71}
72
73#endif // LIBRARYPLUGINLOADER_H
The Info class.
Definition LibraryInfo.h:38
Definition LibraryContainer.h:35
Definition LibraryPluginHandler.h:40
Definition EngineUtils.h:33