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__
11 #include "mozilla/TypedEnum.h"
14 * XXX Following enums should be in BasicEvents.h. However, currently, it's
15 * impossible to use foward delearation for enum.
19 * Return status for event processors.
23 // The event is ignored, do default processing
24 nsEventStatus_eIgnore
,
25 // The event is consumed, don't do default processing
26 nsEventStatus_eConsumeNoDefault
,
27 // The event is consumed, but do default processing
28 nsEventStatus_eConsumeDoDefault
33 typedef uint8_t EventClassIDType
;
35 enum EventClassID
MOZ_ENUM_TYPE(EventClassIDType
)
37 // The event class name will be:
38 // eBasicEventClass for WidgetEvent
39 // eFooEventClass for WidgetFooEvent or InternalFooEvent
40 #define NS_ROOT_EVENT_CLASS(aPrefix, aName) eBasic##aName##Class
41 #define NS_EVENT_CLASS(aPrefix, aName) , e##aName##Class
43 #include "mozilla/EventClassList.h"
46 #undef NS_ROOT_EVENT_CLASS
49 typedef uint16_t Modifiers
;
51 #define NS_DEFINE_KEYNAME(aCPPName, aDOMKeyName) \
52 KEY_NAME_INDEX_##aCPPName,
56 #include "mozilla/KeyNameList.h"
57 // If a DOM keyboard event is synthesized by script, this is used. Then,
58 // specified key name should be stored and use it as .key value.
59 KEY_NAME_INDEX_USE_STRING
62 #undef NS_DEFINE_KEYNAME
64 #define NS_DEFINE_PHYSICAL_KEY_CODE_NAME(aCPPName, aDOMCodeName) \
65 CODE_NAME_INDEX_##aCPPName,
69 #include "mozilla/PhysicalKeyCodeNameList.h"
70 // If a DOM keyboard event is synthesized by script, this is used. Then,
71 // specified code name should be stored and use it as .code value.
72 CODE_NAME_INDEX_USE_STRING
75 #undef NS_DEFINE_PHYSICAL_KEY_CODE_NAME
77 #define NS_DEFINE_COMMAND(aName, aCommandStr) , Command##aName
79 typedef int8_t CommandInt
;
80 enum Command
MOZ_ENUM_TYPE(CommandInt
)
84 #include "mozilla/CommandList.h"
86 #undef NS_DEFINE_COMMAND
88 } // namespace mozilla
91 * All header files should include this header instead of *Events.h.
96 #define NS_EVENT_CLASS(aPrefix, aName) class aPrefix##aName;
97 #define NS_ROOT_EVENT_CLASS(aPrefix, aName) NS_EVENT_CLASS(aPrefix, aName)
99 #include "mozilla/EventClassList.h"
101 #undef NS_EVENT_CLASS
102 #undef NS_ROOT_EVENT_CLASS
108 struct AlternativeCharCode
;
111 struct TextRangeStyle
;
114 class TextRangeArray
;
116 } // namespace mozilla
118 #endif // mozilla_EventForwards_h__