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 2009 Bo Yang <struggleyb.nku@gmail.com>
  6.  */
  7.  
  8. #ifndef dom_internal_html_collection_h_
  9. #define dom_internal_html_collection_h_
  10.  
  11. #include <dom/html/html_collection.h>
  12.  
  13. struct dom_node_internal;
  14.  
  15. typedef bool (*dom_callback_is_in_collection)(
  16.         struct dom_node_internal *node, void *ctx);
  17.  
  18. /**
  19.  * The html_collection structure
  20.  */
  21. struct dom_html_collection {
  22.         dom_callback_is_in_collection ic;
  23.                         /**< The function pointer used to test
  24.                          * whether some node is an element of
  25.                          * this collection
  26.                          */
  27.         void *ctx; /**< Context for the callback */
  28.         struct dom_html_document *doc;  /**< The document created this
  29.                                          * collection
  30.                                          */
  31.         struct dom_node_internal *root;
  32.                         /**< The root node of this collection */
  33.         uint32_t refcnt;
  34.                         /**< Reference counting */
  35. };
  36.  
  37. dom_exception _dom_html_collection_create(struct dom_html_document *doc,
  38.                 struct dom_node_internal *root,
  39.                 dom_callback_is_in_collection ic,
  40.                 void *ctx,
  41.                 struct dom_html_collection **col);
  42.  
  43. dom_exception _dom_html_collection_initialise(struct dom_html_document *doc,
  44.                 struct dom_html_collection *col,
  45.                 struct dom_node_internal *root,
  46.                 dom_callback_is_in_collection ic, void *ctx);
  47.  
  48. void _dom_html_collection_finalise(struct dom_html_collection *col);
  49.  
  50. void _dom_html_collection_destroy(struct dom_html_collection *col);
  51.  
  52. #endif
  53.  
  54.