2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07: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/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2013-09-24 03:04:14 -07:00
|
|
|
#ifndef mozilla_EventForwards_h__
|
|
|
|
#define mozilla_EventForwards_h__
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2013-07-30 07:25:31 -07:00
|
|
|
#include <stdint.h>
|
2012-08-08 14:08:17 -07:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
/**
|
2013-09-24 03:04:14 -07:00
|
|
|
* XXX Following enums should be in BasicEvents.h. However, currently, it's
|
|
|
|
* impossible to use foward delearation for enum.
|
2007-03-22 10:30:00 -07:00
|
|
|
*/
|
|
|
|
|
2009-04-01 14:59:02 -07:00
|
|
|
/**
|
2013-09-24 03:04:14 -07:00
|
|
|
* Return status for event processors.
|
2009-04-01 14:59:02 -07:00
|
|
|
*/
|
2013-09-24 03:04:14 -07: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 05:16:00 -07:00
|
|
|
nsEventStatus_eConsumeDoDefault,
|
|
|
|
// Value is not for use, only for serialization
|
|
|
|
nsEventStatus_eSentinel
|
2009-04-01 14:59:02 -07:00
|
|
|
};
|
|
|
|
|
2015-08-26 05:56:59 -07:00
|
|
|
namespace mozilla {
|
|
|
|
|
2015-08-21 18:34:51 -07:00
|
|
|
/**
|
|
|
|
* Event messages
|
|
|
|
*/
|
|
|
|
|
2015-08-26 05:56:59 -07:00
|
|
|
typedef uint16_t EventMessageType;
|
|
|
|
|
|
|
|
enum EventMessage : EventMessageType
|
2015-08-21 18:34:51 -07:00
|
|
|
{
|
|
|
|
|
2015-09-16 20:05:44 -07:00
|
|
|
#define NS_EVENT_MESSAGE(aMessage) aMessage,
|
|
|
|
#define NS_EVENT_MESSAGE_FIRST_LAST(aMessage, aFirst, aLast) \
|
|
|
|
aMessage##First = aFirst, aMessage##Last = aLast,
|
2015-08-21 18:34:51 -07:00
|
|
|
|
|
|
|
#include "mozilla/EventMessageList.h"
|
|
|
|
|
|
|
|
#undef NS_EVENT_MESSAGE
|
2015-09-16 20:05:44 -07:00
|
|
|
#undef NS_EVENT_MESSAGE_FIRST_LAST
|
2015-08-21 18:34:51 -07:00
|
|
|
|
|
|
|
// For preventing bustage due to "," after the last item.
|
|
|
|
eEventMessage_MaxValue
|
|
|
|
};
|
|
|
|
|
2015-09-16 20:05:44 -07:00
|
|
|
const char* ToChar(EventMessage aEventMessage);
|
|
|
|
|
2015-08-21 18:34:51 -07:00
|
|
|
/**
|
|
|
|
* Event class IDs
|
|
|
|
*/
|
|
|
|
|
2014-08-03 22:28:58 -07:00
|
|
|
typedef uint8_t EventClassIDType;
|
|
|
|
|
2015-01-21 05:35:19 -08:00
|
|
|
enum EventClassID : EventClassIDType
|
2014-08-03 22:28:58 -07: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-16 20:05:44 -07:00
|
|
|
const char* ToChar(EventClassID aEventClassID);
|
|
|
|
|
2012-08-22 08:56:38 -07:00
|
|
|
typedef uint16_t Modifiers;
|
2012-04-24 20:00:01 -07:00
|
|
|
|
2013-04-23 20:49:46 -07:00
|
|
|
#define NS_DEFINE_KEYNAME(aCPPName, aDOMKeyName) \
|
|
|
|
KEY_NAME_INDEX_##aCPPName,
|
|
|
|
|
2013-09-24 03:04:14 -07:00
|
|
|
enum KeyNameIndex
|
|
|
|
{
|
2014-04-01 04:42:11 -07:00
|
|
|
#include "mozilla/KeyNameList.h"
|
2013-10-28 21:14:42 -07: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-23 20:49:46 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
#undef NS_DEFINE_KEYNAME
|
|
|
|
|
2014-05-24 19:08:58 -07: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 06:13:30 -07:00
|
|
|
#define NS_DEFINE_COMMAND(aName, aCommandStr) , Command##aName
|
|
|
|
|
|
|
|
typedef int8_t CommandInt;
|
2015-01-21 05:35:19 -08:00
|
|
|
enum Command : CommandInt
|
2014-03-14 06:13:30 -07:00
|
|
|
{
|
|
|
|
CommandDoNothing
|
|
|
|
|
|
|
|
#include "mozilla/CommandList.h"
|
|
|
|
};
|
|
|
|
#undef NS_DEFINE_COMMAND
|
|
|
|
|
2012-04-24 20:00:01 -07:00
|
|
|
} // namespace mozilla
|
|
|
|
|
2013-09-24 03:04:14 -07:00
|
|
|
/**
|
|
|
|
* All header files should include this header instead of *Events.h.
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
2013-10-17 23:10:20 -07: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-24 21:02:31 -08:00
|
|
|
struct BaseEventFlags;
|
2013-10-17 23:10:20 -07:00
|
|
|
struct EventFlags;
|
2013-09-24 03:04:14 -07:00
|
|
|
|
|
|
|
// TextEvents.h
|
2013-09-24 03:04:15 -07:00
|
|
|
struct AlternativeCharCode;
|
2013-10-22 06:27:36 -07:00
|
|
|
|
|
|
|
// TextRange.h
|
2013-09-24 03:04:15 -07:00
|
|
|
struct TextRangeStyle;
|
|
|
|
struct TextRange;
|
|
|
|
|
2014-03-04 05:48:26 -08:00
|
|
|
class TextRangeArray;
|
2013-09-24 03:04:14 -07:00
|
|
|
|
2015-01-30 23:17:12 -08:00
|
|
|
// FontRange.h
|
|
|
|
struct FontRange;
|
|
|
|
|
2013-09-24 03:04:16 -07:00
|
|
|
} // namespace mozilla
|
2013-09-24 03:04:14 -07:00
|
|
|
|
|
|
|
#endif // mozilla_EventForwards_h__
|