Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. /*
  2.  * This file is part of libdom.
  3.  * Licensed under the MIT License,
  4.  *                http://www.opensource.org/licenses/mit-license.php
  5.  * Copyright 2007 John-Mark Bell <jmb@netsurf-browser.org>
  6.  * Copyright 2007 James Shaw <jshaw@netsurf-browser.org>
  7.  */
  8.  
  9. #ifndef dom_core_document_type_h_
  10. #define dom_core_document_type_h_
  11.  
  12. #include <dom/core/exceptions.h>
  13. #include <dom/core/node.h>
  14.  
  15. struct dom_namednodemap;
  16.  
  17. typedef  struct dom_document_type dom_document_type;
  18. /* The Dom DocumentType vtable */
  19. typedef struct dom_document_type_vtable {
  20.         struct dom_node_vtable base;
  21.  
  22.         dom_exception (*dom_document_type_get_name)(
  23.                         struct dom_document_type *doc_type,
  24.                         dom_string **result);
  25.         dom_exception (*dom_document_type_get_entities)(
  26.                         struct dom_document_type *doc_type,
  27.                         struct dom_namednodemap **result);
  28.         dom_exception (*dom_document_type_get_notations)(
  29.                         struct dom_document_type *doc_type,
  30.                         struct dom_namednodemap **result);
  31.         dom_exception (*dom_document_type_get_public_id)(
  32.                         struct dom_document_type *doc_type,
  33.                         dom_string **result);
  34.         dom_exception (*dom_document_type_get_system_id)(
  35.                         struct dom_document_type *doc_type,
  36.                         dom_string **result);
  37.         dom_exception (*dom_document_type_get_internal_subset)(
  38.                         struct dom_document_type *doc_type,
  39.                         dom_string **result);
  40. } dom_document_type_vtable;
  41.  
  42. static inline dom_exception dom_document_type_get_name(
  43.                 struct dom_document_type *doc_type, dom_string **result)
  44. {
  45.         return ((dom_document_type_vtable *) ((dom_node *) (doc_type))->vtable)
  46.                         ->dom_document_type_get_name(doc_type, result);
  47. }
  48. #define dom_document_type_get_name(dt, r) dom_document_type_get_name( \
  49.                 (dom_document_type *) (dt), (r))
  50.  
  51. static inline dom_exception dom_document_type_get_entities(
  52.                 struct dom_document_type *doc_type,
  53.                 struct dom_namednodemap **result)
  54. {
  55.         return ((dom_document_type_vtable *) ((dom_node *) (doc_type))->vtable)
  56.                         ->dom_document_type_get_entities(doc_type, result);
  57. }
  58. #define dom_document_type_get_entities(dt, r) dom_document_type_get_entities( \
  59.                 (dom_document_type *) (dt), (struct dom_namednodemap **) (r))
  60.  
  61. static inline dom_exception dom_document_type_get_notations(
  62.                 struct dom_document_type *doc_type,
  63.                 struct dom_namednodemap **result)
  64. {
  65.         return ((dom_document_type_vtable *) ((dom_node *) (doc_type))->vtable)
  66.                         ->dom_document_type_get_notations(doc_type, result);
  67. }
  68. #define dom_document_type_get_notations(dt, r) dom_document_type_get_notations(\
  69.                 (dom_document_type *) (dt), (struct dom_namednodemap **) (r))
  70.  
  71. static inline dom_exception dom_document_type_get_public_id(
  72.                 struct dom_document_type *doc_type,
  73.                 dom_string **result)
  74. {
  75.         return ((dom_document_type_vtable *) ((dom_node *) (doc_type))->vtable)
  76.                         ->dom_document_type_get_public_id(doc_type, result);
  77. }
  78. #define dom_document_type_get_public_id(dt, r) \
  79.                 dom_document_type_get_public_id((dom_document_type *) (dt), \
  80.                 (r))
  81.  
  82. static inline dom_exception dom_document_type_get_system_id(
  83.                 struct dom_document_type *doc_type,
  84.                 dom_string **result)
  85. {
  86.         return ((dom_document_type_vtable *) ((dom_node *) (doc_type))->vtable)
  87.                         ->dom_document_type_get_system_id(doc_type, result);
  88. }
  89. #define dom_document_type_get_system_id(dt, r) \
  90.                 dom_document_type_get_system_id((dom_document_type *) (dt), \
  91.                 (r))
  92.  
  93. static inline dom_exception dom_document_type_get_internal_subset(
  94.                 struct dom_document_type *doc_type,
  95.                 dom_string **result)
  96. {
  97.         return ((dom_document_type_vtable *) ((dom_node *) (doc_type))->vtable)
  98.                         ->dom_document_type_get_internal_subset(doc_type,
  99.                         result);
  100. }
  101. #define dom_document_type_get_internal_subset(dt, r) \
  102.                 dom_document_type_get_internal_subset( \
  103.                 (dom_document_type *) (dt), (r))
  104.  
  105.  
  106. #endif
  107.