-
Notifications
You must be signed in to change notification settings - Fork 75
Expand file tree
/
Copy pathPlugin.h
More file actions
66 lines (48 loc) · 1.64 KB
/
Plugin.h
File metadata and controls
66 lines (48 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// SPDX-License-Identifier: BSD-3-Clause
// SPDX-FileCopyrightText: The Monero Project
#ifndef PLUGIN_H
#define PLUGIN_H
#include <QString>
#include <QWidget>
#include <QTabWidget>
#include "libwalletqt/Wallet.h"
class Plugin : public QObject {
Q_OBJECT
public:
enum PluginType {
TAB = 0,
WIDGET
};
virtual QString id() = 0;
// Used for sorting
virtual int idx() const = 0;
// id of parent plugin, plugin is only loaded if parent is available
virtual QString parent() = 0;
virtual QString displayName() = 0;
virtual QString description() = 0;
virtual QString icon() = 0;
// register expected websocket data
virtual QStringList socketData() = 0;
virtual PluginType type() = 0;
virtual QWidget* tab() = 0;
virtual bool configurable() {return false;}
virtual QDialog* configDialog(QWidget *parent) {return nullptr;}
// the plugin is automatically enabled if it has any enabled children
virtual bool implicitEnable() {return false;}
virtual bool requiresWebsocket() {return true;}
// insert tab to the left of standard tabs
virtual bool insertFirst() {return false;}
virtual void addSubPlugin(Plugin* plugin) {}
virtual void initialize(Wallet *wallet, QObject *parent) = 0;
bool hasParent() {return !parent().isEmpty();}
signals:
void setStatusText(const QString &text, bool override, int timeout);
void fillSendTab(const QString &address, const QString &description);
public slots:
virtual void skinChanged() {}
virtual void uiSetup() {}
virtual void aboutToQuit() {}
protected:
Wallet* m_wallet = nullptr;
};
#endif //PLUGIN_H