Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / mojo / public / tools / bindings / generators / cpp_templates / wrapper_class_declaration.tmpl
1
2 class {{struct.name}} {
3  public:
4   typedef internal::{{struct.name}}_Data Data_;
5
6 {#--- Constants #}
7 {%- for constant in struct.constants %}
8   static const {{constant.kind|cpp_pod_type}} {{constant.name}};
9 {%- endfor %}
10 {#--- Enums #}
11 {%- for enum in struct.enums -%}
12 {%    macro enum_def() %}{% include "enum_declaration.tmpl" %}{% endmacro %}
13   {{enum_def()|indent(2)}}
14 {%- endfor %}
15   static {{struct.name}}Ptr New();
16
17   template <typename U>
18   static {{struct.name}}Ptr From(const U& u) {
19     return mojo::TypeConverter<{{struct.name}}Ptr, U>::Convert(u);
20   }
21
22   {{struct.name}}();
23   ~{{struct.name}}();
24
25 {#--- Getters #}
26 {%  for field in struct.fields %}
27 {%-   set type = field.kind|cpp_wrapper_type %}
28 {%-   set name = field.name %}
29   {{type}} {{name}};
30 {%- endfor %}
31 };