1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/widget/EventForwards.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,89 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#ifndef mozilla_EventForwards_h__ 1.10 +#define mozilla_EventForwards_h__ 1.11 + 1.12 +#include <stdint.h> 1.13 + 1.14 +#include "mozilla/TypedEnum.h" 1.15 + 1.16 +/** 1.17 + * XXX Following enums should be in BasicEvents.h. However, currently, it's 1.18 + * impossible to use foward delearation for enum. 1.19 + */ 1.20 + 1.21 +/** 1.22 + * Return status for event processors. 1.23 + */ 1.24 +enum nsEventStatus 1.25 +{ 1.26 + // The event is ignored, do default processing 1.27 + nsEventStatus_eIgnore, 1.28 + // The event is consumed, don't do default processing 1.29 + nsEventStatus_eConsumeNoDefault, 1.30 + // The event is consumed, but do default processing 1.31 + nsEventStatus_eConsumeDoDefault 1.32 +}; 1.33 + 1.34 +namespace mozilla { 1.35 + 1.36 +typedef uint16_t Modifiers; 1.37 + 1.38 +#define NS_DEFINE_KEYNAME(aCPPName, aDOMKeyName) \ 1.39 + KEY_NAME_INDEX_##aCPPName, 1.40 + 1.41 +enum KeyNameIndex 1.42 +{ 1.43 +#include "mozilla/KeyNameList.h" 1.44 + // If a DOM keyboard event is synthesized by script, this is used. Then, 1.45 + // specified key name should be stored and use it as .key value. 1.46 + KEY_NAME_INDEX_USE_STRING 1.47 +}; 1.48 + 1.49 +#undef NS_DEFINE_KEYNAME 1.50 + 1.51 +#define NS_DEFINE_COMMAND(aName, aCommandStr) , Command##aName 1.52 + 1.53 +typedef int8_t CommandInt; 1.54 +enum Command MOZ_ENUM_TYPE(CommandInt) 1.55 +{ 1.56 + CommandDoNothing 1.57 + 1.58 +#include "mozilla/CommandList.h" 1.59 +}; 1.60 +#undef NS_DEFINE_COMMAND 1.61 + 1.62 +} // namespace mozilla 1.63 + 1.64 +/** 1.65 + * All header files should include this header instead of *Events.h. 1.66 + */ 1.67 + 1.68 +namespace mozilla { 1.69 + 1.70 +#define NS_EVENT_CLASS(aPrefix, aName) class aPrefix##aName; 1.71 +#define NS_ROOT_EVENT_CLASS(aPrefix, aName) NS_EVENT_CLASS(aPrefix, aName) 1.72 + 1.73 +#include "mozilla/EventClassList.h" 1.74 + 1.75 +#undef NS_EVENT_CLASS 1.76 +#undef NS_ROOT_EVENT_CLASS 1.77 + 1.78 +// BasicEvents.h 1.79 +struct EventFlags; 1.80 + 1.81 +// TextEvents.h 1.82 +struct AlternativeCharCode; 1.83 + 1.84 +// TextRange.h 1.85 +struct TextRangeStyle; 1.86 +struct TextRange; 1.87 + 1.88 +class TextRangeArray; 1.89 + 1.90 +} // namespace mozilla 1.91 + 1.92 +#endif // mozilla_EventForwards_h__