aboutsummaryrefslogtreecommitdiffstats
path: root/qface/builtin/qtcpp/templates/abstractinterface.h
blob: 17be77ad0e526a7b4c2569201a81d4ddf1bb3079 (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
41
42
43
44
45
46
47
48
49
50
51
52
{# Copyright (c) Pelagicore AB 2016 #}
{% set class = 'QmlAbstract{0}'.format(interface) %}
/****************************************************************************
** This is an auto-generated file.
** Do not edit! All changes made to it will be lost.
****************************************************************************/

#pragma once

#include <QtCore>

#include "qml{{module.module_name|lower}}module.h"

class {{class}} : public QObject
{
    Q_OBJECT
{% for property in interface.properties %}
    Q_PROPERTY({{property|returnType}} {{property}} READ {{property}} {% if not property.readonly %}WRITE set{{property|upperfirst}} {% endif %}{% if not property.const %}NOTIFY {{property}}Changed{% endif %})
{% endfor %}

public:
    {{class}}(QObject *parent = nullptr);
    ~{{class}}();

public Q_SLOTS:
{% for operation in interface.operations %}
    virtual {{operation|returnType}} {{operation}}({{operation.parameters|map('parameterType')|join(', ')}});
{% endfor %}

public:
{% for property in interface.properties %}
    virtual void set{{property|upperfirst}}({{ property|parameterType }});
{% endfor %}

public:
{% for property in interface.properties %}
    virtual {{property|returnType}} {{property}}() const;
{% endfor %}

Q_SIGNALS:
{% for signal in interface.signals %}
    void {{signal}}({{signal.parameters|map('parameterType')|join(', ')}});
{% endfor %}
{% for property in interface.properties %}
    void {{property}}Changed();
{% endfor %}

protected:
{% for property in interface.properties %}
    {{property|returnType}} m_{{property}};
{% endfor %}
};