Home | History | Annotate | Download | only in dom
      1 /*
      2  * Copyright (C) 2005, 2007 Apple Inc. All rights reserved.
      3  * Copyright (C) 2006 Jon Shier (jshier (at) 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 "AtomicString.h"
     26 #include "ThreadGlobalData.h"
     27 
     28 namespace 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(beforeunload) \
     38     macro(blur) \
     39     macro(cached) \
     40     macro(change) \
     41     macro(checking) \
     42     macro(click) \
     43     macro(close) \
     44     macro(compositionend) \
     45     macro(compositionstart) \
     46     macro(compositionupdate) \
     47     macro(connect) \
     48     macro(contextmenu) \
     49     macro(copy) \
     50     macro(cut) \
     51     macro(dblclick) \
     52     macro(display) \
     53     macro(downloading) \
     54     macro(drag) \
     55     macro(dragend) \
     56     macro(dragenter) \
     57     macro(dragleave) \
     58     macro(dragover) \
     59     macro(dragstart) \
     60     macro(drop) \
     61     macro(error) \
     62     macro(focus) \
     63     macro(hashchange) \
     64     macro(input) \
     65     macro(invalid) \
     66     macro(keydown) \
     67     macro(keypress) \
     68     macro(keyup) \
     69     macro(load) \
     70     macro(loadstart) \
     71     macro(message) \
     72     macro(mousedown) \
     73     macro(mousemove) \
     74     macro(mouseout) \
     75     macro(mouseover) \
     76     macro(mouseup) \
     77     macro(mousewheel) \
     78     macro(noupdate) \
     79     macro(obsolete) \
     80     macro(offline) \
     81     macro(online) \
     82     macro(open) \
     83     macro(overflowchanged) \
     84     macro(pagehide) \
     85     macro(pageshow) \
     86     macro(paste) \
     87     macro(popstate) \
     88     macro(readystatechange) \
     89     macro(reset) \
     90     macro(resize) \
     91     macro(scroll) \
     92     macro(search) \
     93     macro(select) \
     94     macro(selectstart) \
     95     macro(storage) \
     96     macro(submit) \
     97     macro(textInput) \
     98     macro(unload) \
     99     macro(updateready) \
    100     macro(zoom) \
    101     \
    102     macro(DOMActivate) \
    103     macro(DOMAttrModified) \
    104     macro(DOMCharacterDataModified) \
    105     macro(DOMFocusIn) \
    106     macro(DOMFocusOut) \
    107     macro(DOMNodeInserted) \
    108     macro(DOMNodeInsertedIntoDocument) \
    109     macro(DOMNodeRemoved) \
    110     macro(DOMNodeRemovedFromDocument) \
    111     macro(DOMSubtreeModified) \
    112     macro(DOMContentLoaded) \
    113     \
    114     macro(webkitBeforeTextInserted) \
    115     macro(webkitEditableContentChanged) \
    116     \
    117     macro(canplay) \
    118     macro(canplaythrough) \
    119     macro(durationchange) \
    120     macro(emptied) \
    121     macro(ended) \
    122     macro(loadeddata) \
    123     macro(loadedmetadata) \
    124     macro(pause) \
    125     macro(play) \
    126     macro(playing) \
    127     macro(ratechange) \
    128     macro(seeked) \
    129     macro(seeking) \
    130     macro(timeupdate) \
    131     macro(volumechange) \
    132     macro(waiting) \
    133     \
    134     macro(webkitbeginfullscreen) \
    135     macro(webkitendfullscreen) \
    136     \
    137     macro(progress) \
    138     macro(stalled) \
    139     macro(suspend) \
    140     \
    141     macro(webkitAnimationEnd) \
    142     macro(webkitAnimationStart) \
    143     macro(webkitAnimationIteration) \
    144     \
    145     macro(webkitTransitionEnd) \
    146     \
    147     macro(orientationchange) \
    148     \
    149     macro(touchstart) \
    150     macro(touchmove) \
    151     macro(touchend) \
    152     macro(touchcancel) \
    153 /* #if PLATFORM(ANDROID) */ \
    154     macro(touchlongpress) \
    155     macro(touchdoubletap) \
    156 /* #endif */ \
    157     \
    158     macro(success) \
    159     \
    160 // end of DOM_EVENT_NAMES_FOR_EACH
    161 
    162     class EventNames : public Noncopyable {
    163         int dummy; // Needed to make initialization macro work.
    164         // Private to prevent accidental call to EventNames() instead of eventNames()
    165         EventNames();
    166         friend class ThreadGlobalData;
    167 
    168     public:
    169         #define DOM_EVENT_NAMES_DECLARE(name) AtomicString name##Event;
    170         DOM_EVENT_NAMES_FOR_EACH(DOM_EVENT_NAMES_DECLARE)
    171         #undef DOM_EVENT_NAMES_DECLARE
    172     };
    173 
    174     inline EventNames& eventNames()
    175     {
    176         return threadGlobalData().eventNames();
    177     }
    178 
    179 }
    180 
    181 #endif
    182