File indexing completed on 2024-05-05 04:37:27

0001 {% extends "cpp_implementation.cpp" %}
0002 {% load kdev_filters %}
0003 
0004 
0005 {% block includes %}
0006 {{ block.super }}
0007 #include "{{ output_file_privateheader }}"
0008 {% endblock includes %}
0009 
0010 
0011 {% block extra_definitions %}
0012 
0013 {% for method in private_functions %}
0014 {% with name|add:"Private" as name %}
0015 
0016 {% include "method_definition_cpp.txt" %}
0017 {
0018     {% if method.type %}
0019     return {{ method.default_return_value }};
0020     {% endif %}
0021 }
0022 
0023 {% endwith %}
0024 {% endfor %}
0025 
0026 {% endblock extra_definitions %}
0027 
0028 
0029 {% block function_definitions %}
0030 
0031 {% for method in public_functions %}
0032 {% with method.arguments as arguments %}
0033 
0034 {% include "method_definition_cpp.txt" %}
0035 {% if method.isConstructor %}
0036     {% with arguments|first as argFirst %}
0037     {# copy constructor? #}
0038     {% if arguments|length == 1 and argFirst.type == method.name|arg_type %}
0039     : d_ptr(new {{ name }}Private(*{{ argFirst.name }}.d_ptr))
0040     {% else %}
0041     : d_ptr(new {{ name }}Private())
0042     {% endif %}
0043     {% endwith %}
0044 {% endif %}
0045 {
0046 {% block public_method_body %}
0047     {% if method.isConstructor %}
0048 {% block public_constructor_body %}
0049 {% endblock public_constructor_body %}
0050     {% elif method.isDestructor %}
0051 {% block public_destructor_body %}
0052     delete d_ptr;
0053 {% endblock public_destructor_body %}
0054     {% elif method.type %}
0055     return {{ method.default_return_value }};
0056     {% endif %}
0057 {% endblock public_method_body %}
0058 }
0059 
0060 {% endwith %}
0061 {% endfor %}
0062 
0063 {% for property in members %}
0064 
0065 
0066 {% include "class_property_getter_definition_cpp.txt" %}
0067 {
0068     Q_D(const {{ name }});
0069     return d->{{ property.name }};
0070 }
0071 
0072 
0073 {% include "class_property_setter_definition_cpp.txt" %}
0074 {
0075     Q_D({{ name }});
0076     if (d->{{ property.name }} == {{ property.name }}) {
0077         return;
0078     }
0079 
0080 
0081     d->{{ property.name }} = {{ property.name }};
0082     emit {{ property.name }}Changed(d->{{ property.name }});
0083 }
0084 
0085 {% endfor %}
0086 
0087 {% for method in protected_functions %}
0088 {% with method.arguments as arguments %}
0089 
0090 {% include "method_definition_cpp.txt" %}
0091 {% if method.isConstructor %}
0092     {% with arguments|first as argFirst %}
0093     {# copy constructor? #}
0094     {% if arguments|length == 1 and argFirst.type == method.name|arg_type %}
0095     : d_ptr(new {{ name }}Private(*{{ argFirst.name }}.d_ptr))
0096     {% else %}
0097     : d_ptr(new {{ name }}Private())
0098     {% endif %}
0099     {% endwith %}
0100 {% endif %}
0101 {
0102 {% block protected_method_body %}
0103    {% if method.isConstructor %}
0104 {% block protected_constructor_body %}
0105 {% endblock protected_constructor_body %}
0106     {% elif method.isDestructor %}
0107 {% block protected_destructor_body %}
0108     delete d_ptr;
0109 {% endblock protected_destructor_body %}
0110     {% elif method.type %}
0111     return {{ method.default_return_value }};
0112     {% endif %}
0113 {% endblock protected_method_body %}
0114 }
0115 
0116 {% endwith %}
0117 {% endfor %}
0118 
0119 {% endblock function_definitions %}