generated from QuardCRT-platform/plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquickcomplete.h
47 lines (37 loc) · 1.75 KB
/
quickcomplete.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
#ifndef QUICKCOMPLETE_H_
#define QUICKCOMPLETE_H_
#include "plugininterface.h"
#define PLUGIN_NAME "Quick Complete"
#define PLUGIN_VERSION "0.0.3"
#define PLUGIN_WEBSITE "https://github.com/QuardCRT-platform/plugin-quickcomplete"
class QuickComplete : public PluginInterface
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.quardCRT.PluginInterface" FILE "./plugininterface/plugininterface.json")
Q_INTERFACES(PluginInterface)
public:
QuickComplete() : PluginInterface(), m_menu(nullptr), addQuickCompleteAction(nullptr), removeQuickCompleteAction(nullptr), clearQuickCompleteAction(nullptr) {}
virtual ~QuickComplete() {}
int init(QMap<QString, QString> params, QWidget *parent);
void setLanguage(const QLocale &language,QApplication *app);
void retranslateUi();
QString name() { return PLUGIN_NAME; }
QString version() { return PLUGIN_VERSION; }
QMap<QString,void *> metaObject() {
QMap<QString,void *> ret;
ret.insert("QMenu", (void *)m_menu);
ret.insert("website", (void *)(&m_website));
return ret;
}
QMenu *terminalContextMenu(QString selectedText, QString workingDirectory, QMenu *parentMenu) {Q_UNUSED(selectedText);Q_UNUSED(workingDirectory);Q_UNUSED(parentMenu); return nullptr;}
QList<QAction *> terminalContextAction(QString selectedText, QString workingDirectory, QMenu *parentMenu) {Q_UNUSED(selectedText);Q_UNUSED(workingDirectory);Q_UNUSED(parentMenu); return QList<QAction *>();}
private:
void quickCompleteListChanged();
QMenu *m_menu;
QString m_website = QString(PLUGIN_WEBSITE);
QAction *addQuickCompleteAction;
QAction *removeQuickCompleteAction;
QAction *clearQuickCompleteAction;
QStringList m_quickCompleteList;
};
#endif /* QUICKCOMPLETE_H_ */