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