Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #ifndef mozilla_EventForwards_h__ |
michael@0 | 7 | #define mozilla_EventForwards_h__ |
michael@0 | 8 | |
michael@0 | 9 | #include <stdint.h> |
michael@0 | 10 | |
michael@0 | 11 | #include "mozilla/TypedEnum.h" |
michael@0 | 12 | |
michael@0 | 13 | /** |
michael@0 | 14 | * XXX Following enums should be in BasicEvents.h. However, currently, it's |
michael@0 | 15 | * impossible to use foward delearation for enum. |
michael@0 | 16 | */ |
michael@0 | 17 | |
michael@0 | 18 | /** |
michael@0 | 19 | * Return status for event processors. |
michael@0 | 20 | */ |
michael@0 | 21 | enum nsEventStatus |
michael@0 | 22 | { |
michael@0 | 23 | // The event is ignored, do default processing |
michael@0 | 24 | nsEventStatus_eIgnore, |
michael@0 | 25 | // The event is consumed, don't do default processing |
michael@0 | 26 | nsEventStatus_eConsumeNoDefault, |
michael@0 | 27 | // The event is consumed, but do default processing |
michael@0 | 28 | nsEventStatus_eConsumeDoDefault |
michael@0 | 29 | }; |
michael@0 | 30 | |
michael@0 | 31 | namespace mozilla { |
michael@0 | 32 | |
michael@0 | 33 | typedef uint16_t Modifiers; |
michael@0 | 34 | |
michael@0 | 35 | #define NS_DEFINE_KEYNAME(aCPPName, aDOMKeyName) \ |
michael@0 | 36 | KEY_NAME_INDEX_##aCPPName, |
michael@0 | 37 | |
michael@0 | 38 | enum KeyNameIndex |
michael@0 | 39 | { |
michael@0 | 40 | #include "mozilla/KeyNameList.h" |
michael@0 | 41 | // If a DOM keyboard event is synthesized by script, this is used. Then, |
michael@0 | 42 | // specified key name should be stored and use it as .key value. |
michael@0 | 43 | KEY_NAME_INDEX_USE_STRING |
michael@0 | 44 | }; |
michael@0 | 45 | |
michael@0 | 46 | #undef NS_DEFINE_KEYNAME |
michael@0 | 47 | |
michael@0 | 48 | #define NS_DEFINE_COMMAND(aName, aCommandStr) , Command##aName |
michael@0 | 49 | |
michael@0 | 50 | typedef int8_t CommandInt; |
michael@0 | 51 | enum Command MOZ_ENUM_TYPE(CommandInt) |
michael@0 | 52 | { |
michael@0 | 53 | CommandDoNothing |
michael@0 | 54 | |
michael@0 | 55 | #include "mozilla/CommandList.h" |
michael@0 | 56 | }; |
michael@0 | 57 | #undef NS_DEFINE_COMMAND |
michael@0 | 58 | |
michael@0 | 59 | } // namespace mozilla |
michael@0 | 60 | |
michael@0 | 61 | /** |
michael@0 | 62 | * All header files should include this header instead of *Events.h. |
michael@0 | 63 | */ |
michael@0 | 64 | |
michael@0 | 65 | namespace mozilla { |
michael@0 | 66 | |
michael@0 | 67 | #define NS_EVENT_CLASS(aPrefix, aName) class aPrefix##aName; |
michael@0 | 68 | #define NS_ROOT_EVENT_CLASS(aPrefix, aName) NS_EVENT_CLASS(aPrefix, aName) |
michael@0 | 69 | |
michael@0 | 70 | #include "mozilla/EventClassList.h" |
michael@0 | 71 | |
michael@0 | 72 | #undef NS_EVENT_CLASS |
michael@0 | 73 | #undef NS_ROOT_EVENT_CLASS |
michael@0 | 74 | |
michael@0 | 75 | // BasicEvents.h |
michael@0 | 76 | struct EventFlags; |
michael@0 | 77 | |
michael@0 | 78 | // TextEvents.h |
michael@0 | 79 | struct AlternativeCharCode; |
michael@0 | 80 | |
michael@0 | 81 | // TextRange.h |
michael@0 | 82 | struct TextRangeStyle; |
michael@0 | 83 | struct TextRange; |
michael@0 | 84 | |
michael@0 | 85 | class TextRangeArray; |
michael@0 | 86 | |
michael@0 | 87 | } // namespace mozilla |
michael@0 | 88 | |
michael@0 | 89 | #endif // mozilla_EventForwards_h__ |