2001-09-28 20:14:13 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2001-07-15 22:57:29 +00:00
|
|
|
|
2013-09-24 10:04:14 +00:00
|
|
|
#ifndef mozilla_EventForwards_h__
|
|
|
|
#define mozilla_EventForwards_h__
|
2001-07-15 22:57:29 +00:00
|
|
|
|
2013-07-30 14:25:31 +00:00
|
|
|
#include <stdint.h>
|
2012-08-08 21:08:17 +00:00
|
|
|
|
2016-03-18 02:22:37 +00:00
|
|
|
#include "nsTArray.h"
|
|
|
|
|
2001-07-15 22:57:29 +00:00
|
|
|
/**
|
2013-09-24 10:04:14 +00:00
|
|
|
* XXX Following enums should be in BasicEvents.h. However, currently, it's
|
|
|
|
* impossible to use foward delearation for enum.
|
2001-07-15 22:57:29 +00:00
|
|
|
*/
|
|
|
|
|
2009-04-01 21:59:02 +00:00
|
|
|
/**
|
2013-09-24 10:04:14 +00:00
|
|
|
* Return status for event processors.
|
2009-04-01 21:59:02 +00:00
|
|
|
*/
|
2013-09-24 10:04:14 +00:00
|
|
|
enum nsEventStatus
|
|
|
|
{
|
|
|
|
// The event is ignored, do default processing
|
|
|
|
nsEventStatus_eIgnore,
|
|
|
|
// The event is consumed, don't do default processing
|
|
|
|
nsEventStatus_eConsumeNoDefault,
|
|
|
|
// The event is consumed, but do default processing
|
2015-05-14 12:16:00 +00:00
|
|
|
nsEventStatus_eConsumeDoDefault,
|
|
|
|
// Value is not for use, only for serialization
|
|
|
|
nsEventStatus_eSentinel
|
2009-04-01 21:59:02 +00:00
|
|
|
};
|
|
|
|
|
2015-08-26 12:56:59 +00:00
|
|
|
namespace mozilla {
|
|
|
|
|
2015-08-22 01:34:51 +00:00
|
|
|
/**
|
|
|
|
* Event messages
|
|
|
|
*/
|
|
|
|
|
2015-08-26 12:56:59 +00:00
|
|
|
typedef uint16_t EventMessageType;
|
|
|
|
|
|
|
|
enum EventMessage : EventMessageType
|
2015-08-22 01:34:51 +00:00
|
|
|
{
|
|
|
|
|
2015-09-17 03:05:44 +00:00
|
|
|
#define NS_EVENT_MESSAGE(aMessage) aMessage,
|
|
|
|
#define NS_EVENT_MESSAGE_FIRST_LAST(aMessage, aFirst, aLast) \
|
|
|
|
aMessage##First = aFirst, aMessage##Last = aLast,
|
2015-08-22 01:34:51 +00:00
|
|
|
|
|
|
|
#include "mozilla/EventMessageList.h"
|
|
|
|
|
|
|
|
#undef NS_EVENT_MESSAGE
|
2015-09-17 03:05:44 +00:00
|
|
|
#undef NS_EVENT_MESSAGE_FIRST_LAST
|
2015-08-22 01:34:51 +00:00
|
|
|
|
|
|
|
// For preventing bustage due to "," after the last item.
|
|
|
|
eEventMessage_MaxValue
|
|
|
|
};
|
|
|
|
|
2015-09-17 03:05:44 +00:00
|
|
|
const char* ToChar(EventMessage aEventMessage);
|
|
|
|
|
2015-08-22 01:34:51 +00:00
|
|
|
/**
|
|
|
|
* Event class IDs
|
|
|
|
*/
|
|
|
|
|
2014-08-04 05:28:58 +00:00
|
|
|
typedef uint8_t EventClassIDType;
|
|
|
|
|
2015-01-21 13:35:19 +00:00
|
|
|
enum EventClassID : EventClassIDType
|
2014-08-04 05:28:58 +00:00
|
|
|
{
|
|
|
|
// The event class name will be:
|
|
|
|
// eBasicEventClass for WidgetEvent
|
|
|
|
// eFooEventClass for WidgetFooEvent or InternalFooEvent
|
|
|
|
#define NS_ROOT_EVENT_CLASS(aPrefix, aName) eBasic##aName##Class
|
|
|
|
#define NS_EVENT_CLASS(aPrefix, aName) , e##aName##Class
|
|
|
|
|
|
|
|
#include "mozilla/EventClassList.h"
|
|
|
|
|
|
|
|
#undef NS_EVENT_CLASS
|
|
|
|
#undef NS_ROOT_EVENT_CLASS
|
|
|
|
};
|
|
|
|
|
2015-09-17 03:05:44 +00:00
|
|
|
const char* ToChar(EventClassID aEventClassID);
|
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
typedef uint16_t Modifiers;
|
2012-04-25 03:00:01 +00:00
|
|
|
|
2013-04-24 03:49:46 +00:00
|
|
|
#define NS_DEFINE_KEYNAME(aCPPName, aDOMKeyName) \
|
|
|
|
KEY_NAME_INDEX_##aCPPName,
|
|
|
|
|
2013-09-24 10:04:14 +00:00
|
|
|
enum KeyNameIndex
|
|
|
|
{
|
2014-04-01 11:42:11 +00:00
|
|
|
#include "mozilla/KeyNameList.h"
|
2013-10-29 04:14:42 +00:00
|
|
|
// If a DOM keyboard event is synthesized by script, this is used. Then,
|
|
|
|
// specified key name should be stored and use it as .key value.
|
|
|
|
KEY_NAME_INDEX_USE_STRING
|
2013-04-24 03:49:46 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#undef NS_DEFINE_KEYNAME
|
|
|
|
|
2014-05-25 02:08:58 +00:00
|
|
|
#define NS_DEFINE_PHYSICAL_KEY_CODE_NAME(aCPPName, aDOMCodeName) \
|
|
|
|
CODE_NAME_INDEX_##aCPPName,
|
|
|
|
|
|
|
|
enum CodeNameIndex
|
|
|
|
{
|
|
|
|
#include "mozilla/PhysicalKeyCodeNameList.h"
|
|
|
|
// If a DOM keyboard event is synthesized by script, this is used. Then,
|
|
|
|
// specified code name should be stored and use it as .code value.
|
|
|
|
CODE_NAME_INDEX_USE_STRING
|
|
|
|
};
|
|
|
|
|
|
|
|
#undef NS_DEFINE_PHYSICAL_KEY_CODE_NAME
|
|
|
|
|
2014-03-14 13:13:30 +00:00
|
|
|
#define NS_DEFINE_COMMAND(aName, aCommandStr) , Command##aName
|
|
|
|
|
|
|
|
typedef int8_t CommandInt;
|
2015-01-21 13:35:19 +00:00
|
|
|
enum Command : CommandInt
|
2014-03-14 13:13:30 +00:00
|
|
|
{
|
|
|
|
CommandDoNothing
|
|
|
|
|
|
|
|
#include "mozilla/CommandList.h"
|
|
|
|
};
|
|
|
|
#undef NS_DEFINE_COMMAND
|
|
|
|
|
2012-04-25 03:00:01 +00:00
|
|
|
} // namespace mozilla
|
|
|
|
|
2013-09-24 10:04:14 +00:00
|
|
|
/**
|
|
|
|
* All header files should include this header instead of *Events.h.
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
2013-10-18 06:10:20 +00:00
|
|
|
#define NS_EVENT_CLASS(aPrefix, aName) class aPrefix##aName;
|
|
|
|
#define NS_ROOT_EVENT_CLASS(aPrefix, aName) NS_EVENT_CLASS(aPrefix, aName)
|
|
|
|
|
|
|
|
#include "mozilla/EventClassList.h"
|
|
|
|
|
|
|
|
#undef NS_EVENT_CLASS
|
|
|
|
#undef NS_ROOT_EVENT_CLASS
|
|
|
|
|
|
|
|
// BasicEvents.h
|
2014-11-25 05:02:31 +00:00
|
|
|
struct BaseEventFlags;
|
2013-10-18 06:10:20 +00:00
|
|
|
struct EventFlags;
|
2013-09-24 10:04:14 +00:00
|
|
|
|
2016-03-16 04:47:48 +00:00
|
|
|
class WidgetEventTime;
|
|
|
|
|
2013-09-24 10:04:14 +00:00
|
|
|
// TextEvents.h
|
2013-09-24 10:04:15 +00:00
|
|
|
struct AlternativeCharCode;
|
2016-03-18 02:22:37 +00:00
|
|
|
struct ShortcutKeyCandidate;
|
|
|
|
|
|
|
|
typedef nsTArray<ShortcutKeyCandidate> ShortcutKeyCandidateArray;
|
|
|
|
typedef AutoTArray<ShortcutKeyCandidate, 10> AutoShortcutKeyCandidateArray;
|
2013-10-22 13:27:36 +00:00
|
|
|
|
|
|
|
// TextRange.h
|
2013-09-24 10:04:15 +00:00
|
|
|
struct TextRangeStyle;
|
|
|
|
struct TextRange;
|
|
|
|
|
2014-03-04 13:48:26 +00:00
|
|
|
class TextRangeArray;
|
2013-09-24 10:04:14 +00:00
|
|
|
|
2015-01-31 07:17:12 +00:00
|
|
|
// FontRange.h
|
|
|
|
struct FontRange;
|
|
|
|
|
2013-09-24 10:04:16 +00:00
|
|
|
} // namespace mozilla
|
2013-09-24 10:04:14 +00:00
|
|
|
|
|
|
|
#endif // mozilla_EventForwards_h__
|