1/*
2 * Copyright (C) 2005, 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2006 Jon Shier (jshier@iastate.edu)
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 * Library General Public License for more details.
14 *
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB.  If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19 *
20 */
21
22#ifndef EventNames_h
23#define EventNames_h
24
25#include "ThreadGlobalData.h"
26#include <wtf/text/AtomicString.h>
27
28namespace WebCore {
29
30#define DOM_EVENT_NAMES_FOR_EACH(macro) \
31    \
32    macro(abort) \
33    macro(beforecopy) \
34    macro(beforecut) \
35    macro(beforeload) \
36    macro(beforepaste) \
37    macro(beforeprocess) \
38    macro(beforeunload) \
39    macro(blocked) \
40    macro(blur) \
41    macro(cached) \
42    macro(change) \
43    macro(checking) \
44    macro(click) \
45    macro(close) \
46    macro(complete) \
47    macro(compositionend) \
48    macro(compositionstart) \
49    macro(compositionupdate) \
50    macro(connect) \
51    macro(contextmenu) \
52    macro(copy) \
53    macro(cut) \
54    macro(dblclick) \
55    macro(devicemotion) \
56    macro(deviceorientation) \
57    macro(display) \
58    macro(downloading) \
59    macro(drag) \
60    macro(dragend) \
61    macro(dragenter) \
62    macro(dragleave) \
63    macro(dragover) \
64    macro(dragstart) \
65    macro(drop) \
66    macro(error) \
67    macro(focus) \
68    macro(focusin) \
69    macro(focusout) \
70    macro(hashchange) \
71    macro(input) \
72    macro(invalid) \
73    macro(keydown) \
74    macro(keypress) \
75    macro(keyup) \
76    macro(load) \
77    macro(loadstart) \
78    macro(message) \
79    macro(mousedown) \
80    macro(mousemove) \
81    macro(mouseout) \
82    macro(mouseover) \
83    macro(mouseup) \
84    macro(mousewheel) \
85    macro(noupdate) \
86    macro(obsolete) \
87    macro(offline) \
88    macro(online) \
89    macro(open) \
90    macro(overflowchanged) \
91    macro(pagehide) \
92    macro(pageshow) \
93    macro(paste) \
94    macro(popstate) \
95    macro(readystatechange) \
96    macro(reset) \
97    macro(resize) \
98    macro(scroll) \
99    macro(search) \
100    macro(select) \
101    macro(selectstart) \
102    macro(selectionchange) \
103    macro(storage) \
104    macro(submit) \
105    macro(textInput) \
106    macro(unload) \
107    macro(updateready) \
108    macro(versionchange) \
109    macro(write) \
110    macro(writeend) \
111    macro(writestart) \
112    macro(zoom) \
113    \
114    macro(DOMActivate) \
115    macro(DOMFocusIn) \
116    macro(DOMFocusOut) \
117    macro(DOMAttrModified) \
118    macro(DOMCharacterDataModified) \
119    macro(DOMNodeInserted) \
120    macro(DOMNodeInsertedIntoDocument) \
121    macro(DOMNodeRemoved) \
122    macro(DOMNodeRemovedFromDocument) \
123    macro(DOMSubtreeModified) \
124    macro(DOMContentLoaded) \
125    \
126    macro(webkitBeforeTextInserted) \
127    macro(webkitEditableContentChanged) \
128    \
129    macro(canplay) \
130    macro(canplaythrough) \
131    macro(durationchange) \
132    macro(emptied) \
133    macro(ended) \
134    macro(loadeddata) \
135    macro(loadedmetadata) \
136    macro(pause) \
137    macro(play) \
138    macro(playing) \
139    macro(ratechange) \
140    macro(seeked) \
141    macro(seeking) \
142    macro(timeupdate) \
143    macro(volumechange) \
144    macro(waiting) \
145    \
146    macro(webkitbeginfullscreen) \
147    macro(webkitendfullscreen) \
148    \
149    macro(progress) \
150    macro(stalled) \
151    macro(suspend) \
152    \
153    macro(webkitAnimationEnd) \
154    macro(webkitAnimationStart) \
155    macro(webkitAnimationIteration) \
156    \
157    macro(webkitTransitionEnd) \
158    \
159    macro(orientationchange) \
160    \
161    macro(timeout) \
162    \
163    macro(touchstart) \
164    macro(touchmove) \
165    macro(touchend) \
166    macro(touchcancel) \
167/* #if PLATFORM(ANDROID) */ \
168    macro(touchlongpress) \
169    macro(touchdoubletap) \
170/* #endif */ \
171    \
172    macro(success) \
173    \
174    macro(loadend) \
175    \
176    macro(webkitfullscreenchange) \
177    \
178    macro(webkitspeechchange) \
179    \
180    macro(webglcontextlost) \
181    macro(webglcontextrestored) \
182    macro(webglcontextcreationerror) \
183    \
184    macro(audioprocess) \
185    \
186// end of DOM_EVENT_NAMES_FOR_EACH
187
188    class EventNames {
189        WTF_MAKE_NONCOPYABLE(EventNames); WTF_MAKE_FAST_ALLOCATED;
190        int dummy; // Needed to make initialization macro work.
191        // Private to prevent accidental call to EventNames() instead of eventNames()
192        EventNames();
193        friend class ThreadGlobalData;
194
195    public:
196        #define DOM_EVENT_NAMES_DECLARE(name) AtomicString name##Event;
197        DOM_EVENT_NAMES_FOR_EACH(DOM_EVENT_NAMES_DECLARE)
198        #undef DOM_EVENT_NAMES_DECLARE
199    };
200
201    inline EventNames& eventNames()
202    {
203        return threadGlobalData().eventNames();
204    }
205
206}
207
208#endif
209