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_events_document_event_h_
  9. #define dom_internal_events_document_event_h_
  10.  
  11. #include <dom/events/document_event.h>
  12.  
  13. struct dom_event_listener;
  14. struct lwc_string_s;
  15. struct dom_document;
  16.  
  17. /**
  18.  * Type of Events
  19.  */
  20. typedef enum {
  21.         DOM_EVENT = 0,
  22.         DOM_CUSTOM_EVENT,
  23.         DOM_UI_EVENT,
  24.         DOM_TEXT_EVENT,
  25.         DOM_KEYBOARD_EVENT,
  26.         DOM_MOUSE_EVENT,
  27.         DOM_MOUSE_MULTI_WHEEL_EVENT,
  28.         DOM_MOUSE_WHEEL_EVENT,
  29.         DOM_MUTATION_EVENT,
  30.         DOM_MUTATION_NAME_EVENT,
  31.  
  32.         DOM_EVENT_COUNT
  33. } dom_event_type;
  34.  
  35. /**
  36.  * The DocumentEvent internal class
  37.  */
  38. struct dom_document_event_internal {
  39.         dom_events_default_action_fetcher actions;
  40.                         /**< The default action fetecher */
  41.         void *actions_ctx; /**< The default action fetcher context */
  42.         struct lwc_string_s *event_types[DOM_EVENT_COUNT];
  43.                         /**< Events type names */
  44. };
  45.  
  46. typedef struct dom_document_event_internal dom_document_event_internal;
  47.  
  48. /**
  49.  * Constructor and destructor: Since this object is not intended to be
  50.  * allocated alone, it should be embedded into the Document object, there
  51.  * is no constructor and destructor for it.
  52.  */
  53.  
  54. /* Initialise this DocumentEvent */
  55. dom_exception _dom_document_event_internal_initialise(struct dom_document *doc,
  56.                 dom_document_event_internal *dei,
  57.                 dom_events_default_action_fetcher actions,
  58.                 void *actions_ctx);
  59.  
  60. /* Finalise this DocumentEvent */
  61. void _dom_document_event_internal_finalise(struct dom_document *doc,
  62.                 dom_document_event_internal *dei);
  63.  
  64. #endif
  65.