summaryrefslogtreecommitdiff
path: root/examples/qtcpp/generator/templates/abstractinterface.h
blob: aac9ac8bedc4c1d4f18ba1850872859059717063 (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
{# 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.is_readonly%}WRITE set{{property|upperfirst}} {%endif%}NOTIFY {{property}}Changed)
{% endfor %}

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

{%- for operation in interface.operations %}    
    virtual {{operation|returnType}} {{operation}}({{operation.parameters|map('parameterType')|join(', ')}}) = 0;
{% endfor %}

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

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

Q_SIGNALS:
{% for property in interface.properties %}
    void {{property}}Changed({{property|parameterType}});
{% endfor %}

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