1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 {%- set header_guard = "%s_H_"|
6 format(module.path|upper|replace("/","_")|replace(".","_")) %}
8 #ifndef {{header_guard}}
9 #define {{header_guard}}
11 #include "mojo/public/cpp/bindings/array.h"
12 #include "mojo/public/cpp/bindings/callback.h"
13 #include "mojo/public/cpp/bindings/interface_impl.h"
14 #include "mojo/public/cpp/bindings/interface_ptr.h"
15 #include "mojo/public/cpp/bindings/interface_request.h"
16 #include "mojo/public/cpp/bindings/map.h"
17 #include "mojo/public/cpp/bindings/message_filter.h"
18 #include "mojo/public/cpp/bindings/no_interface.h"
19 #include "mojo/public/cpp/bindings/string.h"
20 #include "mojo/public/cpp/bindings/struct_ptr.h"
21 #include "{{module.path}}-internal.h"
22 {%- for import in imports %}
23 #include "{{import.module.path}}.h"
26 {%- for namespace in namespaces_as_array %}
27 namespace {{namespace}} {
31 {% for constant in module.constants %}
32 extern const {{constant.kind|cpp_pod_type}} {{constant.name}};
36 {% for enum in enums %}
37 {% include "enum_declaration.tmpl" %}
40 {#--- Interface Forward Declarations -#}
41 {% for interface in interfaces %}
42 class {{interface.name}};
43 typedef mojo::InterfacePtr<{{interface.name}}> {{interface.name}}Ptr;
46 {#--- Struct Forward Declarations -#}
47 {% for struct in structs %}
48 class {{struct.name}};
49 {% if struct|should_inline %}
50 typedef mojo::InlinedStructPtr<{{struct.name}}> {{struct.name}}Ptr;
52 typedef mojo::StructPtr<{{struct.name}}> {{struct.name}}Ptr;
56 {#--- NOTE: Non-inlined structs may have pointers to inlined structs, so we #}
57 {#--- need to fully define inlined structs ahead of the others. #}
59 {#--- Inlined structs #}
60 {% for struct in structs %}
61 {% if struct|should_inline %}
62 {% include "wrapper_class_declaration.tmpl" %}
66 {#--- Non-inlined structs #}
67 {% for struct in structs %}
68 {% if not struct|should_inline %}
69 {% include "wrapper_class_declaration.tmpl" %}
74 {% for interface in interfaces %}
75 {% include "interface_declaration.tmpl" %}
78 {#--- Interface Proxies -#}
79 {% for interface in interfaces %}
80 {% include "interface_proxy_declaration.tmpl" %}
83 {#--- Interface Stubs -#}
84 {% for interface in interfaces %}
85 {% include "interface_stub_declaration.tmpl" %}
88 {#--- Interface Request Validators -#}
89 {% for interface in interfaces %}
90 {% include "interface_request_validator_declaration.tmpl" %}
93 {#--- Interface Response Validators -#}
94 {% for interface in interfaces if interface|has_callbacks %}
95 {% include "interface_response_validator_declaration.tmpl" %}
98 {#--- Struct Serialization Helpers -#}
100 {% for struct in structs %}
101 {% include "struct_serialization_declaration.tmpl" %}
105 {%- for namespace in namespaces_as_array|reverse %}
106 } // namespace {{namespace}}
109 #endif // {{header_guard}}