blob: 25c01bb987d3870d9565081b8e30f84fdc3316a7 [file] [log] [blame]
{%- import "interface_macros.tmpl" as interface_macros %}
class {{interface.name}}Proxy;
class {{interface.name}}Stub;
class {{interface.name}}RequestValidator;
{%- if interface|has_callbacks %}
class {{interface.name}}ResponseValidator;
{%- endif %}
{% if interface.client %}
class {{interface.client}};
{% endif %}
class {{interface.name}} {
public:
static const char* Name_;
using Proxy_ = {{interface.name}}Proxy;
using Stub_ = {{interface.name}}Stub;
using RequestValidator_ = {{interface.name}}RequestValidator;
{%- if interface|has_callbacks %}
using ResponseValidator_ = {{interface.name}}ResponseValidator;
{%- else %}
using ResponseValidator_ = mojo::PassThroughFilter;
{%- endif %}
{% if interface.client %}
using Client = {{interface.client}};
{% else %}
using Client = mojo::NoInterface;
{% endif %}
{#--- Constants #}
{%- for constant in interface.constants %}
static const {{constant.kind|cpp_pod_type}} {{constant.name}};
{%- endfor %}
{#--- Enums #}
{%- for enum in interface.enums %}
{% macro enum_def() %}{% include "enum_declaration.tmpl" %}{% endmacro %}
{{enum_def()|indent(2)}}
{%- endfor %}
{#--- Methods #}
virtual ~{{interface.name}}() {}
{%- for method in interface.methods %}
{% if method.response_parameters != None %}
using {{method.name}}Callback = {{interface_macros.declare_callback(method)}};
{%- endif %}
virtual void {{method.name}}({{interface_macros.declare_request_params("", method)}}) = 0;
{%- endfor %}
};