widget/EventForwards.h

branch
TOR_BUG_9701
changeset 8
97036ab72558
equal deleted inserted replaced
-1:000000000000 0:b790d1e89dd0
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/. */
5
6 #ifndef mozilla_EventForwards_h__
7 #define mozilla_EventForwards_h__
8
9 #include <stdint.h>
10
11 #include "mozilla/TypedEnum.h"
12
13 /**
14 * XXX Following enums should be in BasicEvents.h. However, currently, it's
15 * impossible to use foward delearation for enum.
16 */
17
18 /**
19 * Return status for event processors.
20 */
21 enum nsEventStatus
22 {
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
29 };
30
31 namespace mozilla {
32
33 typedef uint16_t Modifiers;
34
35 #define NS_DEFINE_KEYNAME(aCPPName, aDOMKeyName) \
36 KEY_NAME_INDEX_##aCPPName,
37
38 enum KeyNameIndex
39 {
40 #include "mozilla/KeyNameList.h"
41 // If a DOM keyboard event is synthesized by script, this is used. Then,
42 // specified key name should be stored and use it as .key value.
43 KEY_NAME_INDEX_USE_STRING
44 };
45
46 #undef NS_DEFINE_KEYNAME
47
48 #define NS_DEFINE_COMMAND(aName, aCommandStr) , Command##aName
49
50 typedef int8_t CommandInt;
51 enum Command MOZ_ENUM_TYPE(CommandInt)
52 {
53 CommandDoNothing
54
55 #include "mozilla/CommandList.h"
56 };
57 #undef NS_DEFINE_COMMAND
58
59 } // namespace mozilla
60
61 /**
62 * All header files should include this header instead of *Events.h.
63 */
64
65 namespace mozilla {
66
67 #define NS_EVENT_CLASS(aPrefix, aName) class aPrefix##aName;
68 #define NS_ROOT_EVENT_CLASS(aPrefix, aName) NS_EVENT_CLASS(aPrefix, aName)
69
70 #include "mozilla/EventClassList.h"
71
72 #undef NS_EVENT_CLASS
73 #undef NS_ROOT_EVENT_CLASS
74
75 // BasicEvents.h
76 struct EventFlags;
77
78 // TextEvents.h
79 struct AlternativeCharCode;
80
81 // TextRange.h
82 struct TextRangeStyle;
83 struct TextRange;
84
85 class TextRangeArray;
86
87 } // namespace mozilla
88
89 #endif // mozilla_EventForwards_h__

mercurial