Changeset View
Changeset View
Standalone View
Standalone View
file_templates/classes/qt_interface/interface.h
- This file was added.
1 | {% extends "cpp_header.h" %} | ||||
---|---|---|---|---|---|
2 | {% load kdev_filters %} | ||||
3 | | ||||
4 | {% block includes %} | ||||
5 | {{ block.super }} | ||||
6 | {% if not base_classes %} | ||||
7 | #include <QtPlugin> | ||||
8 | {% endif %} | ||||
9 | {% endblock %} | ||||
10 | | ||||
11 | {% block class_body %} | ||||
12 | public: | ||||
13 | {# doing our own destructor, to ensure there is one #} | ||||
14 | {% if not base_classes %} | ||||
15 | virtual ~{{ name }}(); | ||||
16 | {% else %}{# Assumption: subclassing only other interfaces #} | ||||
17 | ~{{ name }}() override; | ||||
18 | {% endif %} | ||||
19 | | ||||
20 | {% for method in public_functions %} | ||||
21 | {# skipping any defined destructor #} | ||||
22 | {% if not method.isDestructor %} | ||||
23 | {% include "method_declaration_cpp.txt" %} | ||||
24 | {% endif %} | ||||
25 | {% endfor %} | ||||
26 | | ||||
27 | {% for property in members %} | ||||
28 | | ||||
29 | virtual {{ property.type }} {{ property.name }}() const = 0; | ||||
30 | virtual void set{{ property.name|upper_first }}({{ property.type|arg_type }} {{ property.name }}) = 0; | ||||
31 | | ||||
32 | {% endfor %} | ||||
33 | {% if protected_functions %} | ||||
34 | | ||||
35 | protected: | ||||
36 | {% for method in protected_functions %} | ||||
37 | {# skipping any defined destructor #} | ||||
38 | {% if not method.isDestructor %} | ||||
39 | {% include "method_declaration_cpp.txt" %} | ||||
40 | {% endif %} | ||||
41 | {% endfor %} | ||||
42 | {% endif %} | ||||
43 | {% if private_functions %} | ||||
44 | | ||||
45 | private: | ||||
46 | {% for method in private_functions %} | ||||
47 | {# skipping any defined destructor #} | ||||
48 | {% if not method.isDestructor %} | ||||
49 | {% include "method_declaration.txt" %} | ||||
50 | {% endif %} | ||||
51 | {% endfor %} | ||||
52 | {% endif %} | ||||
53 | {% endblock class_body %} | ||||
54 | | ||||
55 | {% block outside_namespace %} | ||||
56 | {{ block.super }} | ||||
57 | Q_DECLARE_INTERFACE({% if namespaces %}{{ namespaces|join:"::" }}::{% endif %}{{ name }}, "{{ interfaceid }}") | ||||
58 | {% endblock %} |