michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef mozilla_EventForwards_h__ michael@0: #define mozilla_EventForwards_h__ michael@0: michael@0: #include michael@0: michael@0: #include "mozilla/TypedEnum.h" michael@0: michael@0: /** michael@0: * XXX Following enums should be in BasicEvents.h. However, currently, it's michael@0: * impossible to use foward delearation for enum. michael@0: */ michael@0: michael@0: /** michael@0: * Return status for event processors. michael@0: */ michael@0: enum nsEventStatus michael@0: { michael@0: // The event is ignored, do default processing michael@0: nsEventStatus_eIgnore, michael@0: // The event is consumed, don't do default processing michael@0: nsEventStatus_eConsumeNoDefault, michael@0: // The event is consumed, but do default processing michael@0: nsEventStatus_eConsumeDoDefault michael@0: }; michael@0: michael@0: namespace mozilla { michael@0: michael@0: typedef uint16_t Modifiers; michael@0: michael@0: #define NS_DEFINE_KEYNAME(aCPPName, aDOMKeyName) \ michael@0: KEY_NAME_INDEX_##aCPPName, michael@0: michael@0: enum KeyNameIndex michael@0: { michael@0: #include "mozilla/KeyNameList.h" michael@0: // If a DOM keyboard event is synthesized by script, this is used. Then, michael@0: // specified key name should be stored and use it as .key value. michael@0: KEY_NAME_INDEX_USE_STRING michael@0: }; michael@0: michael@0: #undef NS_DEFINE_KEYNAME michael@0: michael@0: #define NS_DEFINE_COMMAND(aName, aCommandStr) , Command##aName michael@0: michael@0: typedef int8_t CommandInt; michael@0: enum Command MOZ_ENUM_TYPE(CommandInt) michael@0: { michael@0: CommandDoNothing michael@0: michael@0: #include "mozilla/CommandList.h" michael@0: }; michael@0: #undef NS_DEFINE_COMMAND michael@0: michael@0: } // namespace mozilla michael@0: michael@0: /** michael@0: * All header files should include this header instead of *Events.h. michael@0: */ michael@0: michael@0: namespace mozilla { michael@0: michael@0: #define NS_EVENT_CLASS(aPrefix, aName) class aPrefix##aName; michael@0: #define NS_ROOT_EVENT_CLASS(aPrefix, aName) NS_EVENT_CLASS(aPrefix, aName) michael@0: michael@0: #include "mozilla/EventClassList.h" michael@0: michael@0: #undef NS_EVENT_CLASS michael@0: #undef NS_ROOT_EVENT_CLASS michael@0: michael@0: // BasicEvents.h michael@0: struct EventFlags; michael@0: michael@0: // TextEvents.h michael@0: struct AlternativeCharCode; michael@0: michael@0: // TextRange.h michael@0: struct TextRangeStyle; michael@0: struct TextRange; michael@0: michael@0: class TextRangeArray; michael@0: michael@0: } // namespace mozilla michael@0: michael@0: #endif // mozilla_EventForwards_h__