Bug 1477919 [wpt PR 12154] - url: DecodeURLEscapeSequences() should not apply UTF...
[gecko.git] / widget / EventForwards.h
blob114c194b22a9b7e654d49efee7b757314c3cd76f
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__
9 #include <stdint.h>
11 #include "nsStringFwd.h"
12 #include "nsTArray.h"
14 /**
15 * XXX Following enums should be in BasicEvents.h. However, currently, it's
16 * impossible to use foward delearation for enum.
19 /**
20 * Return status for event processors.
22 enum nsEventStatus
24 // The event is ignored, do default processing
25 nsEventStatus_eIgnore,
26 // The event is consumed, don't do default processing
27 nsEventStatus_eConsumeNoDefault,
28 // The event is consumed, but do default processing
29 nsEventStatus_eConsumeDoDefault,
30 // Value is not for use, only for serialization
31 nsEventStatus_eSentinel
34 namespace mozilla {
36 enum class CanBubble
38 eYes,
39 eNo
42 enum class Cancelable
44 eYes,
45 eNo
48 enum class ChromeOnlyDispatch
50 eYes,
51 eNo
54 enum class Trusted
56 eYes,
57 eNo
60 enum class Composed
62 eYes,
63 eNo,
64 eDefault
67 /**
68 * Event messages
71 typedef uint16_t EventMessageType;
73 enum EventMessage : EventMessageType
76 #define NS_EVENT_MESSAGE(aMessage) aMessage,
77 #define NS_EVENT_MESSAGE_FIRST_LAST(aMessage, aFirst, aLast) \
78 aMessage##First = aFirst, aMessage##Last = aLast,
80 #include "mozilla/EventMessageList.h"
82 #undef NS_EVENT_MESSAGE
83 #undef NS_EVENT_MESSAGE_FIRST_LAST
85 // For preventing bustage due to "," after the last item.
86 eEventMessage_MaxValue
89 const char* ToChar(EventMessage aEventMessage);
91 /**
92 * Event class IDs
95 typedef uint8_t EventClassIDType;
97 enum EventClassID : EventClassIDType
99 // The event class name will be:
100 // eBasicEventClass for WidgetEvent
101 // eFooEventClass for WidgetFooEvent or InternalFooEvent
102 #define NS_ROOT_EVENT_CLASS(aPrefix, aName) eBasic##aName##Class
103 #define NS_EVENT_CLASS(aPrefix, aName) , e##aName##Class
105 #include "mozilla/EventClassList.h"
107 #undef NS_EVENT_CLASS
108 #undef NS_ROOT_EVENT_CLASS
111 const char* ToChar(EventClassID aEventClassID);
113 typedef uint16_t Modifiers;
115 #define NS_DEFINE_KEYNAME(aCPPName, aDOMKeyName) \
116 KEY_NAME_INDEX_##aCPPName,
118 typedef uint16_t KeyNameIndexType;
119 enum KeyNameIndex : KeyNameIndexType
121 #include "mozilla/KeyNameList.h"
122 // If a DOM keyboard event is synthesized by script, this is used. Then,
123 // specified key name should be stored and use it as .key value.
124 KEY_NAME_INDEX_USE_STRING
127 #undef NS_DEFINE_KEYNAME
129 const nsCString ToString(KeyNameIndex aKeyNameIndex);
131 #define NS_DEFINE_PHYSICAL_KEY_CODE_NAME(aCPPName, aDOMCodeName) \
132 CODE_NAME_INDEX_##aCPPName,
134 typedef uint8_t CodeNameIndexType;
135 enum CodeNameIndex : CodeNameIndexType
137 #include "mozilla/PhysicalKeyCodeNameList.h"
138 // If a DOM keyboard event is synthesized by script, this is used. Then,
139 // specified code name should be stored and use it as .code value.
140 CODE_NAME_INDEX_USE_STRING
143 #undef NS_DEFINE_PHYSICAL_KEY_CODE_NAME
145 const nsCString ToString(CodeNameIndex aCodeNameIndex);
147 #define NS_DEFINE_COMMAND(aName, aCommandStr) , Command##aName
148 #define NS_DEFINE_COMMAND_NO_EXEC_COMMAND(aName) , Command##aName
150 typedef int8_t CommandInt;
151 enum Command : CommandInt
153 CommandDoNothing
155 #include "mozilla/CommandList.h"
157 #undef NS_DEFINE_COMMAND
158 #undef NS_DEFINE_COMMAND_NO_EXEC_COMMAND
160 const char* ToChar(Command aCommand);
162 } // namespace mozilla
165 * All header files should include this header instead of *Events.h.
168 namespace mozilla {
170 #define NS_EVENT_CLASS(aPrefix, aName) class aPrefix##aName;
171 #define NS_ROOT_EVENT_CLASS(aPrefix, aName) NS_EVENT_CLASS(aPrefix, aName)
173 #include "mozilla/EventClassList.h"
175 #undef NS_EVENT_CLASS
176 #undef NS_ROOT_EVENT_CLASS
178 // BasicEvents.h
179 struct BaseEventFlags;
180 struct EventFlags;
182 class WidgetEventTime;
184 class NativeEventData;
186 // TextEvents.h
187 enum class AccessKeyType;
189 struct AlternativeCharCode;
190 struct ShortcutKeyCandidate;
192 typedef nsTArray<ShortcutKeyCandidate> ShortcutKeyCandidateArray;
193 typedef AutoTArray<ShortcutKeyCandidate, 10> AutoShortcutKeyCandidateArray;
195 // TextRange.h
196 typedef uint8_t RawTextRangeType;
197 enum class TextRangeType : RawTextRangeType;
199 struct TextRangeStyle;
200 struct TextRange;
202 class EditCommands;
203 class TextRangeArray;
205 // FontRange.h
206 struct FontRange;
208 } // namespace mozilla
210 #endif // mozilla_EventForwards_h__