2010-01-18 16:16:07 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2010-01-18 16:16:07 +00:00
|
|
|
|
|
|
|
#ifndef _nsEventShell_H_
|
|
|
|
#define _nsEventShell_H_
|
|
|
|
|
2010-08-25 02:08:28 +00:00
|
|
|
#include "AccEvent.h"
|
2010-01-18 16:16:07 +00:00
|
|
|
|
2013-05-21 16:03:33 +00:00
|
|
|
namespace mozilla {
|
|
|
|
template<typename T> class StaticRefPtr;
|
|
|
|
}
|
2010-03-17 07:10:52 +00:00
|
|
|
class nsIPersistentProperties;
|
|
|
|
|
2010-01-27 11:42:08 +00:00
|
|
|
/**
|
|
|
|
* Used for everything about events.
|
|
|
|
*/
|
2010-01-18 16:16:07 +00:00
|
|
|
class nsEventShell
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2010-01-18 16:17:01 +00:00
|
|
|
/**
|
|
|
|
* Fire the accessible event.
|
|
|
|
*/
|
2012-11-18 02:01:44 +00:00
|
|
|
static void FireEvent(mozilla::a11y::AccEvent* aEvent);
|
2010-01-18 16:17:01 +00:00
|
|
|
|
2010-01-18 16:16:07 +00:00
|
|
|
/**
|
|
|
|
* Fire accessible event of the given type for the given accessible.
|
|
|
|
*
|
|
|
|
* @param aEventType [in] the event type
|
|
|
|
* @param aAccessible [in] the event target
|
|
|
|
*/
|
2012-11-18 02:01:44 +00:00
|
|
|
static void FireEvent(uint32_t aEventType,
|
|
|
|
mozilla::a11y::Accessible* aAccessible,
|
|
|
|
mozilla::a11y::EIsFromUserInput aIsFromUserInput = mozilla::a11y::eAutoDetect);
|
2010-01-20 11:16:32 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Append 'event-from-input' object attribute if the accessible event has
|
|
|
|
* been fired just now for the given node.
|
|
|
|
*
|
|
|
|
* @param aNode [in] the DOM node
|
|
|
|
* @param aAttributes [in, out] the attributes
|
|
|
|
*/
|
2010-06-11 08:23:18 +00:00
|
|
|
static void GetEventAttributes(nsINode *aNode,
|
2010-01-20 11:16:32 +00:00
|
|
|
nsIPersistentProperties *aAttributes);
|
|
|
|
|
|
|
|
private:
|
2013-05-21 16:03:33 +00:00
|
|
|
static mozilla::StaticRefPtr<nsINode> sEventTargetNode;
|
2011-09-29 06:19:26 +00:00
|
|
|
static bool sEventFromUserInput;
|
2010-01-18 16:16:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|