-
Notifications
You must be signed in to change notification settings - Fork 1
/
TemplatePlugin.h
62 lines (54 loc) · 1.7 KB
/
TemplatePlugin.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 {{ plugin_name | upper }}PLUGIN_H_INCLUDED
#define {{ plugin_name | upper }}PLUGIN_H_INCLUDED
#include <QWidget>
#include <QString>
#include "toolkit_interfaces.h"
#include "toolkit_config.h"
#include "toolkit_errors.h"
#include "util.h"
{% if add_extension -%}
#include "{{ plugin_name }}ModelExtension.h"
{%- endif %}
#ifdef TOOLKIT_COMPILE_PLUGIN_{{ plugin_name | upper }}
#define TOOLKIT_PLUGIN_{{ plugin_name | upper }}_DLLAPI TOOLKIT_DLLEXPORT
#else
#define TOOLKIT_PLUGIN_{{ plugin_name | upper }}_DLLAPI TOOLKIT_PLUGIN_DLLAPI
#endif
{% if core -%}
class TOOLKIT_PLUGIN_{{ plugin_name | upper }}_DLLAPI {{ plugin_name }}Plugin : public QObject, public CoreInterface {
Q_OBJECT
Q_INTERFACES(CoreInterface)
Q_PLUGIN_METADATA(IID CoreInterface_iid FILE "metadata.json")
{%- else %}
class TOOLKIT_PLUGIN_{{ plugin_name | upper }}_DLLAPI {{ plugin_name }}Plugin : public QObject, public OptionalInterface {
Q_OBJECT
Q_INTERFACES(OptionalInterface)
Q_PLUGIN_METADATA(IID OptionalInterface_iid FILE "metadata.json")
{%- endif %}
public:
{{ plugin_name }}Plugin();
virtual ~{{ plugin_name }}Plugin();
void init(ToolkitApp* app);
{% if add_extension and filereader -%}
{{ plugin_name }}ModelExtension* load{{ plugin_name }}File(QString path);
{%- endif %}
private:
ToolkitApp* parentApp;
{% if filereader -%}
QAction* load_file_trigger;
{%- endif %}
{% if settings -%}
void load{{ plugin_name }}Settings();
{%- endif %}
{% if add_extension and reload -%}
std::map<RBDLModelWrapper*, QString> model_file_map;
{%- endif %}
public Q_SLOTS:
{% if filereader -%}
void action_load_data();
{%- endif %}
{% if reload -%}
void reload(RBDLModelWrapper* model);
{%- endif %}
};
#endif