Fix typo in 9b54bd30006c008b4a951331b273613d5bac3abf
[pm.git] / widget / EventForwards.h
blob25567b55b4f0794f329828cf9dc7eee8e249f091
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 /**
12 * XXX Following enums should be in BasicEvents.h. However, currently, it's
13 * impossible to use foward delearation for enum.
16 /**
17 * Return status for event processors.
19 enum nsEventStatus
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
29 namespace mozilla {
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"
43 #undef NS_EVENT_CLASS
44 #undef NS_ROOT_EVENT_CLASS
47 typedef uint16_t Modifiers;
49 #define NS_DEFINE_KEYNAME(aCPPName, aDOMKeyName) \
50 KEY_NAME_INDEX_##aCPPName,
52 enum KeyNameIndex
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,
65 enum CodeNameIndex
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
80 CommandDoNothing
82 #include "mozilla/CommandList.h"
84 #undef NS_DEFINE_COMMAND
86 } // namespace mozilla
88 /**
89 * All header files should include this header instead of *Events.h.
92 namespace mozilla {
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"
99 #undef NS_EVENT_CLASS
100 #undef NS_ROOT_EVENT_CLASS
102 // BasicEvents.h
103 struct BaseEventFlags;
104 struct EventFlags;
106 // TextEvents.h
107 struct AlternativeCharCode;
109 // TextRange.h
110 struct TextRangeStyle;
111 struct TextRange;
113 class TextRangeArray;
115 // FontRange.h
116 struct FontRange;
118 } // namespace mozilla
120 #endif // mozilla_EventForwards_h__