summaryrefslogtreecommitdiff
path: root/src/events/document_event.h
blob: 1e040458d5c08d8c4512b86f430826bb10ef1915 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
 * This file is part of libdom.
 * Licensed under the MIT License,
 *                http://www.opensource.org/licenses/mit-license.php
 * Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
 */

#ifndef dom_internal_events_document_event_h_
#define dom_internal_events_document_event_h_

#include <dom/events/document_event.h>

struct dom_event_listener;
struct lwc_string_s;
struct dom_document;

/**
 * Type of Events
 */
typedef enum {
	DOM_EVENT = 0,
	DOM_CUSTOM_EVENT,
	DOM_UI_EVENT,
	DOM_TEXT_EVENT,
	DOM_KEYBOARD_EVENT,
	DOM_MOUSE_EVENT,
	DOM_MOUSE_MULTI_WHEEL_EVENT,
	DOM_MOUSE_WHEEL_EVENT,
	DOM_MUTATION_EVENT,
	DOM_MUTATION_NAME_EVENT,

	DOM_EVENT_COUNT
} dom_event_type;

/**
 * The DocumentEvent internal class
 */
struct dom_document_event_internal {
	dom_events_default_action_fetcher actions;
			/**< The default action fetecher */
	void *actions_ctx; /**< The default action fetcher context */
	struct lwc_string_s *event_types[DOM_EVENT_COUNT];
			/**< Events type names */
};

typedef struct dom_document_event_internal dom_document_event_internal;

/**
 * Constructor and destructor: Since this object is not intended to be
 * allocated alone, it should be embedded into the Document object, there 
 * is no constructor and destructor for it.
 */

/* Initialise this DocumentEvent */
dom_exception _dom_document_event_internal_initialise(struct dom_document *doc,
		dom_document_event_internal *dei, 
		dom_events_default_action_fetcher actions,
		void *actions_ctx);

/* Finalise this DocumentEvent */
void _dom_document_event_internal_finalise(struct dom_document *doc,
		dom_document_event_internal *dei);

#endif