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
19class ALBERT_EXPORT PluginLoader : public QObject
20{
21 Q_OBJECT
22
23public:
24
28 virtual QString path() const = 0;
29
33 virtual const PluginMetadata &metadata() const = 0;
34
40 virtual void load() = 0;
41
45 virtual void unload() = 0;
46
51
59 static thread_local PluginLoader *current_loader;
60
61signals:
62
70 void finished(QString info);
71
72protected:
73
74 virtual ~PluginLoader();
75
76};
77
78}
Abstract plugin instance class.
Definition plugininstance.h:31
Asynchronous plugin loader turning a physical plugin into a logical plugin instance.
Definition pluginloader.h:20
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 loading the plugin.
static thread_local PluginLoader * current_loader
Used to set the plugin loader while plugin instatiation.
Definition pluginloader.h:59
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
Definition app.h:56