Albert
Loading...
Searching...
No Matches
pluginloader.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2024-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
15class ALBERT_EXPORT PluginLoader : public QObject
16{
17 Q_OBJECT
18
19public:
20
22 virtual QString path() const = 0;
23
25 virtual const PluginMetadata &metadata() const = 0;
26
29 virtual void load() = 0;
30
32 virtual void unload() = 0;
33
36
41 static thread_local PluginLoader *current_loader;
42
43signals:
44
49 void finished(QString info);
50
51protected:
52
53 virtual ~PluginLoader();
54
55};
56
57}
Abstract plugin instance class.
Definition plugininstance.h:25
Asynchronous plugin loader turning a physical plugin into a logical PluginInstance.
Definition pluginloader.h:16
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:41
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:13
Albert core interface namespace.
Definition albert.h:14