generated from QuardCRT-platform/plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtextstatistics.h
42 lines (32 loc) · 1.36 KB
/
textstatistics.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
#ifndef TEXTSTATISTICS_H_
#define TEXTSTATISTICS_H_
#include "plugininterface.h"
#define PLUGIN_NAME "Text Statistics"
#define PLUGIN_VERSION "0.0.2"
#define PLUGIN_WEBSITE "https://github.com/QuardCRT-platform/plugin-TextStatistics"
class TextStatistics : public PluginInterface
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.quardCRT.PluginInterface" FILE "./plugininterface/plugininterface.json")
Q_INTERFACES(PluginInterface)
public:
TextStatistics() : m_action(nullptr) {}
virtual ~TextStatistics() {}
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("QAction", (void *)m_action);
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);
private:
QAction *m_action;
QString m_website = QString(PLUGIN_WEBSITE);
};
#endif /* TEXTSTATISTICS_H_ */