summaryrefslogtreecommitdiff
path: root/examples/qtcpp/generator/templates/module.h
blob: 65ba2dbd43d2376910aca55ddba2bd495cee6e7f (plain)
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
{# Copyright (c) Pelagicore AB 2016 #}
/****************************************************************************
** This is an auto-generated file.
** Do not edit! All changes made to it will be lost.
****************************************************************************/
{% set class = 'Qml{0}Module'.format(module.module_name) %}

#pragma once

#include <QtCore>

{% for struct in module.structs %}
#include "qml{{struct|lower}}.h"
#include "qml{{struct|lower}}model.h"
{% endfor %}

class {{class}} : public QObject {
    Q_OBJECT
public:
    {{class}}(QObject *parent=0);

{% for enum in module.enums %}
    {% set comma = joiner(",") %}
    enum {{enum}} { 
        {%- for member in enum.members -%}
        {{ comma() }}
        {{member.name}} = {{member.value}}
        {%- endfor %}
    
    };
    Q_ENUM({{enum}})
{% endfor %}

{% for struct in module.structs %}
    Q_INVOKABLE Qml{{struct}} create{{struct}}();
{% endfor %}

    static void registerTypes();
    static void registerQmlTypes(const QString& uri, int majorVersion = 1, int minorVersion = 0);
};