widget/EventForwards.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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 #include "mozilla/TypedEnum.h"
    13 /**
    14  * XXX Following enums should be in BasicEvents.h.  However, currently, it's
    15  *     impossible to use foward delearation for enum.
    16  */
    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 };
    31 namespace mozilla {
    33 typedef uint16_t Modifiers;
    35 #define NS_DEFINE_KEYNAME(aCPPName, aDOMKeyName) \
    36   KEY_NAME_INDEX_##aCPPName,
    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 };
    46 #undef NS_DEFINE_KEYNAME
    48 #define NS_DEFINE_COMMAND(aName, aCommandStr) , Command##aName
    50 typedef int8_t CommandInt;
    51 enum Command MOZ_ENUM_TYPE(CommandInt)
    52 {
    53   CommandDoNothing
    55 #include "mozilla/CommandList.h"
    56 };
    57 #undef NS_DEFINE_COMMAND
    59 } // namespace mozilla
    61 /**
    62  * All header files should include this header instead of *Events.h.
    63  */
    65 namespace mozilla {
    67 #define NS_EVENT_CLASS(aPrefix, aName) class aPrefix##aName;
    68 #define NS_ROOT_EVENT_CLASS(aPrefix, aName) NS_EVENT_CLASS(aPrefix, aName)
    70 #include "mozilla/EventClassList.h"
    72 #undef NS_EVENT_CLASS
    73 #undef NS_ROOT_EVENT_CLASS
    75 // BasicEvents.h
    76 struct EventFlags;
    78 // TextEvents.h
    79 struct AlternativeCharCode;
    81 // TextRange.h
    82 struct TextRangeStyle;
    83 struct TextRange;
    85 class TextRangeArray;
    87 } // namespace mozilla
    89 #endif // mozilla_EventForwards_h__

mercurial