Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / mojo / public / tools / bindings / generators / cpp_templates / module.h.tmpl
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.
4
5 {%- set header_guard = "%s_H_"|
6         format(module.path|upper|replace("/","_")|replace(".","_")) %}
7
8 #ifndef {{header_guard}}
9 #define {{header_guard}}
10
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"
24 {%- endfor %}
25
26 {%- for namespace in namespaces_as_array %}
27 namespace {{namespace}} {
28 {%- endfor %}
29
30 {#--- Constants #}
31 {%  for constant in module.constants %}
32 extern const {{constant.kind|cpp_pod_type}} {{constant.name}};
33 {%- endfor %}
34
35 {#--- Enums #}
36 {%  for enum in enums %}
37 {%    include "enum_declaration.tmpl" %}
38 {%- endfor %}
39
40 {#--- Interface Forward Declarations -#}
41 {%  for interface in interfaces %}
42 class {{interface.name}};
43 typedef mojo::InterfacePtr<{{interface.name}}> {{interface.name}}Ptr;
44 {%  endfor %}
45
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;
51 {%    else %}
52 typedef mojo::StructPtr<{{struct.name}}> {{struct.name}}Ptr;
53 {%    endif %}
54 {%  endfor %}
55
56 {#--- NOTE: Non-inlined structs may have pointers to inlined structs, so we  #}
57 {#---       need to fully define inlined structs ahead of the others.        #}
58
59 {#--- Inlined structs #}
60 {%  for struct in structs %}
61 {%    if struct|should_inline %}
62 {%      include "wrapper_class_declaration.tmpl" %}
63 {%    endif %}
64 {%- endfor %}
65
66 {#--- Non-inlined structs #}
67 {%  for struct in structs %}
68 {%    if not struct|should_inline %}
69 {%      include "wrapper_class_declaration.tmpl" %}
70 {%    endif %}
71 {%- endfor %}
72
73 {#--- Interfaces -#}
74 {%  for interface in interfaces %}
75 {%    include "interface_declaration.tmpl" %}
76 {%- endfor %}
77
78 {#--- Interface Proxies -#}
79 {%  for interface in interfaces %}
80 {%    include "interface_proxy_declaration.tmpl" %}
81 {%- endfor %}
82
83 {#--- Interface Stubs -#}
84 {%  for interface in interfaces %}
85 {%    include "interface_stub_declaration.tmpl" %}
86 {%- endfor %}
87
88 {#--- Interface Request Validators -#}
89 {%  for interface in interfaces %}
90 {%    include "interface_request_validator_declaration.tmpl" %}
91 {%- endfor %}
92
93 {#--- Interface Response Validators -#}
94 {%  for interface in interfaces if interface|has_callbacks %}
95 {%    include "interface_response_validator_declaration.tmpl" %}
96 {%- endfor %}
97
98 {#--- Struct Serialization Helpers -#}
99 {%  if structs %}
100 {%    for struct in structs %}
101 {%      include "struct_serialization_declaration.tmpl" %}
102 {%-   endfor %}
103 {%- endif %}
104
105 {%- for namespace in namespaces_as_array|reverse %}
106 }  // namespace {{namespace}}
107 {%- endfor %}
108
109 #endif  // {{header_guard}}