Albert
Loading...
Searching...
No Matches
pluginloader.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2025 Manuel Schneider
2// SPDX-License-Identifier: MIT
3
4#pragma once
5#include <QObject>
6#include <QString>
7#include <albert/export.h>
8
9namespace albert
10{
11class PluginInstance;
12class PluginMetadata;
13
33class ALBERT_EXPORT PluginLoader : public QObject
34{
35 Q_OBJECT
36
37public:
39 virtual QString path() const = 0;
40
42 virtual const PluginMetadata &metadata() const = 0;
43
45 virtual void load() = 0;
46
48 virtual void unload() = 0;
49
52
54 static thread_local PluginLoader *current_loader;
55
56signals:
57
59 void finished(QString info);
60
61protected:
62
63 virtual ~PluginLoader();
64
65};
66
67}
Abstract plugin instance class.
Definition plugininstance.h:31
Asynchronous plugin loader.
Definition pluginloader.h:34
virtual const PluginMetadata & metadata() const =0
Returns the plugin metadata.
virtual albert::PluginInstance * instance()=0
Returns the PluginInstance if the plugin is loaded, else nullptr.
virtual void unload()=0
Unloads the plugin.
virtual void load()=0
Starts asynchronous loading process of the plugin.
static thread_local PluginLoader * current_loader
The static injection pointer.
Definition pluginloader.h:54
void finished(QString info)
Emitted when the loading process finished.
virtual QString path() const =0
Returns the path to the plugin.
Common plugin metadata.
Definition pluginmetadata.h:17
The Albert namespace.
Definition app.h:55