1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef mozilla_EventForwards_h__
7 #define mozilla_EventForwards_h__
12 * XXX Following enums should be in BasicEvents.h. However, currently, it's
13 * impossible to use foward delearation for enum.
17 * Return status for event processors.
21 // The event is ignored, do default processing
22 nsEventStatus_eIgnore
,
23 // The event is consumed, don't do default processing
24 nsEventStatus_eConsumeNoDefault
,
25 // The event is consumed, but do default processing
26 nsEventStatus_eConsumeDoDefault
31 typedef uint8_t EventClassIDType
;
33 enum EventClassID
: EventClassIDType
35 // The event class name will be:
36 // eBasicEventClass for WidgetEvent
37 // eFooEventClass for WidgetFooEvent or InternalFooEvent
38 #define NS_ROOT_EVENT_CLASS(aPrefix, aName) eBasic##aName##Class
39 #define NS_EVENT_CLASS(aPrefix, aName) , e##aName##Class
41 #include "mozilla/EventClassList.h"
44 #undef NS_ROOT_EVENT_CLASS
47 typedef uint16_t Modifiers
;
49 #define NS_DEFINE_KEYNAME(aCPPName, aDOMKeyName) \
50 KEY_NAME_INDEX_##aCPPName,
54 #include "mozilla/KeyNameList.h"
55 // If a DOM keyboard event is synthesized by script, this is used. Then,
56 // specified key name should be stored and use it as .key value.
57 KEY_NAME_INDEX_USE_STRING
60 #undef NS_DEFINE_KEYNAME
62 #define NS_DEFINE_PHYSICAL_KEY_CODE_NAME(aCPPName, aDOMCodeName) \
63 CODE_NAME_INDEX_##aCPPName,
67 #include "mozilla/PhysicalKeyCodeNameList.h"
68 // If a DOM keyboard event is synthesized by script, this is used. Then,
69 // specified code name should be stored and use it as .code value.
70 CODE_NAME_INDEX_USE_STRING
73 #undef NS_DEFINE_PHYSICAL_KEY_CODE_NAME
75 #define NS_DEFINE_COMMAND(aName, aCommandStr) , Command##aName
77 typedef int8_t CommandInt
;
78 enum Command
: CommandInt
82 #include "mozilla/CommandList.h"
84 #undef NS_DEFINE_COMMAND
86 } // namespace mozilla
89 * All header files should include this header instead of *Events.h.
94 #define NS_EVENT_CLASS(aPrefix, aName) class aPrefix##aName;
95 #define NS_ROOT_EVENT_CLASS(aPrefix, aName) NS_EVENT_CLASS(aPrefix, aName)
97 #include "mozilla/EventClassList.h"
100 #undef NS_ROOT_EVENT_CLASS
103 struct BaseEventFlags
;
107 struct AlternativeCharCode
;
110 struct TextRangeStyle
;
113 class TextRangeArray
;
118 } // namespace mozilla
120 #endif // mozilla_EventForwards_h__