forked from PinappleUnderTheSea/os223
-
Notifications
You must be signed in to change notification settings - Fork 0
/
selfstartupplugin.h
61 lines (46 loc) · 1.73 KB
/
selfstartupplugin.h
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
#ifndef SELFSTARTUPPLUGIN_H
#define SELFSTARTUPPLUGIN_H
#include <dde-dock/pluginsiteminterface.h>
#include <dde-dock/pluginproxyinterface.h>
#include <QObject>
#include <QLabel>
#include <QFile>
#include <cstdio>
#include <QDebug>
#include "appletwidget.h"
#include "mainwidget.h"
#include "aboutdialog.h"
class SelfStartupPlugin : public QObject, PluginsItemInterface
{
private:
MainWidget *m_pluginWidget;
AppletWidget *m_appletWidget;
Q_OBJECT
// 声明实现了的接口
Q_INTERFACES(PluginsItemInterface)
// 插件元数据
Q_PLUGIN_METADATA(IID "com.deepin.dock.PluginsItemInterface" FILE "self_startup.json")
public:
explicit SelfStartupPlugin(QObject *parent = nullptr);
// 返回插件的名称,必须是唯一值,不可以和其它插件冲突
const QString pluginName() const override;
// 插件初始化函数
void init(PluginProxyInterface *proxyInter) override;
const QString pluginDisplayName() const override;
// 返回插件的 widget
QWidget *itemWidget(const QString &itemKey) override;
// PluginMode status() const override;
// QString description() const override;
//弹窗
QWidget *itemPopupApplet(const QString &itemKey) override;
// QIcon icon(const DockPart &dockPart, int themeType) override;
// PluginFlags flags() const override;
// void writeConfig(Settings *settings);
bool pluginIsAllowDisable() override;
bool pluginIsDisable() override;
void pluginStateSwitched() override;
// void about();
const QString itemContextMenu(const QString &itemKey) override; //TODO
void invokedMenuItem(const QString &itemKey, const QString &menuId, const bool checked) override; //TODO
};
#endif // SELFSTARTUPPLUGIN_H