2001-09-29 00:14:13 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
2004-04-19 02:01:16 +04:00
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
1998-04-14 00:24:54 +04:00
|
|
|
*
|
2004-04-19 02:01:16 +04:00
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
1998-04-14 00:24:54 +04:00
|
|
|
*
|
2001-09-29 00:14:13 +04:00
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
1998-04-14 00:24:54 +04:00
|
|
|
*
|
1999-11-06 06:40:37 +03:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
2004-04-19 02:01:16 +04:00
|
|
|
* The Initial Developer of the Original Code is
|
2001-09-29 00:14:13 +04:00
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1998
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
1999-11-06 06:40:37 +03:00
|
|
|
*
|
2001-09-29 00:14:13 +04:00
|
|
|
* Contributor(s):
|
2002-12-06 06:41:43 +03:00
|
|
|
* Makoto Kato <m_kato@ga2.so-net.ne.jp>
|
|
|
|
* Dean Tessman <dean_tessman@hotmail.com>
|
2008-10-24 00:15:20 +04:00
|
|
|
* Thomas K. Dyas <tdyas@zecador.org> (simple gestures support)
|
2009-12-17 21:42:02 +03:00
|
|
|
* Masayuki Nakano <masayuki@d-toybox.com>
|
2001-09-29 00:14:13 +04:00
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
2004-04-19 02:01:16 +04:00
|
|
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
2001-09-29 00:14:13 +04:00
|
|
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
2004-04-19 02:01:16 +04:00
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
2001-09-29 00:14:13 +04:00
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
2004-04-19 02:01:16 +04:00
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
2001-09-29 00:14:13 +04:00
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
1998-04-14 00:24:54 +04:00
|
|
|
|
|
|
|
#ifndef nsGUIEvent_h__
|
|
|
|
#define nsGUIEvent_h__
|
|
|
|
|
2011-12-17 04:24:11 +04:00
|
|
|
#include "nsCOMArray.h"
|
1998-04-14 00:24:54 +04:00
|
|
|
#include "nsPoint.h"
|
|
|
|
#include "nsRect.h"
|
2008-09-18 13:47:21 +04:00
|
|
|
#include "nsRegion.h"
|
2001-07-16 06:40:48 +04:00
|
|
|
#include "nsEvent.h"
|
2006-10-05 14:44:03 +04:00
|
|
|
#include "nsStringGlue.h"
|
2006-03-07 20:08:51 +03:00
|
|
|
#include "nsCOMPtr.h"
|
2006-10-06 09:24:02 +04:00
|
|
|
#include "nsIAtom.h"
|
2000-08-18 01:43:26 +04:00
|
|
|
#include "nsIDOMKeyEvent.h"
|
2011-08-26 11:43:56 +04:00
|
|
|
#include "nsIDOMMouseEvent.h"
|
2008-08-27 16:07:27 +04:00
|
|
|
#include "nsIDOMDataTransfer.h"
|
2011-06-24 06:18:00 +04:00
|
|
|
#include "nsIDOMEventTarget.h"
|
2011-12-17 04:24:11 +04:00
|
|
|
#include "nsIDOMTouchEvent.h"
|
2007-01-13 04:08:43 +03:00
|
|
|
#include "nsWeakPtr.h"
|
2008-02-07 07:04:58 +03:00
|
|
|
#include "nsIWidget.h"
|
2008-04-15 08:16:24 +04:00
|
|
|
#include "nsTArray.h"
|
2008-04-18 02:38:35 +04:00
|
|
|
#include "nsTraceRefcnt.h"
|
2009-03-18 05:04:01 +03:00
|
|
|
#include "nsITransferable.h"
|
2009-09-01 20:45:05 +04:00
|
|
|
#include "nsIVariant.h"
|
2011-03-31 16:26:49 +04:00
|
|
|
#include "nsStyleConsts.h"
|
2011-12-17 04:24:11 +04:00
|
|
|
#include "nsAutoPtr.h"
|
2000-08-18 01:43:26 +04:00
|
|
|
|
2010-08-17 12:07:42 +04:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
class PBrowserParent;
|
|
|
|
class PBrowserChild;
|
|
|
|
}
|
2011-08-29 20:26:24 +04:00
|
|
|
namespace plugins {
|
|
|
|
class PPluginInstanceChild;
|
|
|
|
}
|
2010-08-17 12:07:42 +04:00
|
|
|
}
|
|
|
|
|
2010-05-12 10:47:35 +04:00
|
|
|
#ifdef ACCESSIBILITY
|
|
|
|
class nsAccessible;
|
|
|
|
#endif
|
2011-04-08 05:04:40 +04:00
|
|
|
class nsRenderingContext;
|
1998-10-07 23:49:36 +04:00
|
|
|
class nsIMenuItem;
|
2001-04-17 14:02:11 +04:00
|
|
|
class nsIContent;
|
2003-04-16 03:34:08 +04:00
|
|
|
class nsIURI;
|
2006-10-05 14:44:03 +04:00
|
|
|
class nsHashKey;
|
2006-05-23 00:37:32 +04:00
|
|
|
|
2002-03-27 09:24:55 +03:00
|
|
|
/**
|
|
|
|
* Event Struct Types
|
|
|
|
*/
|
2004-02-11 09:09:51 +03:00
|
|
|
#define NS_EVENT 1
|
|
|
|
#define NS_GUI_EVENT 2
|
|
|
|
#define NS_SIZE_EVENT 3
|
|
|
|
#define NS_SIZEMODE_EVENT 4
|
|
|
|
#define NS_ZLEVEL_EVENT 5
|
|
|
|
#define NS_PAINT_EVENT 6
|
|
|
|
#define NS_SCROLLBAR_EVENT 7
|
|
|
|
#define NS_INPUT_EVENT 8
|
|
|
|
#define NS_KEY_EVENT 9
|
|
|
|
#define NS_MOUSE_EVENT 10
|
|
|
|
#define NS_SCRIPT_ERROR_EVENT 12
|
|
|
|
#define NS_TEXT_EVENT 13
|
|
|
|
#define NS_COMPOSITION_EVENT 14
|
|
|
|
#define NS_MOUSE_SCROLL_EVENT 16
|
|
|
|
#define NS_SCROLLPORT_EVENT 18
|
2004-08-26 02:26:15 +04:00
|
|
|
#define NS_MUTATION_EVENT 19 // |nsMutationEvent| in content
|
2004-02-11 09:09:51 +03:00
|
|
|
#define NS_ACCESSIBLE_EVENT 20
|
|
|
|
#define NS_FORM_EVENT 21
|
2009-10-01 21:53:10 +04:00
|
|
|
#define NS_FOCUS_EVENT 22
|
2004-02-11 09:09:51 +03:00
|
|
|
#define NS_POPUP_EVENT 23
|
2006-12-01 14:09:53 +03:00
|
|
|
#define NS_COMMAND_EVENT 24
|
2009-09-12 03:13:56 +04:00
|
|
|
#define NS_SCROLLAREA_EVENT 25
|
2009-12-23 22:10:31 +03:00
|
|
|
#define NS_TRANSITION_EVENT 26
|
2011-04-12 10:18:44 +04:00
|
|
|
#define NS_ANIMATION_EVENT 27
|
2009-06-24 12:42:00 +04:00
|
|
|
|
2011-04-12 10:18:44 +04:00
|
|
|
#define NS_UI_EVENT 28
|
2005-08-26 01:31:09 +04:00
|
|
|
#define NS_SVG_EVENT 30
|
|
|
|
#define NS_SVGZOOM_EVENT 31
|
2010-07-31 11:02:52 +04:00
|
|
|
#define NS_SMIL_TIME_EVENT 32
|
2009-06-30 11:56:40 +04:00
|
|
|
|
2008-02-20 10:40:04 +03:00
|
|
|
#define NS_QUERY_CONTENT_EVENT 33
|
2010-06-22 22:12:12 +04:00
|
|
|
|
2008-08-27 16:07:27 +04:00
|
|
|
#define NS_DRAG_EVENT 35
|
2008-09-18 13:47:21 +04:00
|
|
|
#define NS_NOTIFYPAINT_EVENT 36
|
2008-10-24 00:15:20 +04:00
|
|
|
#define NS_SIMPLE_GESTURE_EVENT 37
|
2009-02-10 23:56:51 +03:00
|
|
|
#define NS_SELECTION_EVENT 38
|
2009-08-07 19:11:17 +04:00
|
|
|
#define NS_CONTENT_COMMAND_EVENT 39
|
2009-08-14 00:54:09 +04:00
|
|
|
#define NS_GESTURENOTIFY_EVENT 40
|
2010-04-21 18:53:42 +04:00
|
|
|
#define NS_UISTATECHANGE_EVENT 41
|
2010-08-02 17:34:54 +04:00
|
|
|
#define NS_MOZTOUCH_EVENT 42
|
2011-05-11 08:52:44 +04:00
|
|
|
#define NS_PLUGIN_EVENT 43
|
2011-12-17 04:24:11 +04:00
|
|
|
#define NS_TOUCH_EVENT 44
|
2002-03-27 09:24:55 +03:00
|
|
|
|
2005-06-22 05:53:58 +04:00
|
|
|
// These flags are sort of a mess. They're sort of shared between event
|
|
|
|
// listener flags and event flags, but only some of them. You've been
|
|
|
|
// warned!
|
2002-03-27 09:24:55 +03:00
|
|
|
#define NS_EVENT_FLAG_NONE 0x0000
|
2006-04-10 21:04:54 +04:00
|
|
|
#define NS_EVENT_FLAG_TRUSTED 0x0001
|
2002-03-27 09:24:55 +03:00
|
|
|
#define NS_EVENT_FLAG_BUBBLE 0x0002
|
|
|
|
#define NS_EVENT_FLAG_CAPTURE 0x0004
|
|
|
|
#define NS_EVENT_FLAG_STOP_DISPATCH 0x0008
|
|
|
|
#define NS_EVENT_FLAG_NO_DEFAULT 0x0010
|
|
|
|
#define NS_EVENT_FLAG_CANT_CANCEL 0x0020
|
|
|
|
#define NS_EVENT_FLAG_CANT_BUBBLE 0x0040
|
|
|
|
#define NS_PRIV_EVENT_FLAG_SCRIPT 0x0080
|
|
|
|
#define NS_EVENT_FLAG_NO_CONTENT_DISPATCH 0x0100
|
|
|
|
#define NS_EVENT_FLAG_SYSTEM_EVENT 0x0200
|
2008-06-05 00:09:48 +04:00
|
|
|
// Event has been dispatched at least once
|
|
|
|
#define NS_EVENT_DISPATCHED 0x0400
|
2005-06-22 05:53:58 +04:00
|
|
|
#define NS_EVENT_FLAG_DISPATCHING 0x0800
|
2009-02-12 13:44:38 +03:00
|
|
|
// When an event is synthesized for testing, this flag will be set.
|
2009-10-03 01:06:42 +04:00
|
|
|
// Note that this is currently used only with mouse events, because this
|
|
|
|
// flag is not needed on other events now. It could be added to other
|
|
|
|
// events.
|
|
|
|
#define NS_EVENT_FLAG_SYNTHETIC_TEST_EVENT 0x1000
|
2005-06-22 05:53:58 +04:00
|
|
|
|
2009-10-29 14:11:02 +03:00
|
|
|
// Use this flag if the event should be dispatched only to chrome.
|
|
|
|
#define NS_EVENT_FLAG_ONLY_CHROME_DISPATCH 0x2000
|
|
|
|
|
|
|
|
// A flag for drag&drop handling.
|
|
|
|
#define NS_EVENT_FLAG_NO_DEFAULT_CALLED_IN_CONTENT 0x4000
|
|
|
|
|
2005-06-22 05:53:58 +04:00
|
|
|
#define NS_PRIV_EVENT_UNTRUSTED_PERMITTED 0x8000
|
2002-03-27 09:24:55 +03:00
|
|
|
|
2010-12-16 00:20:57 +03:00
|
|
|
#define NS_EVENT_FLAG_EXCEPTION_THROWN 0x10000
|
|
|
|
|
2011-07-19 20:19:32 +04:00
|
|
|
#define NS_EVENT_FLAG_PREVENT_MULTIPLE_ACTIONS 0x20000
|
2010-12-27 23:42:10 +03:00
|
|
|
|
2011-06-19 13:23:12 +04:00
|
|
|
#define NS_EVENT_RETARGET_TO_NON_NATIVE_ANONYMOUS 0x40000
|
|
|
|
|
2011-11-04 21:17:19 +04:00
|
|
|
#define NS_EVENT_FLAG_STOP_DISPATCH_IMMEDIATELY 0x80000
|
|
|
|
|
2006-04-10 21:04:54 +04:00
|
|
|
#define NS_EVENT_CAPTURE_MASK (~(NS_EVENT_FLAG_BUBBLE | NS_EVENT_FLAG_NO_CONTENT_DISPATCH))
|
|
|
|
#define NS_EVENT_BUBBLE_MASK (~(NS_EVENT_FLAG_CAPTURE | NS_EVENT_FLAG_NO_CONTENT_DISPATCH))
|
2002-03-27 09:24:55 +03:00
|
|
|
|
|
|
|
#define NS_EVENT_TYPE_NULL 0
|
|
|
|
|
2004-03-05 04:34:34 +03:00
|
|
|
/**
|
|
|
|
* GUI MESSAGES
|
|
|
|
*/
|
|
|
|
//@{
|
|
|
|
#define NS_EVENT_NULL 0
|
|
|
|
|
|
|
|
|
|
|
|
#define NS_WINDOW_START 100
|
|
|
|
|
|
|
|
// Widget is being created
|
|
|
|
#define NS_CREATE (NS_WINDOW_START)
|
|
|
|
// Widget may be destroyed
|
|
|
|
#define NS_XUL_CLOSE (NS_WINDOW_START + 1)
|
|
|
|
// Widget is being destroyed
|
|
|
|
#define NS_DESTROY (NS_WINDOW_START + 2)
|
|
|
|
// Widget was resized
|
|
|
|
#define NS_SIZE (NS_WINDOW_START + 3)
|
|
|
|
// Widget size mode was changed
|
|
|
|
#define NS_SIZEMODE (NS_WINDOW_START + 4)
|
|
|
|
// Widget got activated
|
|
|
|
#define NS_ACTIVATE (NS_WINDOW_START + 7)
|
|
|
|
// Widget got deactivated
|
|
|
|
#define NS_DEACTIVATE (NS_WINDOW_START + 8)
|
|
|
|
// top-level window z-level change request
|
|
|
|
#define NS_SETZLEVEL (NS_WINDOW_START + 9)
|
2010-07-16 01:08:08 +04:00
|
|
|
// Widget was repainted (dispatched when it's safe to move widgets, but
|
|
|
|
// only on some platforms (including GTK2 and Windows))
|
|
|
|
#define NS_DID_PAINT (NS_WINDOW_START + 28)
|
2009-11-14 02:03:46 +03:00
|
|
|
// Widget will need to be painted
|
|
|
|
#define NS_WILL_PAINT (NS_WINDOW_START + 29)
|
2004-03-05 04:34:34 +03:00
|
|
|
// Widget needs to be repainted
|
|
|
|
#define NS_PAINT (NS_WINDOW_START + 30)
|
|
|
|
// Key is pressed within a window
|
|
|
|
#define NS_KEY_PRESS (NS_WINDOW_START + 31)
|
|
|
|
// Key is released within a window
|
|
|
|
#define NS_KEY_UP (NS_WINDOW_START + 32)
|
|
|
|
// Key is pressed within a window
|
|
|
|
#define NS_KEY_DOWN (NS_WINDOW_START + 33)
|
|
|
|
// Window has been moved to a new location.
|
|
|
|
// The events point contains the x, y location in screen coordinates
|
|
|
|
#define NS_MOVE (NS_WINDOW_START + 34)
|
|
|
|
|
|
|
|
// Tab control's selected tab has changed
|
|
|
|
#define NS_TABCHANGE (NS_WINDOW_START + 35)
|
|
|
|
|
|
|
|
#define NS_OS_TOOLBAR (NS_WINDOW_START + 36)
|
|
|
|
|
|
|
|
// Indicates the display has changed depth
|
|
|
|
#define NS_DISPLAYCHANGED (NS_WINDOW_START + 40)
|
|
|
|
|
|
|
|
// Indicates a theme change has occurred
|
|
|
|
#define NS_THEMECHANGED (NS_WINDOW_START + 41)
|
|
|
|
|
|
|
|
// Indicates a System color has changed. It is the platform
|
|
|
|
// toolkits responsibility to invalidate the window to
|
|
|
|
// ensure that it is drawn using the current system colors.
|
|
|
|
#define NS_SYSCOLORCHANGED (NS_WINDOW_START + 42)
|
|
|
|
|
2010-04-21 18:53:42 +04:00
|
|
|
// Indicates that the ui state such as whether to show focus or
|
|
|
|
// keyboard accelerator indicators has changed.
|
|
|
|
#define NS_UISTATECHANGED (NS_WINDOW_START + 43)
|
|
|
|
|
2011-03-26 02:17:35 +03:00
|
|
|
// Done sizing or moving a window, so ensure that the mousedown state was cleared.
|
|
|
|
#define NS_DONESIZEMOVE (NS_WINDOW_START + 44)
|
|
|
|
|
2004-03-05 04:34:34 +03:00
|
|
|
#define NS_RESIZE_EVENT (NS_WINDOW_START + 60)
|
|
|
|
#define NS_SCROLL_EVENT (NS_WINDOW_START + 61)
|
|
|
|
|
2010-11-16 00:12:50 +03:00
|
|
|
// A plugin was clicked or otherwise focused. NS_PLUGIN_ACTIVATE should be
|
|
|
|
// used when the window is not active. NS_PLUGIN_FOCUS should be used when
|
|
|
|
// the window is active. In the latter case, the dispatcher of the event
|
|
|
|
// is expected to ensure that the plugin's widget is focused beforehand.
|
2004-03-05 04:34:34 +03:00
|
|
|
#define NS_PLUGIN_ACTIVATE (NS_WINDOW_START + 62)
|
2010-11-16 00:12:50 +03:00
|
|
|
#define NS_PLUGIN_FOCUS (NS_WINDOW_START + 63)
|
2004-03-05 04:34:34 +03:00
|
|
|
|
2010-11-16 00:12:50 +03:00
|
|
|
#define NS_OFFLINE (NS_WINDOW_START + 64)
|
|
|
|
#define NS_ONLINE (NS_WINDOW_START + 65)
|
2007-06-07 07:28:04 +04:00
|
|
|
|
2010-11-17 16:46:00 +03:00
|
|
|
// Indicates a resize will occur
|
|
|
|
#define NS_BEFORERESIZE_EVENT (NS_WINDOW_START + 66)
|
|
|
|
|
2004-03-05 04:34:34 +03:00
|
|
|
#define NS_MOUSE_MESSAGE_START 300
|
|
|
|
#define NS_MOUSE_MOVE (NS_MOUSE_MESSAGE_START)
|
2006-11-17 00:35:39 +03:00
|
|
|
#define NS_MOUSE_BUTTON_UP (NS_MOUSE_MESSAGE_START + 1)
|
|
|
|
#define NS_MOUSE_BUTTON_DOWN (NS_MOUSE_MESSAGE_START + 2)
|
2004-03-05 04:34:34 +03:00
|
|
|
#define NS_MOUSE_ENTER (NS_MOUSE_MESSAGE_START + 22)
|
|
|
|
#define NS_MOUSE_EXIT (NS_MOUSE_MESSAGE_START + 23)
|
2006-11-17 00:35:39 +03:00
|
|
|
#define NS_MOUSE_DOUBLECLICK (NS_MOUSE_MESSAGE_START + 24)
|
|
|
|
#define NS_MOUSE_CLICK (NS_MOUSE_MESSAGE_START + 27)
|
2004-03-05 04:34:34 +03:00
|
|
|
#define NS_MOUSE_ACTIVATE (NS_MOUSE_MESSAGE_START + 30)
|
|
|
|
#define NS_MOUSE_ENTER_SYNTH (NS_MOUSE_MESSAGE_START + 31)
|
|
|
|
#define NS_MOUSE_EXIT_SYNTH (NS_MOUSE_MESSAGE_START + 32)
|
2010-06-28 10:04:05 +04:00
|
|
|
#define NS_MOUSE_MOZHITTEST (NS_MOUSE_MESSAGE_START + 33)
|
2011-09-18 11:45:14 +04:00
|
|
|
#define NS_MOUSEENTER (NS_MOUSE_MESSAGE_START + 34)
|
|
|
|
#define NS_MOUSELEAVE (NS_MOUSE_MESSAGE_START + 35)
|
2004-03-05 04:34:34 +03:00
|
|
|
|
|
|
|
#define NS_CONTEXTMENU_MESSAGE_START 500
|
|
|
|
#define NS_CONTEXTMENU (NS_CONTEXTMENU_MESSAGE_START)
|
|
|
|
|
|
|
|
#define NS_SCROLLBAR_MESSAGE_START 1000
|
|
|
|
#define NS_SCROLLBAR_POS (NS_SCROLLBAR_MESSAGE_START)
|
|
|
|
#define NS_SCROLLBAR_PAGE_NEXT (NS_SCROLLBAR_MESSAGE_START + 1)
|
|
|
|
#define NS_SCROLLBAR_PAGE_PREV (NS_SCROLLBAR_MESSAGE_START + 2)
|
|
|
|
#define NS_SCROLLBAR_LINE_NEXT (NS_SCROLLBAR_MESSAGE_START + 3)
|
|
|
|
#define NS_SCROLLBAR_LINE_PREV (NS_SCROLLBAR_MESSAGE_START + 4)
|
|
|
|
|
|
|
|
#define NS_STREAM_EVENT_START 1100
|
2006-08-31 23:33:01 +04:00
|
|
|
#define NS_LOAD (NS_STREAM_EVENT_START)
|
2004-03-05 04:34:34 +03:00
|
|
|
#define NS_PAGE_UNLOAD (NS_STREAM_EVENT_START + 1)
|
2009-06-26 21:16:50 +04:00
|
|
|
#define NS_HASHCHANGE (NS_STREAM_EVENT_START + 2)
|
2004-03-05 04:34:34 +03:00
|
|
|
#define NS_IMAGE_ABORT (NS_STREAM_EVENT_START + 3)
|
2006-09-02 14:00:26 +04:00
|
|
|
#define NS_LOAD_ERROR (NS_STREAM_EVENT_START + 4)
|
2009-09-01 20:45:05 +04:00
|
|
|
#define NS_POPSTATE (NS_STREAM_EVENT_START + 5)
|
2004-03-05 04:34:34 +03:00
|
|
|
#define NS_BEFORE_PAGE_UNLOAD (NS_STREAM_EVENT_START + 6)
|
2005-05-05 00:22:32 +04:00
|
|
|
#define NS_PAGE_RESTORE (NS_STREAM_EVENT_START + 7)
|
2010-06-24 05:12:07 +04:00
|
|
|
#define NS_READYSTATECHANGE (NS_STREAM_EVENT_START + 8)
|
2004-03-05 04:34:34 +03:00
|
|
|
|
|
|
|
#define NS_FORM_EVENT_START 1200
|
|
|
|
#define NS_FORM_SUBMIT (NS_FORM_EVENT_START)
|
|
|
|
#define NS_FORM_RESET (NS_FORM_EVENT_START + 1)
|
|
|
|
#define NS_FORM_CHANGE (NS_FORM_EVENT_START + 2)
|
|
|
|
#define NS_FORM_SELECTED (NS_FORM_EVENT_START + 3)
|
|
|
|
#define NS_FORM_INPUT (NS_FORM_EVENT_START + 4)
|
2010-08-18 22:28:08 +04:00
|
|
|
#define NS_FORM_INVALID (NS_FORM_EVENT_START + 5)
|
2004-03-05 04:34:34 +03:00
|
|
|
|
|
|
|
//Need separate focus/blur notifications for non-native widgets
|
|
|
|
#define NS_FOCUS_EVENT_START 1300
|
|
|
|
#define NS_FOCUS_CONTENT (NS_FOCUS_EVENT_START)
|
|
|
|
#define NS_BLUR_CONTENT (NS_FOCUS_EVENT_START + 1)
|
|
|
|
|
|
|
|
#define NS_DRAGDROP_EVENT_START 1400
|
|
|
|
#define NS_DRAGDROP_ENTER (NS_DRAGDROP_EVENT_START)
|
|
|
|
#define NS_DRAGDROP_OVER (NS_DRAGDROP_EVENT_START + 1)
|
|
|
|
#define NS_DRAGDROP_EXIT (NS_DRAGDROP_EVENT_START + 2)
|
2008-08-27 16:07:27 +04:00
|
|
|
#define NS_DRAGDROP_DRAGDROP (NS_DRAGDROP_EVENT_START + 3)
|
2004-03-05 04:34:34 +03:00
|
|
|
#define NS_DRAGDROP_GESTURE (NS_DRAGDROP_EVENT_START + 4)
|
2007-04-12 08:37:39 +04:00
|
|
|
#define NS_DRAGDROP_DRAG (NS_DRAGDROP_EVENT_START + 5)
|
|
|
|
#define NS_DRAGDROP_END (NS_DRAGDROP_EVENT_START + 6)
|
2008-08-27 16:07:27 +04:00
|
|
|
#define NS_DRAGDROP_START (NS_DRAGDROP_EVENT_START + 7)
|
|
|
|
#define NS_DRAGDROP_DROP (NS_DRAGDROP_EVENT_START + 8)
|
2004-03-05 04:34:34 +03:00
|
|
|
#define NS_DRAGDROP_OVER_SYNTH (NS_DRAGDROP_EVENT_START + 1)
|
|
|
|
#define NS_DRAGDROP_EXIT_SYNTH (NS_DRAGDROP_EVENT_START + 2)
|
2008-08-27 16:07:27 +04:00
|
|
|
#define NS_DRAGDROP_LEAVE_SYNTH (NS_DRAGDROP_EVENT_START + 9)
|
2004-03-05 04:34:34 +03:00
|
|
|
|
|
|
|
// Events for popups
|
|
|
|
#define NS_XUL_EVENT_START 1500
|
|
|
|
#define NS_XUL_POPUP_SHOWING (NS_XUL_EVENT_START)
|
|
|
|
#define NS_XUL_POPUP_SHOWN (NS_XUL_EVENT_START+1)
|
|
|
|
#define NS_XUL_POPUP_HIDING (NS_XUL_EVENT_START+2)
|
|
|
|
#define NS_XUL_POPUP_HIDDEN (NS_XUL_EVENT_START+3)
|
2006-05-23 00:37:32 +04:00
|
|
|
// NS_XUL_COMMAND used to be here (NS_XUL_EVENT_START+4)
|
2004-03-05 04:34:34 +03:00
|
|
|
#define NS_XUL_BROADCAST (NS_XUL_EVENT_START+5)
|
|
|
|
#define NS_XUL_COMMAND_UPDATE (NS_XUL_EVENT_START+6)
|
|
|
|
//@}
|
|
|
|
|
|
|
|
// Scroll events
|
|
|
|
#define NS_MOUSE_SCROLL_START 1600
|
|
|
|
#define NS_MOUSE_SCROLL (NS_MOUSE_SCROLL_START)
|
2008-09-17 15:27:19 +04:00
|
|
|
#define NS_MOUSE_PIXEL_SCROLL (NS_MOUSE_SCROLL_START + 1)
|
2004-03-05 04:34:34 +03:00
|
|
|
|
|
|
|
#define NS_SCROLLPORT_START 1700
|
|
|
|
#define NS_SCROLLPORT_UNDERFLOW (NS_SCROLLPORT_START)
|
|
|
|
#define NS_SCROLLPORT_OVERFLOW (NS_SCROLLPORT_START+1)
|
|
|
|
#define NS_SCROLLPORT_OVERFLOWCHANGED (NS_SCROLLPORT_START+2)
|
|
|
|
|
|
|
|
// Mutation events defined elsewhere starting at 1800
|
|
|
|
|
|
|
|
// accessible events
|
|
|
|
#define NS_ACCESSIBLE_START 1900
|
|
|
|
#define NS_GETACCESSIBLE (NS_ACCESSIBLE_START)
|
|
|
|
|
|
|
|
#define NS_USER_DEFINED_EVENT 2000
|
|
|
|
|
|
|
|
// composition events
|
|
|
|
#define NS_COMPOSITION_EVENT_START 2200
|
|
|
|
#define NS_COMPOSITION_START (NS_COMPOSITION_EVENT_START)
|
|
|
|
#define NS_COMPOSITION_END (NS_COMPOSITION_EVENT_START + 1)
|
2011-09-22 13:17:40 +04:00
|
|
|
#define NS_COMPOSITION_UPDATE (NS_COMPOSITION_EVENT_START + 2)
|
2004-03-05 04:34:34 +03:00
|
|
|
|
|
|
|
// text events
|
|
|
|
#define NS_TEXT_START 2400
|
|
|
|
#define NS_TEXT_TEXT (NS_TEXT_START)
|
|
|
|
|
2004-08-20 22:09:19 +04:00
|
|
|
// UI events
|
|
|
|
#define NS_UI_EVENT_START 2500
|
2004-05-01 03:55:16 +04:00
|
|
|
// this is not to be confused with NS_ACTIVATE!
|
2004-08-20 22:09:19 +04:00
|
|
|
#define NS_UI_ACTIVATE (NS_UI_EVENT_START)
|
|
|
|
#define NS_UI_FOCUSIN (NS_UI_EVENT_START + 1)
|
|
|
|
#define NS_UI_FOCUSOUT (NS_UI_EVENT_START + 2)
|
2004-05-01 03:55:16 +04:00
|
|
|
|
2005-06-16 03:52:46 +04:00
|
|
|
// pagetransition events
|
|
|
|
#define NS_PAGETRANSITION_START 2700
|
|
|
|
#define NS_PAGE_SHOW (NS_PAGETRANSITION_START + 1)
|
|
|
|
#define NS_PAGE_HIDE (NS_PAGETRANSITION_START + 2)
|
|
|
|
|
2005-08-26 01:31:09 +04:00
|
|
|
// SVG events
|
|
|
|
#define NS_SVG_EVENT_START 2800
|
|
|
|
#define NS_SVG_LOAD (NS_SVG_EVENT_START)
|
|
|
|
#define NS_SVG_UNLOAD (NS_SVG_EVENT_START + 1)
|
|
|
|
#define NS_SVG_ABORT (NS_SVG_EVENT_START + 2)
|
|
|
|
#define NS_SVG_ERROR (NS_SVG_EVENT_START + 3)
|
|
|
|
#define NS_SVG_RESIZE (NS_SVG_EVENT_START + 4)
|
|
|
|
#define NS_SVG_SCROLL (NS_SVG_EVENT_START + 5)
|
|
|
|
|
|
|
|
// SVG Zoom events
|
|
|
|
#define NS_SVGZOOM_EVENT_START 2900
|
|
|
|
#define NS_SVG_ZOOM (NS_SVGZOOM_EVENT_START)
|
|
|
|
|
2006-05-23 00:37:32 +04:00
|
|
|
// XUL command events
|
|
|
|
#define NS_XULCOMMAND_EVENT_START 3000
|
|
|
|
#define NS_XUL_COMMAND (NS_XULCOMMAND_EVENT_START)
|
|
|
|
|
2007-07-26 08:14:33 +04:00
|
|
|
// Cut, copy, paste events
|
|
|
|
#define NS_CUTCOPYPASTE_EVENT_START 3100
|
|
|
|
#define NS_COPY (NS_CUTCOPYPASTE_EVENT_START)
|
|
|
|
#define NS_CUT (NS_CUTCOPYPASTE_EVENT_START + 1)
|
|
|
|
#define NS_PASTE (NS_CUTCOPYPASTE_EVENT_START + 2)
|
|
|
|
|
2008-02-20 10:40:04 +03:00
|
|
|
// Query the content information
|
|
|
|
#define NS_QUERY_CONTENT_EVENT_START 3200
|
|
|
|
// Query for the selected text information, it return the selection offset,
|
|
|
|
// selection length and selected text.
|
|
|
|
#define NS_QUERY_SELECTED_TEXT (NS_QUERY_CONTENT_EVENT_START)
|
|
|
|
// Query for the text content of specified range, it returns actual lengh (if
|
|
|
|
// the specified range is too long) and the text of the specified range.
|
2009-02-10 23:56:51 +03:00
|
|
|
// Returns the entire text if requested length > actual length.
|
2008-02-20 10:40:04 +03:00
|
|
|
#define NS_QUERY_TEXT_CONTENT (NS_QUERY_CONTENT_EVENT_START + 1)
|
|
|
|
// Query for the caret rect of nth insertion point. The offset of the result is
|
|
|
|
// relative position from the top level widget.
|
|
|
|
#define NS_QUERY_CARET_RECT (NS_QUERY_CONTENT_EVENT_START + 3)
|
2009-02-10 23:56:51 +03:00
|
|
|
// Query for the bounding rect of a range of characters. This works on any
|
|
|
|
// valid character range given offset and length. Result is relative to top
|
|
|
|
// level widget coordinates
|
|
|
|
#define NS_QUERY_TEXT_RECT (NS_QUERY_CONTENT_EVENT_START + 4)
|
|
|
|
// Query for the bounding rect of the current focused frame. Result is relative
|
|
|
|
// to top level widget coordinates
|
2009-05-15 04:46:24 +04:00
|
|
|
#define NS_QUERY_EDITOR_RECT (NS_QUERY_CONTENT_EVENT_START + 5)
|
2009-03-18 05:04:01 +03:00
|
|
|
// Query for the current state of the content. The particular members of
|
|
|
|
// mReply that are set for each query content event will be valid on success.
|
2009-05-15 04:46:24 +04:00
|
|
|
#define NS_QUERY_CONTENT_STATE (NS_QUERY_CONTENT_EVENT_START + 6)
|
2009-03-18 05:04:01 +03:00
|
|
|
// Query for the selection in the form of a nsITransferable.
|
|
|
|
#define NS_QUERY_SELECTION_AS_TRANSFERABLE (NS_QUERY_CONTENT_EVENT_START + 7)
|
2009-05-15 04:46:24 +04:00
|
|
|
// Query for character at a point. This returns the character offset and its
|
|
|
|
// rect. The point is specified by nsEvent::refPoint.
|
|
|
|
#define NS_QUERY_CHARACTER_AT_POINT (NS_QUERY_CONTENT_EVENT_START + 8)
|
2011-03-02 00:15:23 +03:00
|
|
|
// Query if the DOM element under nsEvent::refPoint belongs to our widget
|
|
|
|
// or not.
|
|
|
|
#define NS_QUERY_DOM_WIDGET_HITTEST (NS_QUERY_CONTENT_EVENT_START + 9)
|
2011-05-17 04:23:23 +04:00
|
|
|
// Query for some information about mouse wheel event's target
|
|
|
|
// XXX This is used only for supporting high resolution mouse scroll on Windows
|
|
|
|
// and it's going to be reimplemented with another approach. At that time,
|
|
|
|
// this even is going to be removed. Therefore, DON'T use this event for
|
|
|
|
// other purpose.
|
|
|
|
#define NS_QUERY_SCROLL_TARGET_INFO (NS_QUERY_CONTENT_EVENT_START + 99)
|
2008-02-20 10:40:04 +03:00
|
|
|
|
2008-07-09 12:22:20 +04:00
|
|
|
// Video events
|
|
|
|
#define NS_MEDIA_EVENT_START 3300
|
|
|
|
#define NS_LOADSTART (NS_MEDIA_EVENT_START)
|
|
|
|
#define NS_PROGRESS (NS_MEDIA_EVENT_START+1)
|
2009-02-26 14:55:30 +03:00
|
|
|
#define NS_SUSPEND (NS_MEDIA_EVENT_START+2)
|
|
|
|
#define NS_EMPTIED (NS_MEDIA_EVENT_START+3)
|
|
|
|
#define NS_STALLED (NS_MEDIA_EVENT_START+4)
|
|
|
|
#define NS_PLAY (NS_MEDIA_EVENT_START+5)
|
|
|
|
#define NS_PAUSE (NS_MEDIA_EVENT_START+6)
|
|
|
|
#define NS_LOADEDMETADATA (NS_MEDIA_EVENT_START+7)
|
|
|
|
#define NS_LOADEDDATA (NS_MEDIA_EVENT_START+8)
|
|
|
|
#define NS_WAITING (NS_MEDIA_EVENT_START+9)
|
|
|
|
#define NS_PLAYING (NS_MEDIA_EVENT_START+10)
|
|
|
|
#define NS_CANPLAY (NS_MEDIA_EVENT_START+11)
|
|
|
|
#define NS_CANPLAYTHROUGH (NS_MEDIA_EVENT_START+12)
|
|
|
|
#define NS_SEEKING (NS_MEDIA_EVENT_START+13)
|
|
|
|
#define NS_SEEKED (NS_MEDIA_EVENT_START+14)
|
|
|
|
#define NS_TIMEUPDATE (NS_MEDIA_EVENT_START+15)
|
|
|
|
#define NS_ENDED (NS_MEDIA_EVENT_START+16)
|
|
|
|
#define NS_RATECHANGE (NS_MEDIA_EVENT_START+17)
|
|
|
|
#define NS_DURATIONCHANGE (NS_MEDIA_EVENT_START+18)
|
|
|
|
#define NS_VOLUMECHANGE (NS_MEDIA_EVENT_START+19)
|
2010-08-25 17:10:00 +04:00
|
|
|
#define NS_MOZAUDIOAVAILABLE (NS_MEDIA_EVENT_START+20)
|
2008-07-09 12:22:20 +04:00
|
|
|
|
2008-09-18 13:47:21 +04:00
|
|
|
// paint notification events
|
|
|
|
#define NS_NOTIFYPAINT_START 3400
|
|
|
|
#define NS_AFTERPAINT (NS_NOTIFYPAINT_START)
|
|
|
|
|
2008-10-24 00:15:20 +04:00
|
|
|
// Simple gesture events
|
|
|
|
#define NS_SIMPLE_GESTURE_EVENT_START 3500
|
|
|
|
#define NS_SIMPLE_GESTURE_SWIPE (NS_SIMPLE_GESTURE_EVENT_START)
|
|
|
|
#define NS_SIMPLE_GESTURE_MAGNIFY_START (NS_SIMPLE_GESTURE_EVENT_START+1)
|
|
|
|
#define NS_SIMPLE_GESTURE_MAGNIFY_UPDATE (NS_SIMPLE_GESTURE_EVENT_START+2)
|
|
|
|
#define NS_SIMPLE_GESTURE_MAGNIFY (NS_SIMPLE_GESTURE_EVENT_START+3)
|
|
|
|
#define NS_SIMPLE_GESTURE_ROTATE_START (NS_SIMPLE_GESTURE_EVENT_START+4)
|
|
|
|
#define NS_SIMPLE_GESTURE_ROTATE_UPDATE (NS_SIMPLE_GESTURE_EVENT_START+5)
|
|
|
|
#define NS_SIMPLE_GESTURE_ROTATE (NS_SIMPLE_GESTURE_EVENT_START+6)
|
2009-04-02 23:34:31 +04:00
|
|
|
#define NS_SIMPLE_GESTURE_TAP (NS_SIMPLE_GESTURE_EVENT_START+7)
|
|
|
|
#define NS_SIMPLE_GESTURE_PRESSTAP (NS_SIMPLE_GESTURE_EVENT_START+8)
|
2008-10-24 00:15:20 +04:00
|
|
|
|
2011-05-11 08:52:44 +04:00
|
|
|
// These are used to send native events to plugins.
|
|
|
|
#define NS_PLUGIN_EVENT_START 3600
|
|
|
|
#define NS_PLUGIN_INPUT_EVENT (NS_PLUGIN_EVENT_START)
|
|
|
|
#define NS_PLUGIN_FOCUS_EVENT (NS_PLUGIN_EVENT_START+1)
|
2008-12-15 06:54:54 +03:00
|
|
|
|
2009-02-10 23:56:51 +03:00
|
|
|
// Events to manipulate selection (nsSelectionEvent)
|
|
|
|
#define NS_SELECTION_EVENT_START 3700
|
|
|
|
// Clear any previous selection and set the given range as the selection
|
|
|
|
#define NS_SELECTION_SET (NS_SELECTION_EVENT_START)
|
|
|
|
|
2009-08-07 19:11:17 +04:00
|
|
|
// Events of commands for the contents
|
|
|
|
#define NS_CONTENT_COMMAND_EVENT_START 3800
|
|
|
|
#define NS_CONTENT_COMMAND_CUT (NS_CONTENT_COMMAND_EVENT_START)
|
|
|
|
#define NS_CONTENT_COMMAND_COPY (NS_CONTENT_COMMAND_EVENT_START+1)
|
|
|
|
#define NS_CONTENT_COMMAND_PASTE (NS_CONTENT_COMMAND_EVENT_START+2)
|
|
|
|
#define NS_CONTENT_COMMAND_DELETE (NS_CONTENT_COMMAND_EVENT_START+3)
|
|
|
|
#define NS_CONTENT_COMMAND_UNDO (NS_CONTENT_COMMAND_EVENT_START+4)
|
|
|
|
#define NS_CONTENT_COMMAND_REDO (NS_CONTENT_COMMAND_EVENT_START+5)
|
2010-01-11 04:45:45 +03:00
|
|
|
#define NS_CONTENT_COMMAND_PASTE_TRANSFERABLE (NS_CONTENT_COMMAND_EVENT_START+6)
|
2010-03-11 08:25:29 +03:00
|
|
|
// NS_CONTENT_COMMAND_SCROLL scrolls the nearest scrollable element to the
|
|
|
|
// currently focused content or latest DOM selection. This would normally be
|
|
|
|
// the same element scrolled by keyboard scroll commands, except that this event
|
|
|
|
// will scroll an element scrollable in either direction. I.e., if the nearest
|
|
|
|
// scrollable ancestor element can only be scrolled vertically, and horizontal
|
|
|
|
// scrolling is requested using this event, no scrolling will occur.
|
|
|
|
#define NS_CONTENT_COMMAND_SCROLL (NS_CONTENT_COMMAND_EVENT_START+7)
|
2009-08-07 19:11:17 +04:00
|
|
|
|
2009-08-14 00:54:09 +04:00
|
|
|
// Event to gesture notification
|
|
|
|
#define NS_GESTURENOTIFY_EVENT_START 3900
|
|
|
|
|
2009-08-21 21:28:52 +04:00
|
|
|
#define NS_ORIENTATION_EVENT 4000
|
|
|
|
|
2009-09-12 03:13:56 +04:00
|
|
|
#define NS_SCROLLAREA_EVENT_START 4100
|
|
|
|
#define NS_SCROLLEDAREACHANGED (NS_SCROLLAREA_EVENT_START)
|
|
|
|
|
2009-12-23 22:10:31 +03:00
|
|
|
#define NS_TRANSITION_EVENT_START 4200
|
|
|
|
#define NS_TRANSITION_END (NS_TRANSITION_EVENT_START)
|
2009-09-12 03:13:56 +04:00
|
|
|
|
2011-04-12 10:18:44 +04:00
|
|
|
#define NS_ANIMATION_EVENT_START 4250
|
|
|
|
#define NS_ANIMATION_START (NS_ANIMATION_EVENT_START)
|
|
|
|
#define NS_ANIMATION_END (NS_ANIMATION_EVENT_START + 1)
|
|
|
|
#define NS_ANIMATION_ITERATION (NS_ANIMATION_EVENT_START + 2)
|
|
|
|
|
2010-07-31 11:02:52 +04:00
|
|
|
#define NS_SMIL_TIME_EVENT_START 4300
|
|
|
|
#define NS_SMIL_BEGIN (NS_SMIL_TIME_EVENT_START)
|
|
|
|
#define NS_SMIL_END (NS_SMIL_TIME_EVENT_START + 1)
|
|
|
|
#define NS_SMIL_REPEAT (NS_SMIL_TIME_EVENT_START + 2)
|
|
|
|
|
2010-08-02 17:34:54 +04:00
|
|
|
#define NS_MOZTOUCH_EVENT_START 4400
|
|
|
|
#define NS_MOZTOUCH_DOWN (NS_MOZTOUCH_EVENT_START)
|
|
|
|
#define NS_MOZTOUCH_MOVE (NS_MOZTOUCH_EVENT_START+1)
|
|
|
|
#define NS_MOZTOUCH_UP (NS_MOZTOUCH_EVENT_START+2)
|
|
|
|
|
2010-09-16 12:48:47 +04:00
|
|
|
// script notification events
|
2011-05-14 16:03:58 +04:00
|
|
|
#define NS_NOTIFYSCRIPT_START 4500
|
|
|
|
#define NS_BEFORE_SCRIPT_EXECUTE (NS_NOTIFYSCRIPT_START)
|
|
|
|
#define NS_AFTER_SCRIPT_EXECUTE (NS_NOTIFYSCRIPT_START+1)
|
|
|
|
|
|
|
|
#define NS_PRINT_EVENT_START 4600
|
|
|
|
#define NS_BEFOREPRINT (NS_PRINT_EVENT_START)
|
|
|
|
#define NS_AFTERPRINT (NS_PRINT_EVENT_START + 1)
|
2010-09-16 12:48:47 +04:00
|
|
|
|
2011-05-23 01:30:07 +04:00
|
|
|
#define NS_MESSAGE_EVENT_START 4700
|
|
|
|
#define NS_MESSAGE (NS_MESSAGE_EVENT_START)
|
|
|
|
|
|
|
|
// Open and close events
|
|
|
|
#define NS_OPENCLOSE_EVENT_START 4800
|
|
|
|
#define NS_OPEN (NS_OPENCLOSE_EVENT_START)
|
|
|
|
#define NS_CLOSE (NS_OPENCLOSE_EVENT_START+1)
|
|
|
|
|
2011-06-29 02:37:31 +04:00
|
|
|
// Device motion and orientation
|
|
|
|
#define NS_DEVICE_ORIENTATION_START 4900
|
|
|
|
#define NS_DEVICE_ORIENTATION (NS_DEVICE_ORIENTATION_START)
|
|
|
|
#define NS_DEVICE_MOTION (NS_DEVICE_ORIENTATION_START+1)
|
2012-05-02 20:43:45 +04:00
|
|
|
#define NS_DEVICE_PROXIMITY (NS_DEVICE_ORIENTATION_START+2)
|
2012-05-02 20:43:45 +04:00
|
|
|
#define NS_DEVICE_LIGHT (NS_DEVICE_ORIENTATION_START+3)
|
2011-06-29 02:37:31 +04:00
|
|
|
|
2011-08-08 21:31:32 +04:00
|
|
|
#define NS_SHOW_EVENT 5000
|
|
|
|
|
2011-09-05 00:40:11 +04:00
|
|
|
// Fullscreen DOM API
|
|
|
|
#define NS_FULL_SCREEN_START 5100
|
|
|
|
#define NS_FULLSCREENCHANGE (NS_FULL_SCREEN_START)
|
2011-11-02 04:02:47 +04:00
|
|
|
#define NS_FULLSCREENERROR (NS_FULL_SCREEN_START + 1)
|
2011-09-05 00:40:11 +04:00
|
|
|
|
2011-12-17 04:24:11 +04:00
|
|
|
#define NS_TOUCH_EVENT_START 5200
|
|
|
|
#define NS_TOUCH_START (NS_TOUCH_EVENT_START)
|
|
|
|
#define NS_TOUCH_MOVE (NS_TOUCH_EVENT_START+1)
|
|
|
|
#define NS_TOUCH_END (NS_TOUCH_EVENT_START+2)
|
|
|
|
#define NS_TOUCH_ENTER (NS_TOUCH_EVENT_START+3)
|
|
|
|
#define NS_TOUCH_LEAVE (NS_TOUCH_EVENT_START+4)
|
|
|
|
#define NS_TOUCH_CANCEL (NS_TOUCH_EVENT_START+5)
|
|
|
|
|
2012-04-12 01:55:21 +04:00
|
|
|
// Pointerlock DOM API
|
|
|
|
#define NS_POINTERLOCK_START 5300
|
|
|
|
#define NS_POINTERLOCKCHANGE (NS_POINTERLOCK_START)
|
|
|
|
#define NS_POINTERLOCKERROR (NS_POINTERLOCK_START + 1)
|
|
|
|
|
1998-04-14 04:31:59 +04:00
|
|
|
/**
|
2001-07-16 06:40:48 +04:00
|
|
|
* Return status for event processors, nsEventStatus, is defined in
|
|
|
|
* nsEvent.h.
|
1998-04-14 00:24:54 +04:00
|
|
|
*/
|
|
|
|
|
2000-04-02 02:08:47 +04:00
|
|
|
/**
|
|
|
|
* different types of (top-level) window z-level positioning
|
|
|
|
*/
|
|
|
|
enum nsWindowZ {
|
|
|
|
nsWindowZTop = 0, // on top
|
|
|
|
nsWindowZBottom, // on bottom
|
|
|
|
nsWindowZRelative // just below some specified widget
|
|
|
|
};
|
|
|
|
|
1998-04-14 04:31:59 +04:00
|
|
|
/**
|
1998-07-23 06:55:33 +04:00
|
|
|
* General event
|
1998-04-14 04:31:59 +04:00
|
|
|
*/
|
|
|
|
|
2005-04-29 03:48:28 +04:00
|
|
|
class nsEvent
|
|
|
|
{
|
|
|
|
protected:
|
2011-09-29 10:19:26 +04:00
|
|
|
nsEvent(bool isTrusted, PRUint32 msg, PRUint8 structType)
|
2004-01-12 11:25:18 +03:00
|
|
|
: eventStructType(structType),
|
|
|
|
message(msg),
|
2003-05-01 05:01:03 +04:00
|
|
|
refPoint(0, 0),
|
2012-04-12 01:55:21 +04:00
|
|
|
lastRefPoint(0, 0),
|
2002-03-27 09:24:55 +03:00
|
|
|
time(0),
|
2006-04-10 21:04:54 +04:00
|
|
|
flags(isTrusted ? NS_EVENT_FLAG_TRUSTED : NS_EVENT_FLAG_NONE),
|
2004-01-12 11:25:18 +03:00
|
|
|
userType(0)
|
2002-03-27 09:24:55 +03:00
|
|
|
{
|
2008-04-18 02:38:35 +04:00
|
|
|
MOZ_COUNT_CTOR(nsEvent);
|
2002-03-27 09:24:55 +03:00
|
|
|
}
|
|
|
|
|
2010-08-17 12:07:42 +04:00
|
|
|
nsEvent()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2005-04-29 03:48:28 +04:00
|
|
|
public:
|
2011-09-29 10:19:26 +04:00
|
|
|
nsEvent(bool isTrusted, PRUint32 msg)
|
2005-04-29 03:48:28 +04:00
|
|
|
: eventStructType(NS_EVENT),
|
|
|
|
message(msg),
|
|
|
|
refPoint(0, 0),
|
2012-04-12 01:55:21 +04:00
|
|
|
lastRefPoint(0, 0),
|
2005-04-29 03:48:28 +04:00
|
|
|
time(0),
|
2006-04-10 21:04:54 +04:00
|
|
|
flags(isTrusted ? NS_EVENT_FLAG_TRUSTED : NS_EVENT_FLAG_NONE),
|
2005-04-29 03:48:28 +04:00
|
|
|
userType(0)
|
|
|
|
{
|
2008-04-18 02:38:35 +04:00
|
|
|
MOZ_COUNT_CTOR(nsEvent);
|
|
|
|
}
|
|
|
|
|
|
|
|
~nsEvent()
|
|
|
|
{
|
|
|
|
MOZ_COUNT_DTOR(nsEvent);
|
2005-04-29 03:48:28 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
// See event struct types
|
1998-07-23 06:55:33 +04:00
|
|
|
PRUint8 eventStructType;
|
2005-04-29 03:48:28 +04:00
|
|
|
// See GUI MESSAGES,
|
2006-04-10 21:04:54 +04:00
|
|
|
PRUint32 message;
|
2010-06-26 01:51:17 +04:00
|
|
|
// Relative to the widget of the event, or if there is no widget then it is
|
|
|
|
// in screen coordinates. Not modified by layout code.
|
2009-01-15 06:27:09 +03:00
|
|
|
nsIntPoint refPoint;
|
2012-04-12 01:55:21 +04:00
|
|
|
// The previous refPoint, if known, used to calculate mouse movement deltas.
|
|
|
|
nsIntPoint lastRefPoint;
|
2007-01-24 01:51:38 +03:00
|
|
|
// Elapsed time, in milliseconds, from a platform-specific zero time
|
|
|
|
// to the time the message was created
|
2010-08-12 01:05:27 +04:00
|
|
|
PRUint64 time;
|
2005-04-29 03:48:28 +04:00
|
|
|
// Flags to hold event flow stage and capture/bubble cancellation
|
2006-04-10 21:04:54 +04:00
|
|
|
// status. This is used also to indicate whether the event is trusted.
|
1999-07-19 23:54:34 +04:00
|
|
|
PRUint32 flags;
|
2005-04-29 03:48:28 +04:00
|
|
|
// Additional type info for user defined events
|
2006-10-06 09:24:02 +04:00
|
|
|
nsCOMPtr<nsIAtom> userType;
|
2006-03-07 20:08:51 +03:00
|
|
|
// Event targets, needed by DOM Events
|
2011-06-24 06:18:00 +04:00
|
|
|
nsCOMPtr<nsIDOMEventTarget> target;
|
|
|
|
nsCOMPtr<nsIDOMEventTarget> currentTarget;
|
|
|
|
nsCOMPtr<nsIDOMEventTarget> originalTarget;
|
1998-07-23 06:55:33 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* General graphic user interface event
|
|
|
|
*/
|
|
|
|
|
2005-04-29 03:48:28 +04:00
|
|
|
class nsGUIEvent : public nsEvent
|
2004-01-12 11:25:18 +03:00
|
|
|
{
|
2005-04-29 03:48:28 +04:00
|
|
|
protected:
|
2011-09-29 10:19:26 +04:00
|
|
|
nsGUIEvent(bool isTrusted, PRUint32 msg, nsIWidget *w, PRUint8 structType)
|
2005-04-29 03:48:28 +04:00
|
|
|
: nsEvent(isTrusted, msg, structType),
|
2009-11-11 00:55:38 +03:00
|
|
|
widget(w), pluginEvent(nsnull)
|
2005-04-29 03:48:28 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2010-08-17 12:07:42 +04:00
|
|
|
nsGUIEvent()
|
|
|
|
: pluginEvent(nsnull)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2005-04-29 03:48:28 +04:00
|
|
|
public:
|
2011-09-29 10:19:26 +04:00
|
|
|
nsGUIEvent(bool isTrusted, PRUint32 msg, nsIWidget *w)
|
2005-04-29 03:48:28 +04:00
|
|
|
: nsEvent(isTrusted, msg, NS_GUI_EVENT),
|
2009-11-11 00:55:38 +03:00
|
|
|
widget(w), pluginEvent(nsnull)
|
2004-01-12 11:25:18 +03:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Originator of the event
|
2008-10-27 23:16:23 +03:00
|
|
|
nsCOMPtr<nsIWidget> widget;
|
|
|
|
|
2009-11-11 00:55:38 +03:00
|
|
|
/// Event for NPAPI plugin
|
|
|
|
void* pluginEvent;
|
1998-04-14 00:24:54 +04:00
|
|
|
};
|
|
|
|
|
2001-11-02 07:49:07 +03:00
|
|
|
/**
|
|
|
|
* Script error event
|
|
|
|
*/
|
|
|
|
|
2005-04-29 03:48:28 +04:00
|
|
|
class nsScriptErrorEvent : public nsEvent
|
2004-01-12 11:25:18 +03:00
|
|
|
{
|
2005-04-29 03:48:28 +04:00
|
|
|
public:
|
2011-09-29 10:19:26 +04:00
|
|
|
nsScriptErrorEvent(bool isTrusted, PRUint32 msg)
|
2005-04-29 03:48:28 +04:00
|
|
|
: nsEvent(isTrusted, msg, NS_SCRIPT_ERROR_EVENT),
|
2004-01-12 11:25:18 +03:00
|
|
|
lineNr(0), errorMsg(nsnull), fileName(nsnull)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2001-11-02 07:49:07 +03:00
|
|
|
PRInt32 lineNr;
|
|
|
|
const PRUnichar* errorMsg;
|
|
|
|
const PRUnichar* fileName;
|
|
|
|
};
|
|
|
|
|
1998-04-14 04:31:59 +04:00
|
|
|
/**
|
|
|
|
* Window resize event
|
|
|
|
*/
|
|
|
|
|
2005-04-29 03:48:28 +04:00
|
|
|
class nsSizeEvent : public nsGUIEvent
|
2004-01-12 11:25:18 +03:00
|
|
|
{
|
2005-04-29 03:48:28 +04:00
|
|
|
public:
|
2011-09-29 10:19:26 +04:00
|
|
|
nsSizeEvent(bool isTrusted, PRUint32 msg, nsIWidget *w)
|
2005-04-29 03:48:28 +04:00
|
|
|
: nsGUIEvent(isTrusted, msg, w, NS_SIZE_EVENT),
|
2004-01-12 11:25:18 +03:00
|
|
|
windowSize(nsnull), mWinWidth(0), mWinHeight(0)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/// x,y width, height in pixels (client area)
|
2009-01-15 06:27:09 +03:00
|
|
|
nsIntRect *windowSize;
|
2004-01-12 11:25:18 +03:00
|
|
|
/// width of entire window (in pixels)
|
|
|
|
PRInt32 mWinWidth;
|
|
|
|
/// height of entire window (in pixels)
|
|
|
|
PRInt32 mWinHeight;
|
1998-04-14 00:24:54 +04:00
|
|
|
};
|
|
|
|
|
2000-03-09 04:54:14 +03:00
|
|
|
/**
|
|
|
|
* Window size mode event
|
|
|
|
*/
|
|
|
|
|
2005-04-29 03:48:28 +04:00
|
|
|
class nsSizeModeEvent : public nsGUIEvent
|
2004-01-12 11:25:18 +03:00
|
|
|
{
|
2005-04-29 03:48:28 +04:00
|
|
|
public:
|
2011-09-29 10:19:26 +04:00
|
|
|
nsSizeModeEvent(bool isTrusted, PRUint32 msg, nsIWidget *w)
|
2005-04-29 03:48:28 +04:00
|
|
|
: nsGUIEvent(isTrusted, msg, w, NS_SIZEMODE_EVENT),
|
2004-01-12 11:25:18 +03:00
|
|
|
mSizeMode(nsSizeMode_Normal)
|
|
|
|
{
|
|
|
|
}
|
2000-03-09 04:54:14 +03:00
|
|
|
|
2004-01-12 11:25:18 +03:00
|
|
|
nsSizeMode mSizeMode;
|
2000-03-09 04:54:14 +03:00
|
|
|
};
|
|
|
|
|
2000-04-02 02:08:47 +04:00
|
|
|
/**
|
|
|
|
* Window z-level event
|
|
|
|
*/
|
|
|
|
|
2005-04-29 03:48:28 +04:00
|
|
|
class nsZLevelEvent : public nsGUIEvent
|
2004-01-12 11:25:18 +03:00
|
|
|
{
|
2005-04-29 03:48:28 +04:00
|
|
|
public:
|
2011-09-29 10:19:26 +04:00
|
|
|
nsZLevelEvent(bool isTrusted, PRUint32 msg, nsIWidget *w)
|
2005-04-29 03:48:28 +04:00
|
|
|
: nsGUIEvent(isTrusted, msg, w, NS_ZLEVEL_EVENT),
|
2004-01-12 11:25:18 +03:00
|
|
|
mPlacement(nsWindowZTop), mReqBelow(nsnull), mActualBelow(nsnull),
|
2011-10-17 18:59:28 +04:00
|
|
|
mImmediate(false), mAdjusted(false)
|
2004-01-12 11:25:18 +03:00
|
|
|
{
|
|
|
|
}
|
2000-04-02 02:08:47 +04:00
|
|
|
|
|
|
|
nsWindowZ mPlacement;
|
|
|
|
nsIWidget *mReqBelow, // widget we request being below, if any
|
|
|
|
*mActualBelow; // widget to be below, returned by handler
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mImmediate, // handler should make changes immediately
|
2000-04-02 02:08:47 +04:00
|
|
|
mAdjusted; // handler changed placement
|
|
|
|
};
|
|
|
|
|
1998-04-14 04:31:59 +04:00
|
|
|
/**
|
|
|
|
* Window repaint event
|
|
|
|
*/
|
|
|
|
|
2005-04-29 03:48:28 +04:00
|
|
|
class nsPaintEvent : public nsGUIEvent
|
2004-01-12 11:25:18 +03:00
|
|
|
{
|
2005-04-29 03:48:28 +04:00
|
|
|
public:
|
2011-09-29 10:19:26 +04:00
|
|
|
nsPaintEvent(bool isTrusted, PRUint32 msg, nsIWidget *w)
|
2010-07-16 01:08:08 +04:00
|
|
|
: nsGUIEvent(isTrusted, msg, w, NS_PAINT_EVENT),
|
2011-12-24 07:52:24 +04:00
|
|
|
willSendDidPaint(false),
|
|
|
|
didSendWillPaint(false)
|
2004-01-12 11:25:18 +03:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2010-03-01 11:03:49 +03:00
|
|
|
// area that needs repainting
|
|
|
|
nsIntRegion region;
|
2011-09-29 10:19:26 +04:00
|
|
|
bool willSendDidPaint;
|
2011-12-24 07:52:24 +04:00
|
|
|
bool didSendWillPaint;
|
1998-04-14 00:24:54 +04:00
|
|
|
};
|
|
|
|
|
1998-04-14 04:31:59 +04:00
|
|
|
/**
|
|
|
|
* Scrollbar event
|
|
|
|
*/
|
|
|
|
|
2005-04-29 03:48:28 +04:00
|
|
|
class nsScrollbarEvent : public nsGUIEvent
|
2004-01-12 11:25:18 +03:00
|
|
|
{
|
2005-04-29 03:48:28 +04:00
|
|
|
public:
|
2011-09-29 10:19:26 +04:00
|
|
|
nsScrollbarEvent(bool isTrusted, PRUint32 msg, nsIWidget *w)
|
2005-04-29 03:48:28 +04:00
|
|
|
: nsGUIEvent(isTrusted, msg, w, NS_SCROLLBAR_EVENT),
|
2004-01-12 11:25:18 +03:00
|
|
|
position(0)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/// ranges between scrollbar 0 and (maxRange - thumbSize). See nsIScrollbar
|
|
|
|
PRUint32 position;
|
1998-04-14 00:24:54 +04:00
|
|
|
};
|
|
|
|
|
2005-04-29 03:48:28 +04:00
|
|
|
class nsScrollPortEvent : public nsGUIEvent
|
2004-01-12 11:25:18 +03:00
|
|
|
{
|
2005-04-29 03:48:28 +04:00
|
|
|
public:
|
2000-06-23 09:15:04 +04:00
|
|
|
enum orientType {
|
|
|
|
vertical = 0,
|
|
|
|
horizontal = 1,
|
|
|
|
both = 2
|
|
|
|
};
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
nsScrollPortEvent(bool isTrusted, PRUint32 msg, nsIWidget *w)
|
2005-04-29 03:48:28 +04:00
|
|
|
: nsGUIEvent(isTrusted, msg, w, NS_SCROLLPORT_EVENT),
|
2004-01-12 11:25:18 +03:00
|
|
|
orient(vertical)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2000-06-23 09:15:04 +04:00
|
|
|
orientType orient;
|
|
|
|
};
|
1998-04-17 04:16:11 +04:00
|
|
|
|
2009-09-12 03:13:56 +04:00
|
|
|
class nsScrollAreaEvent : public nsGUIEvent
|
|
|
|
{
|
|
|
|
public:
|
2011-09-29 10:19:26 +04:00
|
|
|
nsScrollAreaEvent(bool isTrusted, PRUint32 msg, nsIWidget *w)
|
2009-09-12 03:13:56 +04:00
|
|
|
: nsGUIEvent(isTrusted, msg, w, NS_SCROLLAREA_EVENT)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
nsRect mArea;
|
|
|
|
};
|
|
|
|
|
2005-04-29 03:48:28 +04:00
|
|
|
class nsInputEvent : public nsGUIEvent
|
2004-01-12 11:25:18 +03:00
|
|
|
{
|
2005-04-29 03:48:28 +04:00
|
|
|
protected:
|
2011-09-29 10:19:26 +04:00
|
|
|
nsInputEvent(bool isTrusted, PRUint32 msg, nsIWidget *w,
|
2005-04-29 03:48:28 +04:00
|
|
|
PRUint8 structType)
|
|
|
|
: nsGUIEvent(isTrusted, msg, w, structType),
|
2012-04-25 07:00:02 +04:00
|
|
|
modifiers(0)
|
2005-04-29 03:48:28 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2010-08-17 12:07:42 +04:00
|
|
|
nsInputEvent()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2005-04-29 03:48:28 +04:00
|
|
|
public:
|
2011-09-29 10:19:26 +04:00
|
|
|
nsInputEvent(bool isTrusted, PRUint32 msg, nsIWidget *w)
|
2005-04-29 03:48:28 +04:00
|
|
|
: nsGUIEvent(isTrusted, msg, w, NS_INPUT_EVENT),
|
2012-04-25 07:00:02 +04:00
|
|
|
modifiers(0)
|
2004-01-12 11:25:18 +03:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-04-25 07:00:02 +04:00
|
|
|
// true indicates the shift key is down
|
|
|
|
bool IsShift() const
|
|
|
|
{
|
|
|
|
return ((modifiers & mozilla::widget::MODIFIER_SHIFT) != 0);
|
|
|
|
}
|
|
|
|
// true indicates the control key is down
|
|
|
|
bool IsControl() const
|
|
|
|
{
|
|
|
|
return ((modifiers & mozilla::widget::MODIFIER_CONTROL) != 0);
|
|
|
|
}
|
|
|
|
// true indicates the alt key is down
|
|
|
|
bool IsAlt() const
|
|
|
|
{
|
|
|
|
return ((modifiers & mozilla::widget::MODIFIER_ALT) != 0);
|
|
|
|
}
|
|
|
|
// true indicates the meta key is down (or, on Mac, the Command key)
|
|
|
|
bool IsMeta() const
|
|
|
|
{
|
|
|
|
return ((modifiers & mozilla::widget::MODIFIER_META) != 0);
|
|
|
|
}
|
|
|
|
// true indicates the win key is down (or, on Linux, the Super or Hyper key)
|
|
|
|
bool IsWin() const
|
|
|
|
{
|
|
|
|
return ((modifiers & mozilla::widget::MODIFIER_WIN) != 0);
|
|
|
|
}
|
|
|
|
// true indicates the alt graph key is down
|
|
|
|
// NOTE: on Mac, the option key press causes both IsAlt() and IsAltGrpah()
|
|
|
|
// return true.
|
|
|
|
bool IsAltGraph() const
|
|
|
|
{
|
|
|
|
return ((modifiers & mozilla::widget::MODIFIER_ALTGRAPH) != 0);
|
|
|
|
}
|
|
|
|
// true indeicates the CapLock LED is turn on.
|
|
|
|
bool IsCapsLocked() const
|
|
|
|
{
|
|
|
|
return ((modifiers & mozilla::widget::MODIFIER_CAPSLOCK) != 0);
|
|
|
|
}
|
|
|
|
// true indeicates the NumLock LED is turn on.
|
|
|
|
bool IsNumLocked() const
|
|
|
|
{
|
|
|
|
return ((modifiers & mozilla::widget::MODIFIER_NUMLOCK) != 0);
|
|
|
|
}
|
|
|
|
// true indeicates the ScrollLock LED is turn on.
|
|
|
|
bool IsScrollLocked() const
|
|
|
|
{
|
|
|
|
return ((modifiers & mozilla::widget::MODIFIER_SCROLL) != 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
// true indeicates the Fn key is down, but this is not supported by native
|
|
|
|
// key event on any platform.
|
|
|
|
bool IsFn() const
|
|
|
|
{
|
|
|
|
return ((modifiers & mozilla::widget::MODIFIER_FN) != 0);
|
|
|
|
}
|
|
|
|
// true indeicates the ScrollLock LED is turn on.
|
|
|
|
bool IsSymbolLocked() const
|
|
|
|
{
|
|
|
|
return ((modifiers & mozilla::widget::MODIFIER_SYMBOLLOCK) != 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
void InitBasicModifiers(bool aCtrlKey,
|
|
|
|
bool aAltKey,
|
|
|
|
bool aShiftKey,
|
|
|
|
bool aMetaKey)
|
|
|
|
{
|
|
|
|
modifiers = 0;
|
|
|
|
if (aCtrlKey) {
|
|
|
|
modifiers |= mozilla::widget::MODIFIER_CONTROL;
|
|
|
|
}
|
|
|
|
if (aAltKey) {
|
|
|
|
modifiers |= mozilla::widget::MODIFIER_ALT;
|
|
|
|
}
|
|
|
|
if (aShiftKey) {
|
|
|
|
modifiers |= mozilla::widget::MODIFIER_SHIFT;
|
|
|
|
}
|
|
|
|
if (aMetaKey) {
|
|
|
|
modifiers |= mozilla::widget::MODIFIER_META;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
mozilla::widget::Modifiers modifiers;
|
1998-06-24 01:54:43 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Mouse event
|
|
|
|
*/
|
|
|
|
|
2006-11-17 00:35:39 +03:00
|
|
|
class nsMouseEvent_base : public nsInputEvent
|
2004-01-12 11:25:18 +03:00
|
|
|
{
|
2011-06-22 04:32:43 +04:00
|
|
|
private:
|
|
|
|
friend class mozilla::dom::PBrowserParent;
|
|
|
|
friend class mozilla::dom::PBrowserChild;
|
|
|
|
|
2005-04-29 03:48:28 +04:00
|
|
|
public:
|
2011-06-22 04:32:43 +04:00
|
|
|
|
|
|
|
nsMouseEvent_base()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
nsMouseEvent_base(bool isTrusted, PRUint32 msg, nsIWidget *w, PRUint8 type)
|
2012-04-25 07:00:01 +04:00
|
|
|
: nsInputEvent(isTrusted, msg, w, type), button(0), buttons(0),
|
2012-04-25 07:00:02 +04:00
|
|
|
pressure(0), inputSource(nsIDOMMouseEvent::MOZ_SOURCE_MOUSE) {}
|
2006-11-17 00:35:39 +03:00
|
|
|
|
|
|
|
/// The possible related target
|
|
|
|
nsCOMPtr<nsISupports> relatedTarget;
|
|
|
|
|
|
|
|
PRInt16 button;
|
2012-04-25 07:00:01 +04:00
|
|
|
PRInt16 buttons;
|
2012-04-25 07:00:01 +04:00
|
|
|
|
2008-12-12 02:55:15 +03:00
|
|
|
// Finger or touch pressure of event
|
|
|
|
// ranges between 0.0 and 1.0
|
|
|
|
float pressure;
|
2010-04-06 16:59:24 +04:00
|
|
|
|
2011-08-26 11:43:56 +04:00
|
|
|
// Possible values at nsIDOMMouseEvent
|
2010-04-06 16:59:24 +04:00
|
|
|
PRUint16 inputSource;
|
2006-11-17 00:35:39 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
class nsMouseEvent : public nsMouseEvent_base
|
|
|
|
{
|
2011-06-22 04:32:43 +04:00
|
|
|
private:
|
|
|
|
friend class mozilla::dom::PBrowserParent;
|
|
|
|
friend class mozilla::dom::PBrowserChild;
|
|
|
|
|
2006-11-17 00:35:39 +03:00
|
|
|
public:
|
|
|
|
enum buttonType { eLeftButton = 0, eMiddleButton = 1, eRightButton = 2 };
|
2012-04-25 07:00:01 +04:00
|
|
|
enum buttonsFlag { eLeftButtonFlag = 0x01,
|
|
|
|
eRightButtonFlag = 0x02,
|
|
|
|
eMiddleButtonFlag = 0x04,
|
|
|
|
// typicall, "back" button being left side of 5-button
|
|
|
|
// mice, see "buttons" attribute document of DOM3 Events.
|
|
|
|
e4thButtonFlag = 0x08,
|
|
|
|
// typicall, "forward" button being right side of 5-button
|
|
|
|
// mice, see "buttons" attribute document of DOM3 Events.
|
|
|
|
e5thButtonFlag = 0x10 };
|
2006-11-17 00:35:39 +03:00
|
|
|
enum reasonType { eReal, eSynthesized };
|
|
|
|
enum contextType { eNormal, eContextMenuKey };
|
2008-03-13 01:44:45 +03:00
|
|
|
enum exitType { eChild, eTopLevel };
|
2004-06-22 08:32:52 +04:00
|
|
|
|
2011-06-22 04:32:43 +04:00
|
|
|
nsMouseEvent()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-08-27 16:07:27 +04:00
|
|
|
protected:
|
2011-09-29 10:19:26 +04:00
|
|
|
nsMouseEvent(bool isTrusted, PRUint32 msg, nsIWidget *w,
|
2008-08-27 16:07:27 +04:00
|
|
|
PRUint8 structType, reasonType aReason)
|
|
|
|
: nsMouseEvent_base(isTrusted, msg, w, structType),
|
2011-10-17 18:59:28 +04:00
|
|
|
acceptActivation(false), ignoreRootScrollFrame(false),
|
2008-10-29 01:47:37 +03:00
|
|
|
reason(aReason), context(eNormal), exit(eChild), clickCount(0)
|
2008-08-27 16:07:27 +04:00
|
|
|
{
|
2011-09-18 11:45:14 +04:00
|
|
|
switch (msg) {
|
|
|
|
case NS_MOUSE_MOVE:
|
|
|
|
flags |= NS_EVENT_FLAG_CANT_CANCEL;
|
|
|
|
break;
|
|
|
|
case NS_MOUSEENTER:
|
|
|
|
case NS_MOUSELEAVE:
|
|
|
|
flags |= (NS_EVENT_FLAG_CANT_CANCEL & NS_EVENT_FLAG_CANT_BUBBLE);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
2008-08-27 16:07:27 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
nsMouseEvent(bool isTrusted, PRUint32 msg, nsIWidget *w,
|
2006-11-17 00:35:39 +03:00
|
|
|
reasonType aReason, contextType aContext = eNormal)
|
|
|
|
: nsMouseEvent_base(isTrusted, msg, w, NS_MOUSE_EVENT),
|
2011-10-17 18:59:28 +04:00
|
|
|
acceptActivation(false), ignoreRootScrollFrame(false),
|
2008-10-29 01:47:37 +03:00
|
|
|
reason(aReason), context(aContext), exit(eChild), clickCount(0)
|
2004-01-12 11:25:18 +03:00
|
|
|
{
|
2011-09-18 11:45:14 +04:00
|
|
|
switch (msg) {
|
|
|
|
case NS_MOUSE_MOVE:
|
|
|
|
flags |= NS_EVENT_FLAG_CANT_CANCEL;
|
|
|
|
break;
|
|
|
|
case NS_MOUSEENTER:
|
|
|
|
case NS_MOUSELEAVE:
|
|
|
|
flags |= (NS_EVENT_FLAG_CANT_CANCEL | NS_EVENT_FLAG_CANT_BUBBLE);
|
|
|
|
break;
|
|
|
|
case NS_CONTEXTMENU:
|
|
|
|
button = (context == eNormal) ? eRightButton : eLeftButton;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
2004-03-05 04:34:34 +03:00
|
|
|
}
|
2004-01-12 11:25:18 +03:00
|
|
|
}
|
2011-09-18 11:45:14 +04:00
|
|
|
|
2006-11-17 00:35:39 +03:00
|
|
|
#ifdef NS_DEBUG
|
|
|
|
~nsMouseEvent() {
|
2007-09-18 11:25:49 +04:00
|
|
|
NS_WARN_IF_FALSE(message != NS_CONTEXTMENU ||
|
|
|
|
button ==
|
|
|
|
((context == eNormal) ? eRightButton : eLeftButton),
|
2006-11-17 00:35:39 +03:00
|
|
|
"Wrong button set to NS_CONTEXTMENU event?");
|
|
|
|
}
|
|
|
|
#endif
|
2004-01-12 11:25:18 +03:00
|
|
|
|
|
|
|
/// Special return code for MOUSE_ACTIVATE to signal
|
|
|
|
/// if the target accepts activation (1), or denies it (0)
|
2011-09-29 10:19:26 +04:00
|
|
|
bool acceptActivation;
|
2008-10-27 23:16:23 +03:00
|
|
|
// Whether the event should ignore scroll frame bounds
|
|
|
|
// during dispatch.
|
2011-09-29 10:19:26 +04:00
|
|
|
bool ignoreRootScrollFrame;
|
2008-10-27 23:16:23 +03:00
|
|
|
|
2006-11-17 00:35:39 +03:00
|
|
|
reasonType reason : 4;
|
|
|
|
contextType context : 4;
|
2008-03-13 01:44:45 +03:00
|
|
|
exitType exit;
|
2006-11-17 00:35:39 +03:00
|
|
|
|
|
|
|
/// The number of mouse clicks
|
|
|
|
PRUint32 clickCount;
|
1998-05-08 18:54:09 +04:00
|
|
|
};
|
|
|
|
|
2008-08-27 16:07:27 +04:00
|
|
|
/**
|
|
|
|
* Drag event
|
|
|
|
*/
|
|
|
|
|
|
|
|
class nsDragEvent : public nsMouseEvent
|
|
|
|
{
|
|
|
|
public:
|
2011-09-29 10:19:26 +04:00
|
|
|
nsDragEvent(bool isTrusted, PRUint32 msg, nsIWidget *w)
|
2009-02-17 18:51:12 +03:00
|
|
|
: nsMouseEvent(isTrusted, msg, w, NS_DRAG_EVENT, eReal),
|
2011-10-17 18:59:28 +04:00
|
|
|
userCancelled(false)
|
2008-08-27 16:07:27 +04:00
|
|
|
{
|
|
|
|
if (msg == NS_DRAGDROP_EXIT_SYNTH ||
|
|
|
|
msg == NS_DRAGDROP_LEAVE_SYNTH ||
|
|
|
|
msg == NS_DRAGDROP_END) {
|
|
|
|
flags |= NS_EVENT_FLAG_CANT_CANCEL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
nsCOMPtr<nsIDOMDataTransfer> dataTransfer;
|
2011-09-29 10:19:26 +04:00
|
|
|
bool userCancelled;
|
2008-08-27 16:07:27 +04:00
|
|
|
};
|
|
|
|
|
2010-05-12 10:47:35 +04:00
|
|
|
#ifdef ACCESSIBILITY
|
2001-04-01 05:01:33 +04:00
|
|
|
/**
|
|
|
|
* Accessible event
|
|
|
|
*/
|
|
|
|
|
2005-04-29 03:48:28 +04:00
|
|
|
class nsAccessibleEvent : public nsInputEvent
|
2004-01-12 11:25:18 +03:00
|
|
|
{
|
2005-04-29 03:48:28 +04:00
|
|
|
public:
|
2011-09-29 10:19:26 +04:00
|
|
|
nsAccessibleEvent(bool isTrusted, PRUint32 msg, nsIWidget *w)
|
2005-04-29 03:48:28 +04:00
|
|
|
: nsInputEvent(isTrusted, msg, w, NS_ACCESSIBLE_EVENT),
|
2010-05-12 10:47:35 +04:00
|
|
|
mAccessible(nsnull)
|
2004-01-12 11:25:18 +03:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2010-05-12 10:47:35 +04:00
|
|
|
nsAccessible *mAccessible;
|
2001-04-01 05:01:33 +04:00
|
|
|
};
|
2010-05-12 10:47:35 +04:00
|
|
|
#endif
|
2001-04-01 05:01:33 +04:00
|
|
|
|
1998-04-14 04:31:59 +04:00
|
|
|
/**
|
|
|
|
* Keyboard event
|
|
|
|
*/
|
|
|
|
|
2008-04-15 08:16:24 +04:00
|
|
|
struct nsAlternativeCharCode {
|
|
|
|
nsAlternativeCharCode(PRUint32 aUnshiftedCharCode,
|
|
|
|
PRUint32 aShiftedCharCode) :
|
|
|
|
mUnshiftedCharCode(aUnshiftedCharCode), mShiftedCharCode(aShiftedCharCode)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
PRUint32 mUnshiftedCharCode;
|
|
|
|
PRUint32 mShiftedCharCode;
|
|
|
|
};
|
|
|
|
|
2005-04-29 03:48:28 +04:00
|
|
|
class nsKeyEvent : public nsInputEvent
|
2004-01-12 11:25:18 +03:00
|
|
|
{
|
2011-06-22 04:32:43 +04:00
|
|
|
private:
|
|
|
|
friend class mozilla::dom::PBrowserParent;
|
|
|
|
friend class mozilla::dom::PBrowserChild;
|
|
|
|
|
2005-04-29 03:48:28 +04:00
|
|
|
public:
|
2011-06-22 04:32:43 +04:00
|
|
|
nsKeyEvent()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
nsKeyEvent(bool isTrusted, PRUint32 msg, nsIWidget *w)
|
2005-04-29 03:48:28 +04:00
|
|
|
: nsInputEvent(isTrusted, msg, w, NS_KEY_EVENT),
|
2012-05-03 12:35:01 +04:00
|
|
|
keyCode(0), charCode(0),
|
|
|
|
location(nsIDOMKeyEvent::DOM_KEY_LOCATION_STANDARD), isChar(0)
|
2004-01-12 11:25:18 +03:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/// see NS_VK codes
|
|
|
|
PRUint32 keyCode;
|
|
|
|
/// OS translated Unicode char
|
|
|
|
PRUint32 charCode;
|
2012-05-03 12:35:01 +04:00
|
|
|
// One of nsIDOMKeyEvent::DOM_KEY_LOCATION_*
|
|
|
|
PRUint32 location;
|
2008-04-15 08:16:24 +04:00
|
|
|
// OS translated Unicode chars which are used for accesskey and accelkey
|
|
|
|
// handling. The handlers will try from first character to last character.
|
|
|
|
nsTArray<nsAlternativeCharCode> alternativeCharCodes;
|
2004-01-12 11:25:18 +03:00
|
|
|
// indicates whether the event signifies a printable character
|
2011-09-29 10:19:26 +04:00
|
|
|
bool isChar;
|
1998-04-14 00:24:54 +04:00
|
|
|
};
|
|
|
|
|
1998-05-18 21:55:34 +04:00
|
|
|
/**
|
1999-06-30 00:31:22 +04:00
|
|
|
* IME Related Events
|
1998-05-18 21:55:34 +04:00
|
|
|
*/
|
2009-04-23 07:27:12 +04:00
|
|
|
|
|
|
|
struct nsTextRangeStyle
|
|
|
|
{
|
|
|
|
enum {
|
2011-03-31 16:26:49 +04:00
|
|
|
LINESTYLE_NONE = NS_STYLE_TEXT_DECORATION_STYLE_NONE,
|
|
|
|
LINESTYLE_SOLID = NS_STYLE_TEXT_DECORATION_STYLE_SOLID,
|
|
|
|
LINESTYLE_DOTTED = NS_STYLE_TEXT_DECORATION_STYLE_DOTTED,
|
|
|
|
LINESTYLE_DASHED = NS_STYLE_TEXT_DECORATION_STYLE_DASHED,
|
|
|
|
LINESTYLE_DOUBLE = NS_STYLE_TEXT_DECORATION_STYLE_DOUBLE,
|
|
|
|
LINESTYLE_WAVY = NS_STYLE_TEXT_DECORATION_STYLE_WAVY
|
2009-04-23 07:27:12 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
DEFINED_NONE = 0x00,
|
|
|
|
DEFINED_LINESTYLE = 0x01,
|
|
|
|
DEFINED_FOREGROUND_COLOR = 0x02,
|
|
|
|
DEFINED_BACKGROUND_COLOR = 0x04,
|
|
|
|
DEFINED_UNDERLINE_COLOR = 0x08
|
|
|
|
};
|
|
|
|
|
|
|
|
// Initialize all members, because nsTextRange instances may be compared by
|
|
|
|
// memcomp.
|
2009-05-15 04:45:15 +04:00
|
|
|
nsTextRangeStyle()
|
2009-04-23 07:27:12 +04:00
|
|
|
{
|
2009-05-15 04:45:15 +04:00
|
|
|
Clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
void Clear()
|
|
|
|
{
|
|
|
|
mDefinedStyles = DEFINED_NONE;
|
|
|
|
mLineStyle = LINESTYLE_NONE;
|
2011-10-17 18:59:28 +04:00
|
|
|
mIsBoldLine = false;
|
2009-05-15 04:45:15 +04:00
|
|
|
mForegroundColor = mBackgroundColor = mUnderlineColor = NS_RGBA(0, 0, 0, 0);
|
2009-04-23 07:27:12 +04:00
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool IsDefined() const { return mDefinedStyles != DEFINED_NONE; }
|
2009-04-23 07:27:12 +04:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool IsLineStyleDefined() const
|
2009-04-23 07:27:12 +04:00
|
|
|
{
|
|
|
|
return (mDefinedStyles & DEFINED_LINESTYLE) != 0;
|
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool IsForegroundColorDefined() const
|
2009-04-23 07:27:12 +04:00
|
|
|
{
|
|
|
|
return (mDefinedStyles & DEFINED_FOREGROUND_COLOR) != 0;
|
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool IsBackgroundColorDefined() const
|
2009-04-23 07:27:12 +04:00
|
|
|
{
|
|
|
|
return (mDefinedStyles & DEFINED_BACKGROUND_COLOR) != 0;
|
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool IsUnderlineColorDefined() const
|
2009-04-23 07:27:12 +04:00
|
|
|
{
|
|
|
|
return (mDefinedStyles & DEFINED_UNDERLINE_COLOR) != 0;
|
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool IsNoChangeStyle() const
|
2009-05-15 04:45:15 +04:00
|
|
|
{
|
|
|
|
return !IsForegroundColorDefined() && !IsBackgroundColorDefined() &&
|
|
|
|
IsLineStyleDefined() && mLineStyle == LINESTYLE_NONE;
|
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool Equals(const nsTextRangeStyle& aOther)
|
2009-04-23 07:27:12 +04:00
|
|
|
{
|
|
|
|
if (mDefinedStyles != aOther.mDefinedStyles)
|
2011-10-17 18:59:28 +04:00
|
|
|
return false;
|
2009-04-23 07:27:12 +04:00
|
|
|
if (IsLineStyleDefined() && (mLineStyle != aOther.mLineStyle ||
|
|
|
|
!mIsBoldLine != !aOther.mIsBoldLine))
|
2011-10-17 18:59:28 +04:00
|
|
|
return false;
|
2009-04-23 07:27:12 +04:00
|
|
|
if (IsForegroundColorDefined() &&
|
|
|
|
(mForegroundColor != aOther.mForegroundColor))
|
2011-10-17 18:59:28 +04:00
|
|
|
return false;
|
2009-04-23 07:27:12 +04:00
|
|
|
if (IsBackgroundColorDefined() &&
|
|
|
|
(mBackgroundColor != aOther.mBackgroundColor))
|
2011-10-17 18:59:28 +04:00
|
|
|
return false;
|
2009-04-23 07:27:12 +04:00
|
|
|
if (IsUnderlineColorDefined() &&
|
|
|
|
(mUnderlineColor != aOther.mUnderlineColor))
|
2011-10-17 18:59:28 +04:00
|
|
|
return false;
|
|
|
|
return true;
|
2009-04-23 07:27:12 +04:00
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool operator !=(const nsTextRangeStyle &aOther)
|
2009-04-23 07:27:12 +04:00
|
|
|
{
|
|
|
|
return !Equals(aOther);
|
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool operator ==(const nsTextRangeStyle &aOther)
|
2009-04-23 07:27:12 +04:00
|
|
|
{
|
|
|
|
return Equals(aOther);
|
|
|
|
}
|
|
|
|
|
|
|
|
PRUint8 mDefinedStyles;
|
|
|
|
PRUint8 mLineStyle; // DEFINED_LINESTYLE
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mIsBoldLine; // DEFINED_LINESTYLE
|
2009-04-23 07:27:12 +04:00
|
|
|
|
|
|
|
nscolor mForegroundColor; // DEFINED_FOREGROUND_COLOR
|
|
|
|
nscolor mBackgroundColor; // DEFINED_BACKGROUND_COLOR
|
|
|
|
nscolor mUnderlineColor; // DEFINED_UNDERLINE_COLOR
|
|
|
|
};
|
|
|
|
|
2005-04-29 03:48:28 +04:00
|
|
|
struct nsTextRange
|
|
|
|
{
|
2004-01-12 11:25:18 +03:00
|
|
|
nsTextRange()
|
|
|
|
: mStartOffset(0), mEndOffset(0), mRangeType(0)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
PRUint32 mStartOffset;
|
|
|
|
PRUint32 mEndOffset;
|
|
|
|
PRUint32 mRangeType;
|
2009-04-23 07:27:12 +04:00
|
|
|
|
|
|
|
nsTextRangeStyle mRangeStyle;
|
1999-06-30 00:31:22 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef nsTextRange* nsTextRangeArray;
|
1998-05-18 21:55:34 +04:00
|
|
|
|
2005-04-29 03:48:28 +04:00
|
|
|
class nsTextEvent : public nsInputEvent
|
2004-01-12 11:25:18 +03:00
|
|
|
{
|
2010-08-17 12:07:42 +04:00
|
|
|
private:
|
|
|
|
friend class mozilla::dom::PBrowserParent;
|
|
|
|
friend class mozilla::dom::PBrowserChild;
|
2011-08-29 20:26:24 +04:00
|
|
|
friend class mozilla::plugins::PPluginInstanceChild;
|
2010-08-17 12:07:42 +04:00
|
|
|
|
|
|
|
nsTextEvent()
|
|
|
|
{
|
|
|
|
}
|
2010-10-01 18:17:37 +04:00
|
|
|
|
|
|
|
public:
|
|
|
|
PRUint32 seqno;
|
2010-08-17 12:07:42 +04:00
|
|
|
|
2005-04-29 03:48:28 +04:00
|
|
|
public:
|
2011-09-29 10:19:26 +04:00
|
|
|
nsTextEvent(bool isTrusted, PRUint32 msg, nsIWidget *w)
|
2005-04-29 03:48:28 +04:00
|
|
|
: nsInputEvent(isTrusted, msg, w, NS_TEXT_EVENT),
|
2011-10-17 18:59:28 +04:00
|
|
|
rangeCount(0), rangeArray(nsnull), isChar(false)
|
2004-01-12 11:25:18 +03:00
|
|
|
{
|
|
|
|
}
|
1999-03-20 02:36:20 +03:00
|
|
|
|
2009-02-10 23:56:51 +03:00
|
|
|
nsString theText;
|
2004-01-12 11:25:18 +03:00
|
|
|
PRUint32 rangeCount;
|
2008-12-17 11:05:44 +03:00
|
|
|
// Note that the range array may not specify a caret position; in that
|
|
|
|
// case there will be no range of type NS_TEXTRANGE_CARETPOSITION in the
|
|
|
|
// array.
|
2004-01-12 11:25:18 +03:00
|
|
|
nsTextRangeArray rangeArray;
|
2011-09-29 10:19:26 +04:00
|
|
|
bool isChar;
|
1999-05-04 02:57:48 +04:00
|
|
|
};
|
|
|
|
|
2011-09-22 13:17:40 +04:00
|
|
|
class nsCompositionEvent : public nsGUIEvent
|
2004-01-12 11:25:18 +03:00
|
|
|
{
|
2010-08-17 12:07:42 +04:00
|
|
|
private:
|
|
|
|
friend class mozilla::dom::PBrowserParent;
|
|
|
|
friend class mozilla::dom::PBrowserChild;
|
|
|
|
|
|
|
|
nsCompositionEvent()
|
|
|
|
{
|
|
|
|
}
|
2010-10-01 18:17:37 +04:00
|
|
|
|
|
|
|
public:
|
|
|
|
PRUint32 seqno;
|
2010-08-17 12:07:42 +04:00
|
|
|
|
2005-04-29 03:48:28 +04:00
|
|
|
public:
|
2011-09-29 10:19:26 +04:00
|
|
|
nsCompositionEvent(bool isTrusted, PRUint32 msg, nsIWidget *w)
|
2011-09-22 13:17:40 +04:00
|
|
|
: nsGUIEvent(isTrusted, msg, w, NS_COMPOSITION_EVENT)
|
2004-01-12 11:25:18 +03:00
|
|
|
{
|
2011-09-22 13:17:40 +04:00
|
|
|
// XXX compositionstart is cancelable in draft of DOM3 Events.
|
|
|
|
// However, it doesn't make sense for us, we cannot cancel composition
|
|
|
|
// when we send compositionstart event.
|
|
|
|
flags |= NS_EVENT_FLAG_CANT_CANCEL;
|
2004-01-12 11:25:18 +03:00
|
|
|
}
|
2011-09-22 13:17:40 +04:00
|
|
|
|
|
|
|
nsString data;
|
2004-01-12 11:25:18 +03:00
|
|
|
};
|
|
|
|
|
2008-09-17 15:27:19 +04:00
|
|
|
/* Mouse Scroll Events: Line Scrolling, Pixel Scrolling and Common Event Flows
|
|
|
|
*
|
|
|
|
* There are two common event flows:
|
|
|
|
* (1) Normal line scrolling:
|
|
|
|
* 1. An NS_MOUSE_SCROLL event without kHasPixels is dispatched to Gecko.
|
|
|
|
* 2. A DOMMouseScroll event is sent into the DOM.
|
|
|
|
* 3. A MozMousePixelScroll event is sent into the DOM.
|
|
|
|
* 4. If neither event has been consumed, the default handling of the
|
|
|
|
* NS_MOUSE_SCROLL event is executed.
|
|
|
|
*
|
|
|
|
* (2) Pixel scrolling:
|
|
|
|
* 1. An NS_MOUSE_SCROLL event with kHasPixels is dispatched to Gecko.
|
|
|
|
* 2. A DOMMouseScroll event is sent into the DOM.
|
|
|
|
* 3. No scrolling takes place in the default handler.
|
|
|
|
* 4. An NS_MOUSE_PIXEL_SCROLL event is dispatched to Gecko.
|
|
|
|
* 5. A MozMousePixelScroll event is sent into the DOM.
|
|
|
|
* 6. If neither the NS_MOUSE_PIXELSCROLL event nor the preceding
|
|
|
|
* NS_MOUSE_SCROLL event have been consumed, the default handler scrolls.
|
|
|
|
* 7. Steps 4.-6. are repeated for every pixel scroll that belongs to
|
|
|
|
* the announced line scroll. Once enough pixels have been sent to
|
|
|
|
* complete a line, a new NS_MOUSE_SCROLL event is sent (goto step 1.).
|
|
|
|
*
|
|
|
|
* If a DOMMouseScroll event has been preventDefaulted, the associated
|
|
|
|
* following MozMousePixelScroll events are still sent - they just don't result
|
|
|
|
* in any scrolling (their default handler isn't executed).
|
|
|
|
*
|
|
|
|
* How many pixel scrolls make up one line scroll is decided in the widget layer
|
|
|
|
* where the NS_MOUSE(_PIXEL)_SCROLL events are created.
|
|
|
|
*
|
|
|
|
* This event flow model satisfies several requirements:
|
|
|
|
* - DOMMouseScroll handlers don't need to be aware of the existence of pixel
|
|
|
|
* scrolling.
|
|
|
|
* - preventDefault on a DOMMouseScroll event results in no scrolling.
|
|
|
|
* - DOMMouseScroll events aren't polluted with a kHasPixels flag.
|
|
|
|
* - You can make use of pixel scroll DOM events (MozMousePixelScroll).
|
|
|
|
*/
|
|
|
|
|
2006-11-17 00:35:39 +03:00
|
|
|
class nsMouseScrollEvent : public nsMouseEvent_base
|
2004-01-12 11:25:18 +03:00
|
|
|
{
|
2011-06-22 04:32:43 +04:00
|
|
|
private:
|
|
|
|
friend class mozilla::dom::PBrowserParent;
|
|
|
|
friend class mozilla::dom::PBrowserChild;
|
|
|
|
|
|
|
|
nsMouseScrollEvent()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2005-04-29 03:48:28 +04:00
|
|
|
public:
|
2000-11-13 21:16:43 +03:00
|
|
|
enum nsMouseScrollFlags {
|
|
|
|
kIsFullPage = 1 << 0,
|
|
|
|
kIsVertical = 1 << 1,
|
2006-07-20 19:38:43 +04:00
|
|
|
kIsHorizontal = 1 << 2,
|
2009-04-02 23:34:31 +04:00
|
|
|
kHasPixels = 1 << 3, // Marks line scroll events that are provided as
|
2008-09-17 15:27:19 +04:00
|
|
|
// a fallback for pixel scroll events.
|
|
|
|
// These scroll events are used by things that can't
|
|
|
|
// be scrolled pixel-wise, like trees. You should
|
|
|
|
// ignore them when processing pixel scroll events
|
|
|
|
// to avoid double-processing the same scroll gesture.
|
|
|
|
// When kHasPixels is set, the event is guaranteed to
|
|
|
|
// be followed up by an event that contains pixel
|
|
|
|
// scrolling information.
|
2009-05-20 06:05:59 +04:00
|
|
|
kNoLines = 1 << 4, // Marks pixel scroll events that will not be
|
2009-04-02 23:34:31 +04:00
|
|
|
// followed by a line scroll events. EventStateManager
|
|
|
|
// will compute the appropriate height/width based on
|
|
|
|
// view lineHeight and generate line scroll events
|
|
|
|
// as needed.
|
2010-11-05 19:04:28 +03:00
|
|
|
kNoDefer = 1 << 5, // For scrollable views, indicates scroll should not
|
2009-05-20 06:05:59 +04:00
|
|
|
// occur asynchronously.
|
2011-05-17 04:23:23 +04:00
|
|
|
kIsMomentum = 1 << 6, // Marks scroll events that aren't controlled by the
|
2010-11-05 19:04:28 +03:00
|
|
|
// user but fire automatically as the result of a
|
|
|
|
// "momentum" scroll.
|
2012-03-26 15:34:10 +04:00
|
|
|
kAllowSmoothScroll = 1 << 7, // Allow smooth scroll for the pixel scroll
|
|
|
|
// event.
|
|
|
|
kFromLines = 1 << 8 // For a pixels scroll event, indicates that it
|
|
|
|
// originated from a lines scroll event.
|
|
|
|
// (Only used on windows which generates "faked"
|
|
|
|
// pixel scroll events even for simple mouse wheel
|
|
|
|
// scroll)
|
|
|
|
};
|
2000-11-13 21:16:43 +03:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
nsMouseScrollEvent(bool isTrusted, PRUint32 msg, nsIWidget *w)
|
2006-11-17 00:35:39 +03:00
|
|
|
: nsMouseEvent_base(isTrusted, msg, w, NS_MOUSE_SCROLL_EVENT),
|
2009-05-20 06:05:59 +04:00
|
|
|
scrollFlags(0), delta(0), scrollOverflow(0)
|
2004-01-12 11:25:18 +03:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2006-07-13 11:51:54 +04:00
|
|
|
PRInt32 scrollFlags;
|
|
|
|
PRInt32 delta;
|
2009-05-20 06:05:59 +04:00
|
|
|
PRInt32 scrollOverflow;
|
1999-11-17 09:54:02 +03:00
|
|
|
};
|
|
|
|
|
2009-08-14 00:54:09 +04:00
|
|
|
/*
|
|
|
|
* Gesture Notify Event:
|
|
|
|
*
|
|
|
|
* This event is the first event generated when the user touches
|
|
|
|
* the screen with a finger, and it's meant to decide what kind
|
|
|
|
* of action we'll use for that touch interaction.
|
|
|
|
*
|
|
|
|
* The event is dispatched to the layout and based on what is underneath
|
|
|
|
* the initial contact point it's then decided if we should pan
|
|
|
|
* (finger scrolling) or drag the target element.
|
|
|
|
*/
|
|
|
|
class nsGestureNotifyEvent : public nsGUIEvent
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
enum ePanDirection {
|
|
|
|
ePanNone,
|
|
|
|
ePanVertical,
|
|
|
|
ePanHorizontal,
|
|
|
|
ePanBoth
|
|
|
|
};
|
|
|
|
|
|
|
|
ePanDirection panDirection;
|
2011-09-29 10:19:26 +04:00
|
|
|
bool displayPanFeedback;
|
2009-08-14 00:54:09 +04:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
nsGestureNotifyEvent(bool aIsTrusted, PRUint32 aMsg, nsIWidget *aWidget):
|
2009-08-14 00:54:09 +04:00
|
|
|
nsGUIEvent(aIsTrusted, aMsg, aWidget, NS_GESTURENOTIFY_EVENT),
|
|
|
|
panDirection(ePanNone),
|
2011-10-17 18:59:28 +04:00
|
|
|
displayPanFeedback(false)
|
2009-08-14 00:54:09 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2008-02-20 10:40:04 +03:00
|
|
|
class nsQueryContentEvent : public nsGUIEvent
|
|
|
|
{
|
2010-08-17 12:07:42 +04:00
|
|
|
private:
|
|
|
|
friend class mozilla::dom::PBrowserParent;
|
|
|
|
friend class mozilla::dom::PBrowserChild;
|
|
|
|
|
|
|
|
nsQueryContentEvent()
|
|
|
|
{
|
|
|
|
mReply.mContentsRoot = nsnull;
|
|
|
|
mReply.mFocusedWidget = nsnull;
|
|
|
|
}
|
|
|
|
|
2008-02-20 10:40:04 +03:00
|
|
|
public:
|
2011-09-29 10:19:26 +04:00
|
|
|
nsQueryContentEvent(bool aIsTrusted, PRUint32 aMsg, nsIWidget *aWidget) :
|
2008-02-20 10:40:04 +03:00
|
|
|
nsGUIEvent(aIsTrusted, aMsg, aWidget, NS_QUERY_CONTENT_EVENT),
|
2011-10-17 18:59:28 +04:00
|
|
|
mSucceeded(false), mWasAsync(false)
|
2008-02-20 10:40:04 +03:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void InitForQueryTextContent(PRUint32 aOffset, PRUint32 aLength)
|
|
|
|
{
|
|
|
|
NS_ASSERTION(message == NS_QUERY_TEXT_CONTENT,
|
|
|
|
"wrong initializer is called");
|
|
|
|
mInput.mOffset = aOffset;
|
|
|
|
mInput.mLength = aLength;
|
|
|
|
}
|
|
|
|
|
2009-02-10 23:56:51 +03:00
|
|
|
void InitForQueryCaretRect(PRUint32 aOffset)
|
2008-02-20 10:40:04 +03:00
|
|
|
{
|
2009-02-10 23:56:51 +03:00
|
|
|
NS_ASSERTION(message == NS_QUERY_CARET_RECT,
|
2008-02-20 10:40:04 +03:00
|
|
|
"wrong initializer is called");
|
|
|
|
mInput.mOffset = aOffset;
|
|
|
|
}
|
|
|
|
|
2009-02-10 23:56:51 +03:00
|
|
|
void InitForQueryTextRect(PRUint32 aOffset, PRUint32 aLength)
|
2008-02-20 10:40:04 +03:00
|
|
|
{
|
2009-02-10 23:56:51 +03:00
|
|
|
NS_ASSERTION(message == NS_QUERY_TEXT_RECT,
|
2008-02-20 10:40:04 +03:00
|
|
|
"wrong initializer is called");
|
|
|
|
mInput.mOffset = aOffset;
|
2009-02-10 23:56:51 +03:00
|
|
|
mInput.mLength = aLength;
|
2008-02-20 10:40:04 +03:00
|
|
|
}
|
|
|
|
|
2011-03-02 00:15:23 +03:00
|
|
|
void InitForQueryDOMWidgetHittest(nsIntPoint& aPoint)
|
|
|
|
{
|
|
|
|
NS_ASSERTION(message == NS_QUERY_DOM_WIDGET_HITTEST,
|
|
|
|
"wrong initializer is called");
|
|
|
|
refPoint = aPoint;
|
|
|
|
}
|
|
|
|
|
2011-05-17 04:23:23 +04:00
|
|
|
void InitForQueryScrollTargetInfo(nsMouseScrollEvent* aEvent)
|
|
|
|
{
|
|
|
|
NS_ASSERTION(message == NS_QUERY_SCROLL_TARGET_INFO,
|
|
|
|
"wrong initializer is called");
|
|
|
|
mInput.mMouseScrollEvent = aEvent;
|
|
|
|
}
|
|
|
|
|
2010-08-17 12:07:45 +04:00
|
|
|
PRUint32 GetSelectionStart(void) const
|
|
|
|
{
|
|
|
|
NS_ASSERTION(message == NS_QUERY_SELECTED_TEXT,
|
|
|
|
"not querying selection");
|
|
|
|
return mReply.mOffset + (mReply.mReversed ? mReply.mString.Length() : 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
PRUint32 GetSelectionEnd(void) const
|
|
|
|
{
|
|
|
|
NS_ASSERTION(message == NS_QUERY_SELECTED_TEXT,
|
|
|
|
"not querying selection");
|
|
|
|
return mReply.mOffset + (mReply.mReversed ? 0 : mReply.mString.Length());
|
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mSucceeded;
|
|
|
|
bool mWasAsync;
|
2008-02-20 10:40:04 +03:00
|
|
|
struct {
|
|
|
|
PRUint32 mOffset;
|
|
|
|
PRUint32 mLength;
|
2011-05-17 04:23:23 +04:00
|
|
|
// used by NS_QUERY_SCROLL_TARGET_INFO
|
|
|
|
nsMouseScrollEvent* mMouseScrollEvent;
|
2008-02-20 10:40:04 +03:00
|
|
|
} mInput;
|
|
|
|
struct {
|
|
|
|
void* mContentsRoot;
|
|
|
|
PRUint32 mOffset;
|
|
|
|
nsString mString;
|
2009-01-15 06:27:09 +03:00
|
|
|
nsIntRect mRect; // Finally, the coordinates is system coordinates.
|
2008-08-11 12:27:59 +04:00
|
|
|
// The return widget has the caret. This is set at all query events.
|
|
|
|
nsIWidget* mFocusedWidget;
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mReversed; // true if selection is reversed (end < start)
|
|
|
|
bool mHasSelection; // true if the selection exists
|
|
|
|
bool mWidgetIsHit; // true if DOM element under mouse belongs to widget
|
2009-03-18 05:04:01 +03:00
|
|
|
// used by NS_QUERY_SELECTION_AS_TRANSFERABLE
|
|
|
|
nsCOMPtr<nsITransferable> mTransferable;
|
2011-05-17 04:23:23 +04:00
|
|
|
// used by NS_QUERY_SCROLL_TARGET_INFO
|
|
|
|
PRInt32 mLineHeight;
|
|
|
|
PRInt32 mPageWidth;
|
|
|
|
PRInt32 mPageHeight;
|
2011-05-23 18:56:59 +04:00
|
|
|
// used by NS_QUERY_SCROLL_TARGET_INFO
|
|
|
|
// the mouse wheel scrolling amount may be overridden by prefs or
|
|
|
|
// overriding system scrolling speed mechanism.
|
|
|
|
// If mMouseScrollEvent is a line scroll event, the unit of this value is
|
|
|
|
// line. If mMouseScrollEvent is a page scroll event, the unit of this
|
|
|
|
// value is page.
|
|
|
|
PRInt32 mComputedScrollAmount;
|
2011-07-15 02:12:20 +04:00
|
|
|
PRInt32 mComputedScrollAction;
|
2008-02-20 10:40:04 +03:00
|
|
|
} mReply;
|
2009-05-15 04:46:24 +04:00
|
|
|
|
|
|
|
enum {
|
|
|
|
NOT_FOUND = PR_UINT32_MAX
|
|
|
|
};
|
2011-07-15 02:12:20 +04:00
|
|
|
|
|
|
|
// values of mComputedScrollAction
|
|
|
|
enum {
|
|
|
|
SCROLL_ACTION_NONE,
|
|
|
|
SCROLL_ACTION_LINE,
|
|
|
|
SCROLL_ACTION_PAGE
|
|
|
|
};
|
2008-02-20 10:40:04 +03:00
|
|
|
};
|
|
|
|
|
2009-10-01 21:53:10 +04:00
|
|
|
class nsFocusEvent : public nsEvent
|
|
|
|
{
|
|
|
|
public:
|
2011-09-29 10:19:26 +04:00
|
|
|
nsFocusEvent(bool isTrusted, PRUint32 msg)
|
2009-10-01 21:53:10 +04:00
|
|
|
: nsEvent(isTrusted, msg, NS_FOCUS_EVENT),
|
2011-10-17 18:59:28 +04:00
|
|
|
fromRaise(false),
|
|
|
|
isRefocus(false)
|
2009-10-01 21:53:10 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool fromRaise;
|
|
|
|
bool isRefocus;
|
2009-10-01 21:53:10 +04:00
|
|
|
};
|
|
|
|
|
2009-02-10 23:56:51 +03:00
|
|
|
class nsSelectionEvent : public nsGUIEvent
|
|
|
|
{
|
2010-08-17 12:07:42 +04:00
|
|
|
private:
|
|
|
|
friend class mozilla::dom::PBrowserParent;
|
|
|
|
friend class mozilla::dom::PBrowserChild;
|
|
|
|
|
|
|
|
nsSelectionEvent()
|
|
|
|
{
|
|
|
|
}
|
2010-10-01 18:17:37 +04:00
|
|
|
|
|
|
|
public:
|
|
|
|
PRUint32 seqno;
|
2010-08-17 12:07:42 +04:00
|
|
|
|
2009-02-10 23:56:51 +03:00
|
|
|
public:
|
2011-09-29 10:19:26 +04:00
|
|
|
nsSelectionEvent(bool aIsTrusted, PRUint32 aMsg, nsIWidget *aWidget) :
|
2009-02-10 23:56:51 +03:00
|
|
|
nsGUIEvent(aIsTrusted, aMsg, aWidget, NS_SELECTION_EVENT),
|
2011-10-17 18:59:28 +04:00
|
|
|
mExpandToClusterBoundary(true), mSucceeded(false)
|
2009-02-10 23:56:51 +03:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
PRUint32 mOffset; // start offset of selection
|
|
|
|
PRUint32 mLength; // length of selection
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mReversed; // selection "anchor" should be in front
|
|
|
|
bool mExpandToClusterBoundary; // cluster-based or character-based
|
|
|
|
bool mSucceeded;
|
2009-02-10 23:56:51 +03:00
|
|
|
};
|
|
|
|
|
2009-08-07 19:11:17 +04:00
|
|
|
class nsContentCommandEvent : public nsGUIEvent
|
|
|
|
{
|
|
|
|
public:
|
2011-09-29 10:19:26 +04:00
|
|
|
nsContentCommandEvent(bool aIsTrusted, PRUint32 aMsg, nsIWidget *aWidget,
|
|
|
|
bool aOnlyEnabledCheck = false) :
|
2009-08-07 19:11:17 +04:00
|
|
|
nsGUIEvent(aIsTrusted, aMsg, aWidget, NS_CONTENT_COMMAND_EVENT),
|
2011-09-29 10:19:26 +04:00
|
|
|
mOnlyEnabledCheck(bool(aOnlyEnabledCheck)),
|
2011-10-17 18:59:28 +04:00
|
|
|
mSucceeded(false), mIsEnabled(false)
|
2009-08-07 19:11:17 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2010-03-11 08:25:29 +03:00
|
|
|
// NS_CONTENT_COMMAND_PASTE_TRANSFERABLE
|
2010-01-11 04:45:45 +03:00
|
|
|
nsCOMPtr<nsITransferable> mTransferable; // [in]
|
2010-03-11 08:25:29 +03:00
|
|
|
|
|
|
|
// NS_CONTENT_COMMAND_SCROLL
|
|
|
|
// for mScroll.mUnit
|
|
|
|
enum {
|
|
|
|
eCmdScrollUnit_Line,
|
|
|
|
eCmdScrollUnit_Page,
|
|
|
|
eCmdScrollUnit_Whole
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ScrollInfo {
|
|
|
|
ScrollInfo() :
|
2011-10-17 18:59:28 +04:00
|
|
|
mAmount(0), mUnit(eCmdScrollUnit_Line), mIsHorizontal(false)
|
2010-03-11 08:25:29 +03:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
PRInt32 mAmount; // [in]
|
|
|
|
PRUint8 mUnit; // [in]
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mIsHorizontal; // [in]
|
2010-03-11 08:25:29 +03:00
|
|
|
} mScroll;
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mOnlyEnabledCheck; // [in]
|
2009-08-07 19:11:17 +04:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mSucceeded; // [out]
|
|
|
|
bool mIsEnabled; // [out]
|
2009-08-07 19:11:17 +04:00
|
|
|
};
|
|
|
|
|
2010-08-02 17:34:54 +04:00
|
|
|
class nsMozTouchEvent : public nsMouseEvent_base
|
|
|
|
{
|
|
|
|
public:
|
2011-09-29 10:19:26 +04:00
|
|
|
nsMozTouchEvent(bool isTrusted, PRUint32 msg, nsIWidget* w,
|
2010-08-02 17:34:54 +04:00
|
|
|
PRUint32 streamIdArg)
|
|
|
|
: nsMouseEvent_base(isTrusted, msg, w, NS_MOZTOUCH_EVENT),
|
|
|
|
streamId(streamIdArg)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
PRUint32 streamId;
|
|
|
|
};
|
|
|
|
|
2011-12-17 04:24:11 +04:00
|
|
|
class nsTouchEvent : public nsInputEvent
|
|
|
|
{
|
|
|
|
public:
|
2012-04-04 21:08:53 +04:00
|
|
|
nsTouchEvent(bool isTrusted, nsTouchEvent *aEvent)
|
|
|
|
: nsInputEvent(isTrusted,
|
|
|
|
aEvent->message,
|
|
|
|
aEvent->widget,
|
|
|
|
NS_TOUCH_EVENT)
|
2011-12-17 04:24:11 +04:00
|
|
|
{
|
2012-04-25 07:00:02 +04:00
|
|
|
modifiers = aEvent->modifiers;
|
2012-03-20 01:33:42 +04:00
|
|
|
time = aEvent->time;
|
2011-12-17 04:24:11 +04:00
|
|
|
touches.AppendElements(aEvent->touches);
|
|
|
|
MOZ_COUNT_CTOR(nsTouchEvent);
|
|
|
|
}
|
|
|
|
nsTouchEvent(bool isTrusted, PRUint32 msg, nsIWidget* w)
|
|
|
|
: nsInputEvent(isTrusted, msg, w, NS_TOUCH_EVENT)
|
|
|
|
{
|
|
|
|
MOZ_COUNT_CTOR(nsTouchEvent);
|
|
|
|
}
|
|
|
|
~nsTouchEvent()
|
|
|
|
{
|
|
|
|
MOZ_COUNT_DTOR(nsTouchEvent);
|
|
|
|
}
|
|
|
|
|
|
|
|
nsTArray<nsCOMPtr<nsIDOMTouch> > touches;
|
|
|
|
};
|
|
|
|
|
2001-04-17 14:02:11 +04:00
|
|
|
/**
|
|
|
|
* Form event
|
|
|
|
*
|
|
|
|
* We hold the originating form control for form submit and reset events.
|
|
|
|
* originator is a weak pointer (does not hold a strong reference).
|
|
|
|
*/
|
|
|
|
|
2005-04-29 03:48:28 +04:00
|
|
|
class nsFormEvent : public nsEvent
|
2004-01-12 11:25:18 +03:00
|
|
|
{
|
2005-04-29 03:48:28 +04:00
|
|
|
public:
|
2011-09-29 10:19:26 +04:00
|
|
|
nsFormEvent(bool isTrusted, PRUint32 msg)
|
2005-04-29 03:48:28 +04:00
|
|
|
: nsEvent(isTrusted, msg, NS_FORM_EVENT),
|
2004-01-12 11:25:18 +03:00
|
|
|
originator(nsnull)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2001-04-17 14:02:11 +04:00
|
|
|
nsIContent *originator;
|
|
|
|
};
|
|
|
|
|
2002-12-06 06:41:43 +03:00
|
|
|
/**
|
2006-12-01 14:09:53 +03:00
|
|
|
* Command event
|
2002-12-06 06:41:43 +03:00
|
|
|
*
|
2006-12-01 14:09:53 +03:00
|
|
|
* Custom commands for example from the operating system.
|
2002-12-06 06:41:43 +03:00
|
|
|
*/
|
|
|
|
|
2006-12-01 14:09:53 +03:00
|
|
|
class nsCommandEvent : public nsGUIEvent
|
2004-01-12 11:25:18 +03:00
|
|
|
{
|
2005-04-29 03:48:28 +04:00
|
|
|
public:
|
2011-09-29 10:19:26 +04:00
|
|
|
nsCommandEvent(bool isTrusted, nsIAtom* aEventType,
|
2006-12-01 14:09:53 +03:00
|
|
|
nsIAtom* aCommand, nsIWidget* w)
|
|
|
|
: nsGUIEvent(isTrusted, NS_USER_DEFINED_EVENT, w, NS_COMMAND_EVENT)
|
2004-01-12 11:25:18 +03:00
|
|
|
{
|
2006-12-01 14:09:53 +03:00
|
|
|
userType = aEventType;
|
|
|
|
command = aCommand;
|
2004-01-12 11:25:18 +03:00
|
|
|
}
|
|
|
|
|
2006-12-01 14:09:53 +03:00
|
|
|
nsCOMPtr<nsIAtom> command;
|
2002-12-06 06:41:43 +03:00
|
|
|
};
|
1999-03-10 02:50:18 +03:00
|
|
|
|
2004-05-01 03:55:16 +04:00
|
|
|
/**
|
|
|
|
* DOM UIEvent
|
|
|
|
*/
|
2005-04-29 03:48:28 +04:00
|
|
|
class nsUIEvent : public nsEvent
|
|
|
|
{
|
|
|
|
public:
|
2011-09-29 10:19:26 +04:00
|
|
|
nsUIEvent(bool isTrusted, PRUint32 msg, PRInt32 d)
|
2005-04-29 03:48:28 +04:00
|
|
|
: nsEvent(isTrusted, msg, NS_UI_EVENT),
|
2004-05-01 03:55:16 +04:00
|
|
|
detail(d)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
PRInt32 detail;
|
|
|
|
};
|
|
|
|
|
2008-10-24 00:15:20 +04:00
|
|
|
/**
|
|
|
|
* Simple gesture event
|
|
|
|
*/
|
2009-02-17 14:49:03 +03:00
|
|
|
class nsSimpleGestureEvent : public nsMouseEvent_base
|
2008-10-24 00:15:20 +04:00
|
|
|
{
|
|
|
|
public:
|
2011-09-29 10:19:26 +04:00
|
|
|
nsSimpleGestureEvent(bool isTrusted, PRUint32 msg, nsIWidget* w,
|
2008-10-24 00:15:20 +04:00
|
|
|
PRUint32 directionArg, PRFloat64 deltaArg)
|
2009-02-17 14:49:03 +03:00
|
|
|
: nsMouseEvent_base(isTrusted, msg, w, NS_SIMPLE_GESTURE_EVENT),
|
2008-10-24 00:15:20 +04:00
|
|
|
direction(directionArg), delta(deltaArg)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2011-08-11 21:42:23 +04:00
|
|
|
nsSimpleGestureEvent(const nsSimpleGestureEvent& other)
|
|
|
|
: nsMouseEvent_base((other.flags & NS_EVENT_FLAG_TRUSTED) != 0,
|
|
|
|
other.message, other.widget, NS_SIMPLE_GESTURE_EVENT),
|
|
|
|
direction(other.direction), delta(other.delta)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-10-24 00:15:20 +04:00
|
|
|
PRUint32 direction; // See nsIDOMSimpleGestureEvent for values
|
|
|
|
PRFloat64 delta; // Delta for magnify and rotate events
|
|
|
|
};
|
|
|
|
|
2009-12-23 22:10:31 +03:00
|
|
|
class nsTransitionEvent : public nsEvent
|
|
|
|
{
|
|
|
|
public:
|
2011-09-29 10:19:26 +04:00
|
|
|
nsTransitionEvent(bool isTrusted, PRUint32 msg,
|
2009-12-23 22:10:31 +03:00
|
|
|
const nsString &propertyNameArg, float elapsedTimeArg)
|
|
|
|
: nsEvent(isTrusted, msg, NS_TRANSITION_EVENT),
|
|
|
|
propertyName(propertyNameArg), elapsedTime(elapsedTimeArg)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
nsString propertyName;
|
|
|
|
float elapsedTime;
|
|
|
|
};
|
|
|
|
|
2011-04-12 10:18:44 +04:00
|
|
|
class nsAnimationEvent : public nsEvent
|
|
|
|
{
|
|
|
|
public:
|
2011-09-29 10:19:26 +04:00
|
|
|
nsAnimationEvent(bool isTrusted, PRUint32 msg,
|
2011-04-12 10:18:44 +04:00
|
|
|
const nsString &animationNameArg, float elapsedTimeArg)
|
|
|
|
: nsEvent(isTrusted, msg, NS_ANIMATION_EVENT),
|
|
|
|
animationName(animationNameArg), elapsedTime(elapsedTimeArg)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
nsString animationName;
|
|
|
|
float elapsedTime;
|
|
|
|
};
|
2009-12-23 22:10:31 +03:00
|
|
|
|
2010-04-21 18:53:42 +04:00
|
|
|
class nsUIStateChangeEvent : public nsGUIEvent
|
|
|
|
{
|
|
|
|
public:
|
2011-09-29 10:19:26 +04:00
|
|
|
nsUIStateChangeEvent(bool isTrusted, PRUint32 msg, nsIWidget* w)
|
2010-04-21 18:53:42 +04:00
|
|
|
: nsGUIEvent(isTrusted, msg, w, NS_UISTATECHANGE_EVENT),
|
|
|
|
showAccelerators(UIStateChangeType_NoChange),
|
|
|
|
showFocusRings(UIStateChangeType_NoChange)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
UIStateChangeType showAccelerators;
|
|
|
|
UIStateChangeType showFocusRings;
|
|
|
|
};
|
|
|
|
|
2011-05-11 08:52:44 +04:00
|
|
|
/**
|
|
|
|
* Native event pluginEvent for plugins.
|
|
|
|
*/
|
|
|
|
|
|
|
|
class nsPluginEvent : public nsGUIEvent
|
|
|
|
{
|
|
|
|
public:
|
2011-09-29 10:19:26 +04:00
|
|
|
nsPluginEvent(bool isTrusted, PRUint32 msg, nsIWidget *w)
|
2011-05-11 08:52:44 +04:00
|
|
|
: nsGUIEvent(isTrusted, msg, w, NS_PLUGIN_EVENT),
|
2011-10-17 18:59:28 +04:00
|
|
|
retargetToFocusedDocument(false)
|
2011-05-11 08:52:44 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
// If TRUE, this event needs to be retargeted to focused document.
|
|
|
|
// Otherwise, never retargeted.
|
|
|
|
// Defaults to false.
|
2011-09-29 10:19:26 +04:00
|
|
|
bool retargetToFocusedDocument;
|
2011-05-11 08:52:44 +04:00
|
|
|
};
|
|
|
|
|
1999-05-04 02:57:48 +04:00
|
|
|
/**
|
|
|
|
* Event status for D&D Event
|
|
|
|
*/
|
|
|
|
enum nsDragDropEventStatus {
|
2004-01-12 11:25:18 +03:00
|
|
|
/// The event is a enter
|
1999-05-04 02:57:48 +04:00
|
|
|
nsDragDropEventStatus_eDragEntered,
|
2004-01-12 11:25:18 +03:00
|
|
|
/// The event is exit
|
1999-05-04 02:57:48 +04:00
|
|
|
nsDragDropEventStatus_eDragExited,
|
2004-01-12 11:25:18 +03:00
|
|
|
/// The event is drop
|
1999-05-04 02:57:48 +04:00
|
|
|
nsDragDropEventStatus_eDrop
|
|
|
|
};
|
|
|
|
|
2001-05-17 22:37:50 +04:00
|
|
|
|
1998-08-18 07:47:24 +04:00
|
|
|
#define NS_IS_MOUSE_EVENT(evnt) \
|
2006-11-17 00:35:39 +03:00
|
|
|
(((evnt)->message == NS_MOUSE_BUTTON_DOWN) || \
|
|
|
|
((evnt)->message == NS_MOUSE_BUTTON_UP) || \
|
|
|
|
((evnt)->message == NS_MOUSE_CLICK) || \
|
|
|
|
((evnt)->message == NS_MOUSE_DOUBLECLICK) || \
|
1998-08-18 07:47:24 +04:00
|
|
|
((evnt)->message == NS_MOUSE_ENTER) || \
|
|
|
|
((evnt)->message == NS_MOUSE_EXIT) || \
|
2006-03-02 11:41:08 +03:00
|
|
|
((evnt)->message == NS_MOUSE_ACTIVATE) || \
|
2000-04-24 08:41:27 +04:00
|
|
|
((evnt)->message == NS_MOUSE_ENTER_SYNTH) || \
|
|
|
|
((evnt)->message == NS_MOUSE_EXIT_SYNTH) || \
|
2010-06-28 10:04:05 +04:00
|
|
|
((evnt)->message == NS_MOUSE_MOZHITTEST) || \
|
1998-08-18 07:47:24 +04:00
|
|
|
((evnt)->message == NS_MOUSE_MOVE))
|
|
|
|
|
2010-05-13 06:33:16 +04:00
|
|
|
#define NS_IS_MOUSE_EVENT_STRUCT(evnt) \
|
|
|
|
((evnt)->eventStructType == NS_MOUSE_EVENT || \
|
|
|
|
(evnt)->eventStructType == NS_DRAG_EVENT)
|
|
|
|
|
2006-11-17 00:35:39 +03:00
|
|
|
#define NS_IS_MOUSE_LEFT_CLICK(evnt) \
|
|
|
|
((evnt)->eventStructType == NS_MOUSE_EVENT && \
|
|
|
|
(evnt)->message == NS_MOUSE_CLICK && \
|
2007-07-08 11:08:04 +04:00
|
|
|
static_cast<nsMouseEvent*>((evnt))->button == nsMouseEvent::eLeftButton)
|
2006-11-17 00:35:39 +03:00
|
|
|
|
|
|
|
#define NS_IS_CONTEXT_MENU_KEY(evnt) \
|
|
|
|
((evnt)->eventStructType == NS_MOUSE_EVENT && \
|
|
|
|
(evnt)->message == NS_CONTEXTMENU && \
|
2007-07-08 11:08:04 +04:00
|
|
|
static_cast<nsMouseEvent*>((evnt))->context == nsMouseEvent::eContextMenuKey)
|
2006-11-17 00:35:39 +03:00
|
|
|
|
2000-06-21 07:43:40 +04:00
|
|
|
#define NS_IS_DRAG_EVENT(evnt) \
|
|
|
|
(((evnt)->message == NS_DRAGDROP_ENTER) || \
|
|
|
|
((evnt)->message == NS_DRAGDROP_OVER) || \
|
|
|
|
((evnt)->message == NS_DRAGDROP_EXIT) || \
|
2008-08-27 16:07:27 +04:00
|
|
|
((evnt)->message == NS_DRAGDROP_DRAGDROP) || \
|
2008-08-25 19:08:28 +04:00
|
|
|
((evnt)->message == NS_DRAGDROP_GESTURE) || \
|
2008-08-27 16:07:27 +04:00
|
|
|
((evnt)->message == NS_DRAGDROP_DRAG) || \
|
|
|
|
((evnt)->message == NS_DRAGDROP_END) || \
|
|
|
|
((evnt)->message == NS_DRAGDROP_START) || \
|
|
|
|
((evnt)->message == NS_DRAGDROP_DROP) || \
|
|
|
|
((evnt)->message == NS_DRAGDROP_LEAVE_SYNTH))
|
2000-06-21 07:43:40 +04:00
|
|
|
|
1998-08-18 07:47:24 +04:00
|
|
|
#define NS_IS_KEY_EVENT(evnt) \
|
|
|
|
(((evnt)->message == NS_KEY_DOWN) || \
|
1999-03-29 02:27:38 +04:00
|
|
|
((evnt)->message == NS_KEY_PRESS) || \
|
1998-08-18 07:47:24 +04:00
|
|
|
((evnt)->message == NS_KEY_UP))
|
|
|
|
|
2000-06-07 05:20:13 +04:00
|
|
|
#define NS_IS_IME_EVENT(evnt) \
|
2004-01-12 11:25:18 +03:00
|
|
|
(((evnt)->message == NS_TEXT_TEXT) || \
|
2000-06-07 05:20:13 +04:00
|
|
|
((evnt)->message == NS_COMPOSITION_START) || \
|
2011-09-22 13:17:40 +04:00
|
|
|
((evnt)->message == NS_COMPOSITION_END) || \
|
|
|
|
((evnt)->message == NS_COMPOSITION_UPDATE))
|
2000-06-07 05:20:13 +04:00
|
|
|
|
2009-10-01 21:53:10 +04:00
|
|
|
#define NS_IS_ACTIVATION_EVENT(evnt) \
|
Bug 178324, refactor focus by moving all focus handling into one place and simplifying it, add many tests, fixes many other bugs too numerous to mention in this small checkin comment, r=josh,smichaud,ere,dbaron,marco,neil,gavin,smaug,sr=smaug (CLOSED TREE)
2009-06-10 22:00:39 +04:00
|
|
|
(((evnt)->message == NS_ACTIVATE) || \
|
2002-04-15 01:45:04 +04:00
|
|
|
((evnt)->message == NS_DEACTIVATE) || \
|
2010-11-16 00:12:50 +03:00
|
|
|
((evnt)->message == NS_PLUGIN_ACTIVATE) || \
|
|
|
|
((evnt)->message == NS_PLUGIN_FOCUS))
|
2002-04-15 01:45:04 +04:00
|
|
|
|
2008-02-20 10:40:04 +03:00
|
|
|
#define NS_IS_QUERY_CONTENT_EVENT(evnt) \
|
2011-05-17 04:23:23 +04:00
|
|
|
((evnt)->eventStructType == NS_QUERY_CONTENT_EVENT)
|
2009-02-10 23:56:51 +03:00
|
|
|
|
|
|
|
#define NS_IS_SELECTION_EVENT(evnt) \
|
|
|
|
(((evnt)->message == NS_SELECTION_SET))
|
2008-02-20 10:40:04 +03:00
|
|
|
|
2009-08-07 19:11:17 +04:00
|
|
|
#define NS_IS_CONTENT_COMMAND_EVENT(evnt) \
|
2010-06-26 01:51:17 +04:00
|
|
|
((evnt)->eventStructType == NS_CONTENT_COMMAND_EVENT)
|
2009-08-07 19:11:17 +04:00
|
|
|
|
2008-12-15 06:54:54 +03:00
|
|
|
#define NS_IS_PLUGIN_EVENT(evnt) \
|
2011-05-11 08:52:44 +04:00
|
|
|
(((evnt)->message == NS_PLUGIN_INPUT_EVENT) || \
|
|
|
|
((evnt)->message == NS_PLUGIN_FOCUS_EVENT))
|
|
|
|
|
|
|
|
#define NS_IS_RETARGETED_PLUGIN_EVENT(evnt) \
|
|
|
|
(NS_IS_PLUGIN_EVENT(evnt) && \
|
|
|
|
(static_cast<nsPluginEvent*>(evnt)->retargetToFocusedDocument))
|
2008-12-15 06:54:54 +03:00
|
|
|
|
2010-04-21 10:21:46 +04:00
|
|
|
#define NS_IS_NON_RETARGETED_PLUGIN_EVENT(evnt) \
|
2011-05-11 08:52:44 +04:00
|
|
|
(NS_IS_PLUGIN_EVENT(evnt) && \
|
|
|
|
!(static_cast<nsPluginEvent*>(evnt)->retargetToFocusedDocument))
|
2010-04-21 10:21:46 +04:00
|
|
|
|
2005-04-29 03:48:28 +04:00
|
|
|
#define NS_IS_TRUSTED_EVENT(event) \
|
2006-04-10 21:04:54 +04:00
|
|
|
(((event)->flags & NS_EVENT_FLAG_TRUSTED) != 0)
|
2005-04-29 03:48:28 +04:00
|
|
|
|
2005-06-22 05:53:58 +04:00
|
|
|
// Mark an event as being dispatching.
|
|
|
|
#define NS_MARK_EVENT_DISPATCH_STARTED(event) \
|
|
|
|
(event)->flags |= NS_EVENT_FLAG_DISPATCHING;
|
|
|
|
|
|
|
|
#define NS_IS_EVENT_IN_DISPATCH(event) \
|
|
|
|
(((event)->flags & NS_EVENT_FLAG_DISPATCHING) != 0)
|
2005-04-29 03:48:28 +04:00
|
|
|
|
2005-06-22 05:53:58 +04:00
|
|
|
// Mark an event as being done dispatching.
|
|
|
|
#define NS_MARK_EVENT_DISPATCH_DONE(event) \
|
|
|
|
NS_ASSERTION(NS_IS_EVENT_IN_DISPATCH(event), \
|
|
|
|
"Event never got marked for dispatch!"); \
|
|
|
|
(event)->flags &= ~NS_EVENT_FLAG_DISPATCHING; \
|
2008-06-05 00:09:48 +04:00
|
|
|
(event)->flags |= NS_EVENT_DISPATCHED;
|
2005-04-29 03:48:28 +04:00
|
|
|
|
2009-12-17 21:42:02 +03:00
|
|
|
// Be aware the query content events and the selection events are a part of IME
|
|
|
|
// processing. So, you shouldn't use NS_IS_IME_EVENT macro directly in most
|
|
|
|
// cases, you should use NS_IS_IME_RELATED_EVENT instead.
|
|
|
|
#define NS_IS_IME_RELATED_EVENT(evnt) \
|
|
|
|
(NS_IS_IME_EVENT(evnt) || \
|
2011-05-17 04:23:23 +04:00
|
|
|
(NS_IS_QUERY_CONTENT_EVENT(evnt) && \
|
|
|
|
evnt->message != NS_QUERY_SCROLL_TARGET_INFO) || \
|
2009-12-17 21:42:02 +03:00
|
|
|
NS_IS_SELECTION_EVENT(evnt))
|
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
/*
|
2000-08-18 01:43:26 +04:00
|
|
|
* Virtual key bindings for keyboard events.
|
|
|
|
* These come from nsIDOMKeyEvent.h, which is generated from MouseKeyEvent.idl.
|
|
|
|
* Really, it would be better if we phased out the NS_VK symbols altogether
|
|
|
|
* in favor of the DOM ones, but at least this way they'll be in sync.
|
1998-04-14 00:24:54 +04:00
|
|
|
*/
|
|
|
|
|
2000-08-18 01:43:26 +04:00
|
|
|
#define NS_VK_CANCEL nsIDOMKeyEvent::DOM_VK_CANCEL
|
2007-04-12 03:44:19 +04:00
|
|
|
#define NS_VK_HELP nsIDOMKeyEvent::DOM_VK_HELP
|
2000-08-18 01:43:26 +04:00
|
|
|
#define NS_VK_BACK nsIDOMKeyEvent::DOM_VK_BACK_SPACE
|
|
|
|
#define NS_VK_TAB nsIDOMKeyEvent::DOM_VK_TAB
|
|
|
|
#define NS_VK_CLEAR nsIDOMKeyEvent::DOM_VK_CLEAR
|
|
|
|
#define NS_VK_RETURN nsIDOMKeyEvent::DOM_VK_RETURN
|
|
|
|
#define NS_VK_ENTER nsIDOMKeyEvent::DOM_VK_ENTER
|
|
|
|
#define NS_VK_SHIFT nsIDOMKeyEvent::DOM_VK_SHIFT
|
|
|
|
#define NS_VK_CONTROL nsIDOMKeyEvent::DOM_VK_CONTROL
|
|
|
|
#define NS_VK_ALT nsIDOMKeyEvent::DOM_VK_ALT
|
|
|
|
#define NS_VK_PAUSE nsIDOMKeyEvent::DOM_VK_PAUSE
|
|
|
|
#define NS_VK_CAPS_LOCK nsIDOMKeyEvent::DOM_VK_CAPS_LOCK
|
2010-07-02 06:15:15 +04:00
|
|
|
#define NS_VK_KANA nsIDOMKeyEvent::DOM_VK_KANA
|
|
|
|
#define NS_VK_HANGUL nsIDOMKeyEvent::DOM_VK_HANGUL
|
|
|
|
#define NS_VK_JUNJA nsIDOMKeyEvent::DOM_VK_JUNJA
|
|
|
|
#define NS_VK_FINAL nsIDOMKeyEvent::DOM_VK_FINAL
|
|
|
|
#define NS_VK_HANJA nsIDOMKeyEvent::DOM_VK_HANJA
|
|
|
|
#define NS_VK_KANJI nsIDOMKeyEvent::DOM_VK_KANJI
|
2000-08-18 01:43:26 +04:00
|
|
|
#define NS_VK_ESCAPE nsIDOMKeyEvent::DOM_VK_ESCAPE
|
2010-07-02 06:15:15 +04:00
|
|
|
#define NS_VK_CONVERT nsIDOMKeyEvent::DOM_VK_CONVERT
|
|
|
|
#define NS_VK_NONCONVERT nsIDOMKeyEvent::DOM_VK_NONCONVERT
|
|
|
|
#define NS_VK_ACCEPT nsIDOMKeyEvent::DOM_VK_ACCEPT
|
|
|
|
#define NS_VK_MODECHANGE nsIDOMKeyEvent::DOM_VK_MODECHANGE
|
2000-08-18 01:43:26 +04:00
|
|
|
#define NS_VK_SPACE nsIDOMKeyEvent::DOM_VK_SPACE
|
|
|
|
#define NS_VK_PAGE_UP nsIDOMKeyEvent::DOM_VK_PAGE_UP
|
|
|
|
#define NS_VK_PAGE_DOWN nsIDOMKeyEvent::DOM_VK_PAGE_DOWN
|
|
|
|
#define NS_VK_END nsIDOMKeyEvent::DOM_VK_END
|
|
|
|
#define NS_VK_HOME nsIDOMKeyEvent::DOM_VK_HOME
|
|
|
|
#define NS_VK_LEFT nsIDOMKeyEvent::DOM_VK_LEFT
|
|
|
|
#define NS_VK_UP nsIDOMKeyEvent::DOM_VK_UP
|
|
|
|
#define NS_VK_RIGHT nsIDOMKeyEvent::DOM_VK_RIGHT
|
|
|
|
#define NS_VK_DOWN nsIDOMKeyEvent::DOM_VK_DOWN
|
2010-07-02 06:15:15 +04:00
|
|
|
#define NS_VK_SELECT nsIDOMKeyEvent::DOM_VK_SELECT
|
|
|
|
#define NS_VK_PRINT nsIDOMKeyEvent::DOM_VK_PRINT
|
|
|
|
#define NS_VK_EXECUTE nsIDOMKeyEvent::DOM_VK_EXECUTE
|
2000-08-18 01:43:26 +04:00
|
|
|
#define NS_VK_PRINTSCREEN nsIDOMKeyEvent::DOM_VK_PRINTSCREEN
|
|
|
|
#define NS_VK_INSERT nsIDOMKeyEvent::DOM_VK_INSERT
|
|
|
|
#define NS_VK_DELETE nsIDOMKeyEvent::DOM_VK_DELETE
|
1998-04-14 00:24:54 +04:00
|
|
|
|
|
|
|
// NS_VK_0 - NS_VK_9 match their ascii values
|
2000-08-18 01:43:26 +04:00
|
|
|
#define NS_VK_0 nsIDOMKeyEvent::DOM_VK_0
|
|
|
|
#define NS_VK_1 nsIDOMKeyEvent::DOM_VK_1
|
|
|
|
#define NS_VK_2 nsIDOMKeyEvent::DOM_VK_2
|
|
|
|
#define NS_VK_3 nsIDOMKeyEvent::DOM_VK_3
|
|
|
|
#define NS_VK_4 nsIDOMKeyEvent::DOM_VK_4
|
|
|
|
#define NS_VK_5 nsIDOMKeyEvent::DOM_VK_5
|
|
|
|
#define NS_VK_6 nsIDOMKeyEvent::DOM_VK_6
|
|
|
|
#define NS_VK_7 nsIDOMKeyEvent::DOM_VK_7
|
|
|
|
#define NS_VK_8 nsIDOMKeyEvent::DOM_VK_8
|
|
|
|
#define NS_VK_9 nsIDOMKeyEvent::DOM_VK_9
|
|
|
|
|
|
|
|
#define NS_VK_SEMICOLON nsIDOMKeyEvent::DOM_VK_SEMICOLON
|
|
|
|
#define NS_VK_EQUALS nsIDOMKeyEvent::DOM_VK_EQUALS
|
1998-04-14 00:24:54 +04:00
|
|
|
|
|
|
|
// NS_VK_A - NS_VK_Z match their ascii values
|
2000-08-18 01:43:26 +04:00
|
|
|
#define NS_VK_A nsIDOMKeyEvent::DOM_VK_A
|
|
|
|
#define NS_VK_B nsIDOMKeyEvent::DOM_VK_B
|
|
|
|
#define NS_VK_C nsIDOMKeyEvent::DOM_VK_C
|
|
|
|
#define NS_VK_D nsIDOMKeyEvent::DOM_VK_D
|
|
|
|
#define NS_VK_E nsIDOMKeyEvent::DOM_VK_E
|
|
|
|
#define NS_VK_F nsIDOMKeyEvent::DOM_VK_F
|
|
|
|
#define NS_VK_G nsIDOMKeyEvent::DOM_VK_G
|
|
|
|
#define NS_VK_H nsIDOMKeyEvent::DOM_VK_H
|
|
|
|
#define NS_VK_I nsIDOMKeyEvent::DOM_VK_I
|
|
|
|
#define NS_VK_J nsIDOMKeyEvent::DOM_VK_J
|
|
|
|
#define NS_VK_K nsIDOMKeyEvent::DOM_VK_K
|
|
|
|
#define NS_VK_L nsIDOMKeyEvent::DOM_VK_L
|
|
|
|
#define NS_VK_M nsIDOMKeyEvent::DOM_VK_M
|
|
|
|
#define NS_VK_N nsIDOMKeyEvent::DOM_VK_N
|
|
|
|
#define NS_VK_O nsIDOMKeyEvent::DOM_VK_O
|
|
|
|
#define NS_VK_P nsIDOMKeyEvent::DOM_VK_P
|
|
|
|
#define NS_VK_Q nsIDOMKeyEvent::DOM_VK_Q
|
|
|
|
#define NS_VK_R nsIDOMKeyEvent::DOM_VK_R
|
|
|
|
#define NS_VK_S nsIDOMKeyEvent::DOM_VK_S
|
|
|
|
#define NS_VK_T nsIDOMKeyEvent::DOM_VK_T
|
|
|
|
#define NS_VK_U nsIDOMKeyEvent::DOM_VK_U
|
|
|
|
#define NS_VK_V nsIDOMKeyEvent::DOM_VK_V
|
|
|
|
#define NS_VK_W nsIDOMKeyEvent::DOM_VK_W
|
|
|
|
#define NS_VK_X nsIDOMKeyEvent::DOM_VK_X
|
|
|
|
#define NS_VK_Y nsIDOMKeyEvent::DOM_VK_Y
|
|
|
|
#define NS_VK_Z nsIDOMKeyEvent::DOM_VK_Z
|
|
|
|
|
2004-03-06 18:00:38 +03:00
|
|
|
#define NS_VK_CONTEXT_MENU nsIDOMKeyEvent::DOM_VK_CONTEXT_MENU
|
2010-07-02 06:15:15 +04:00
|
|
|
#define NS_VK_SLEEP nsIDOMKeyEvent::DOM_VK_SLEEP
|
2004-03-06 18:00:38 +03:00
|
|
|
|
2000-08-18 01:43:26 +04:00
|
|
|
#define NS_VK_NUMPAD0 nsIDOMKeyEvent::DOM_VK_NUMPAD0
|
|
|
|
#define NS_VK_NUMPAD1 nsIDOMKeyEvent::DOM_VK_NUMPAD1
|
|
|
|
#define NS_VK_NUMPAD2 nsIDOMKeyEvent::DOM_VK_NUMPAD2
|
|
|
|
#define NS_VK_NUMPAD3 nsIDOMKeyEvent::DOM_VK_NUMPAD3
|
|
|
|
#define NS_VK_NUMPAD4 nsIDOMKeyEvent::DOM_VK_NUMPAD4
|
|
|
|
#define NS_VK_NUMPAD5 nsIDOMKeyEvent::DOM_VK_NUMPAD5
|
|
|
|
#define NS_VK_NUMPAD6 nsIDOMKeyEvent::DOM_VK_NUMPAD6
|
|
|
|
#define NS_VK_NUMPAD7 nsIDOMKeyEvent::DOM_VK_NUMPAD7
|
|
|
|
#define NS_VK_NUMPAD8 nsIDOMKeyEvent::DOM_VK_NUMPAD8
|
|
|
|
#define NS_VK_NUMPAD9 nsIDOMKeyEvent::DOM_VK_NUMPAD9
|
|
|
|
#define NS_VK_MULTIPLY nsIDOMKeyEvent::DOM_VK_MULTIPLY
|
|
|
|
#define NS_VK_ADD nsIDOMKeyEvent::DOM_VK_ADD
|
|
|
|
#define NS_VK_SEPARATOR nsIDOMKeyEvent::DOM_VK_SEPARATOR
|
|
|
|
#define NS_VK_SUBTRACT nsIDOMKeyEvent::DOM_VK_SUBTRACT
|
|
|
|
#define NS_VK_DECIMAL nsIDOMKeyEvent::DOM_VK_DECIMAL
|
|
|
|
#define NS_VK_DIVIDE nsIDOMKeyEvent::DOM_VK_DIVIDE
|
|
|
|
#define NS_VK_F1 nsIDOMKeyEvent::DOM_VK_F1
|
|
|
|
#define NS_VK_F2 nsIDOMKeyEvent::DOM_VK_F2
|
|
|
|
#define NS_VK_F3 nsIDOMKeyEvent::DOM_VK_F3
|
|
|
|
#define NS_VK_F4 nsIDOMKeyEvent::DOM_VK_F4
|
|
|
|
#define NS_VK_F5 nsIDOMKeyEvent::DOM_VK_F5
|
|
|
|
#define NS_VK_F6 nsIDOMKeyEvent::DOM_VK_F6
|
|
|
|
#define NS_VK_F7 nsIDOMKeyEvent::DOM_VK_F7
|
|
|
|
#define NS_VK_F8 nsIDOMKeyEvent::DOM_VK_F8
|
|
|
|
#define NS_VK_F9 nsIDOMKeyEvent::DOM_VK_F9
|
|
|
|
#define NS_VK_F10 nsIDOMKeyEvent::DOM_VK_F10
|
|
|
|
#define NS_VK_F11 nsIDOMKeyEvent::DOM_VK_F11
|
|
|
|
#define NS_VK_F12 nsIDOMKeyEvent::DOM_VK_F12
|
|
|
|
#define NS_VK_F13 nsIDOMKeyEvent::DOM_VK_F13
|
|
|
|
#define NS_VK_F14 nsIDOMKeyEvent::DOM_VK_F14
|
|
|
|
#define NS_VK_F15 nsIDOMKeyEvent::DOM_VK_F15
|
|
|
|
#define NS_VK_F16 nsIDOMKeyEvent::DOM_VK_F16
|
|
|
|
#define NS_VK_F17 nsIDOMKeyEvent::DOM_VK_F17
|
|
|
|
#define NS_VK_F18 nsIDOMKeyEvent::DOM_VK_F18
|
|
|
|
#define NS_VK_F19 nsIDOMKeyEvent::DOM_VK_F19
|
|
|
|
#define NS_VK_F20 nsIDOMKeyEvent::DOM_VK_F20
|
|
|
|
#define NS_VK_F21 nsIDOMKeyEvent::DOM_VK_F21
|
|
|
|
#define NS_VK_F22 nsIDOMKeyEvent::DOM_VK_F22
|
|
|
|
#define NS_VK_F23 nsIDOMKeyEvent::DOM_VK_F23
|
|
|
|
#define NS_VK_F24 nsIDOMKeyEvent::DOM_VK_F24
|
|
|
|
|
|
|
|
#define NS_VK_NUM_LOCK nsIDOMKeyEvent::DOM_VK_NUM_LOCK
|
|
|
|
#define NS_VK_SCROLL_LOCK nsIDOMKeyEvent::DOM_VK_SCROLL_LOCK
|
|
|
|
|
|
|
|
#define NS_VK_COMMA nsIDOMKeyEvent::DOM_VK_COMMA
|
|
|
|
#define NS_VK_PERIOD nsIDOMKeyEvent::DOM_VK_PERIOD
|
|
|
|
#define NS_VK_SLASH nsIDOMKeyEvent::DOM_VK_SLASH
|
|
|
|
#define NS_VK_BACK_QUOTE nsIDOMKeyEvent::DOM_VK_BACK_QUOTE
|
|
|
|
#define NS_VK_OPEN_BRACKET nsIDOMKeyEvent::DOM_VK_OPEN_BRACKET
|
|
|
|
#define NS_VK_BACK_SLASH nsIDOMKeyEvent::DOM_VK_BACK_SLASH
|
|
|
|
#define NS_VK_CLOSE_BRACKET nsIDOMKeyEvent::DOM_VK_CLOSE_BRACKET
|
|
|
|
#define NS_VK_QUOTE nsIDOMKeyEvent::DOM_VK_QUOTE
|
|
|
|
|
|
|
|
#define NS_VK_META nsIDOMKeyEvent::DOM_VK_META
|
2000-08-17 04:09:16 +04:00
|
|
|
|
2008-12-17 11:05:44 +03:00
|
|
|
// IME Constants -- keep in synch with nsIPrivateTextRange.h
|
|
|
|
#define NS_TEXTRANGE_CARETPOSITION 0x01
|
|
|
|
#define NS_TEXTRANGE_RAWINPUT 0x02
|
|
|
|
#define NS_TEXTRANGE_SELECTEDRAWTEXT 0x03
|
|
|
|
#define NS_TEXTRANGE_CONVERTEDTEXT 0x04
|
|
|
|
#define NS_TEXTRANGE_SELECTEDCONVERTEDTEXT 0x05
|
1999-06-30 00:31:22 +04:00
|
|
|
|
2009-12-17 21:42:02 +03:00
|
|
|
/**
|
|
|
|
* Whether the event should be handled by the frame of the mouse cursor
|
|
|
|
* position or not. When it should be handled there (e.g., the mouse events),
|
|
|
|
* this returns TRUE.
|
|
|
|
*/
|
2011-09-29 10:19:26 +04:00
|
|
|
inline bool NS_IsEventUsingCoordinates(nsEvent* aEvent)
|
2009-08-07 19:11:17 +04:00
|
|
|
{
|
2009-12-17 21:42:02 +03:00
|
|
|
return !NS_IS_KEY_EVENT(aEvent) && !NS_IS_IME_RELATED_EVENT(aEvent) &&
|
2009-10-01 21:53:10 +04:00
|
|
|
!NS_IS_CONTEXT_MENU_KEY(aEvent) && !NS_IS_ACTIVATION_EVENT(aEvent) &&
|
2011-05-11 08:52:44 +04:00
|
|
|
!NS_IS_PLUGIN_EVENT(aEvent) &&
|
2010-04-21 10:21:46 +04:00
|
|
|
!NS_IS_CONTENT_COMMAND_EVENT(aEvent) &&
|
2009-08-07 19:11:17 +04:00
|
|
|
aEvent->eventStructType != NS_ACCESSIBLE_EVENT;
|
|
|
|
}
|
|
|
|
|
2009-12-17 21:42:02 +03:00
|
|
|
/**
|
|
|
|
* Whether the event should be handled by the focused DOM window in the
|
|
|
|
* same top level window's or not. E.g., key events, IME related events
|
|
|
|
* (including the query content events, they are used in IME transaction)
|
|
|
|
* should be handled by the (last) focused window rather than the dispatched
|
|
|
|
* window.
|
|
|
|
*
|
|
|
|
* NOTE: Even if this returns TRUE, the event isn't going to be handled by the
|
|
|
|
* application level active DOM window which is on another top level window.
|
|
|
|
* So, when the event is fired on a deactive window, the event is going to be
|
|
|
|
* handled by the last focused DOM window in the last focused window.
|
|
|
|
*/
|
2011-09-29 10:19:26 +04:00
|
|
|
inline bool NS_IsEventTargetedAtFocusedWindow(nsEvent* aEvent)
|
2009-08-07 19:11:17 +04:00
|
|
|
{
|
2009-12-28 09:26:47 +03:00
|
|
|
return NS_IS_KEY_EVENT(aEvent) || NS_IS_IME_RELATED_EVENT(aEvent) ||
|
2011-04-21 03:54:43 +04:00
|
|
|
NS_IS_CONTEXT_MENU_KEY(aEvent) ||
|
2011-05-11 08:52:44 +04:00
|
|
|
NS_IS_CONTENT_COMMAND_EVENT(aEvent) ||
|
|
|
|
NS_IS_RETARGETED_PLUGIN_EVENT(aEvent);
|
2009-08-07 19:11:17 +04:00
|
|
|
}
|
|
|
|
|
2010-06-15 09:05:37 +04:00
|
|
|
/**
|
|
|
|
* Whether the event should be handled by the focused content or not. E.g.,
|
|
|
|
* key events, IME related events and other input events which are not handled
|
|
|
|
* by the frame of the mouse cursor position.
|
|
|
|
*
|
|
|
|
* NOTE: Even if this returns TRUE, the event isn't going to be handled by the
|
|
|
|
* application level active DOM window which is on another top level window.
|
|
|
|
* So, when the event is fired on a deactive window, the event is going to be
|
|
|
|
* handled by the last focused DOM element of the last focused DOM window in
|
|
|
|
* the last focused window.
|
|
|
|
*/
|
2011-09-29 10:19:26 +04:00
|
|
|
inline bool NS_IsEventTargetedAtFocusedContent(nsEvent* aEvent)
|
2010-06-15 09:05:37 +04:00
|
|
|
{
|
|
|
|
return NS_IS_KEY_EVENT(aEvent) || NS_IS_IME_RELATED_EVENT(aEvent) ||
|
2011-05-11 08:52:44 +04:00
|
|
|
NS_IS_CONTEXT_MENU_KEY(aEvent) ||
|
|
|
|
NS_IS_RETARGETED_PLUGIN_EVENT(aEvent);
|
2010-06-15 09:05:37 +04:00
|
|
|
}
|
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
#endif // nsGUIEvent_h__
|