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.  */
  7.  
  8. #ifndef dom_internal_core_attr_h_
  9. #define dom_internal_core_attr_h_
  10.  
  11. #include <dom/core/attr.h>
  12.  
  13. struct dom_document;
  14. struct dom_type_info;
  15.  
  16. dom_exception _dom_attr_create(struct dom_document *doc,
  17.                 dom_string *name, dom_string *namespace,
  18.                 dom_string *prefix, bool specified,
  19.                 struct dom_attr **result);
  20. void _dom_attr_destroy(struct dom_attr *attr);
  21. dom_exception _dom_attr_initialise(struct dom_attr *a,
  22.                 struct dom_document *doc, dom_string *name,
  23.                 dom_string *namespace, dom_string *prefix,
  24.                 bool specified, struct dom_attr **result);
  25. void _dom_attr_finalise(struct dom_attr *attr);
  26.  
  27. /* Virtual functions for dom_attr */
  28. dom_exception _dom_attr_get_name(struct dom_attr *attr,
  29.                                 dom_string **result);
  30. dom_exception _dom_attr_get_specified(struct dom_attr *attr, bool *result);
  31. dom_exception _dom_attr_get_value(struct dom_attr *attr,
  32.                                 dom_string **result);
  33. dom_exception _dom_attr_set_value(struct dom_attr *attr,
  34.                                 dom_string *value);
  35. dom_exception _dom_attr_get_owner(struct dom_attr *attr,
  36.                                 struct dom_element **result);
  37. dom_exception _dom_attr_get_schema_type_info(struct dom_attr *attr,
  38.                                 struct dom_type_info **result);
  39. dom_exception _dom_attr_is_id(struct dom_attr *attr, bool *result);
  40.  
  41. #define DOM_ATTR_VTABLE         \
  42.         _dom_attr_get_name, \
  43.         _dom_attr_get_specified, \
  44.         _dom_attr_get_value, \
  45.         _dom_attr_set_value, \
  46.         _dom_attr_get_owner, \
  47.         _dom_attr_get_schema_type_info, \
  48.         _dom_attr_is_id
  49.  
  50. /* Overloading dom_node functions */
  51. dom_exception _dom_attr_get_node_value(dom_node_internal *node,
  52.                 dom_string **result);
  53. dom_exception _dom_attr_clone_node(dom_node_internal *node, bool deep,
  54.                 dom_node_internal **result);
  55. dom_exception _dom_attr_set_prefix(dom_node_internal *node,
  56.                 dom_string *prefix);
  57. dom_exception _dom_attr_normalize(dom_node_internal *node);
  58. dom_exception _dom_attr_lookup_prefix(dom_node_internal *node,
  59.                 dom_string *namespace, dom_string **result);
  60. dom_exception _dom_attr_is_default_namespace(dom_node_internal *node,
  61.                 dom_string *namespace, bool *result);
  62. dom_exception _dom_attr_lookup_namespace(dom_node_internal *node,
  63.                 dom_string *prefix, dom_string **result);
  64. #define DOM_NODE_VTABLE_ATTR \
  65.         _dom_node_try_destroy, \
  66.         _dom_node_get_node_name, \
  67.         _dom_attr_get_node_value, /*overload*/\
  68.         _dom_node_set_node_value, \
  69.         _dom_node_get_node_type, \
  70.         _dom_node_get_parent_node, \
  71.         _dom_node_get_child_nodes, \
  72.         _dom_node_get_first_child, \
  73.         _dom_node_get_last_child, \
  74.         _dom_node_get_previous_sibling, \
  75.         _dom_node_get_next_sibling, \
  76.         _dom_node_get_attributes, \
  77.         _dom_node_get_owner_document, \
  78.         _dom_node_insert_before, \
  79.         _dom_node_replace_child, \
  80.         _dom_node_remove_child, \
  81.         _dom_node_append_child, \
  82.         _dom_node_has_child_nodes, \
  83.         _dom_attr_clone_node, /*overload*/\
  84.         _dom_node_normalize, \
  85.         _dom_node_is_supported, \
  86.         _dom_node_get_namespace, \
  87.         _dom_node_get_prefix, \
  88.         _dom_attr_set_prefix, /*overload*/\
  89.         _dom_node_get_local_name, \
  90.         _dom_node_has_attributes, \
  91.         _dom_node_get_base, \
  92.         _dom_node_compare_document_position, \
  93.         _dom_node_get_text_content, \
  94.         _dom_node_set_text_content, \
  95.         _dom_node_is_same, \
  96.         _dom_attr_lookup_prefix, /*overload*/\
  97.         _dom_attr_is_default_namespace, /*overload*/\
  98.         _dom_attr_lookup_namespace, /*overload*/\
  99.         _dom_node_is_equal, \
  100.         _dom_node_get_feature, \
  101.         _dom_node_set_user_data, \
  102.         _dom_node_get_user_data
  103.  
  104. /* The protected virtual functions */
  105. void __dom_attr_destroy(dom_node_internal *node);
  106. dom_exception _dom_attr_copy(dom_node_internal *old,
  107.                 dom_node_internal **copy);
  108.  
  109. #define DOM_ATTR_PROTECT_VTABLE \
  110.         __dom_attr_destroy, \
  111.         _dom_attr_copy
  112.  
  113.  
  114. void _dom_attr_set_isid(struct dom_attr *attr, bool is_id);
  115. void _dom_attr_set_specified(struct dom_attr *attr, bool specified);
  116. bool _dom_attr_readonly(const dom_attr *a);
  117.  
  118. #endif
  119.