gecko-dev/accessible/base/nsEventShell.h

68 строки
2.0 KiB
C
Исходник Обычный вид История

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2012-05-21 15:12:37 +04:00
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef _nsEventShell_H_
#define _nsEventShell_H_
#include "AccEvent.h"
namespace mozilla {
template<typename T> class StaticRefPtr;
}
class nsIPersistentProperties;
/**
* Used for everything about events.
*/
class nsEventShell
{
public:
/**
* Fire the accessible event.
*/
static void FireEvent(mozilla::a11y::AccEvent* aEvent);
/**
* Fire accessible event of the given type for the given accessible.
*
* @param aEventType [in] the event type
* @param aAccessible [in] the event target
*/
static void FireEvent(uint32_t aEventType,
mozilla::a11y::Accessible* aAccessible,
mozilla::a11y::EIsFromUserInput aIsFromUserInput = mozilla::a11y::eAutoDetect);
Bug 540285 - stop explicit usage of nsAccEvent::prepareEvent, r=marcoz, davidb, ginn --HG-- rename : accessible/tests/mochitest/Makefile.in => accessible/tests/mochitest/events/Makefile.in rename : accessible/tests/mochitest/test_events_caretmove.html => accessible/tests/mochitest/events/test_caretmove.html rename : accessible/tests/mochitest/test_events_coalescence.html => accessible/tests/mochitest/events/test_coalescence.html rename : accessible/tests/mochitest/test_events_doc.html => accessible/tests/mochitest/events/test_doc.html rename : accessible/tests/mochitest/test_events_draganddrop.html => accessible/tests/mochitest/events/test_dragndrop.html rename : accessible/tests/mochitest/test_events_flush.html => accessible/tests/mochitest/events/test_flush.html rename : accessible/tests/mochitest/test_events_focus.html => accessible/tests/mochitest/events/test_focus.html rename : accessible/tests/mochitest/test_events_focus.xul => accessible/tests/mochitest/events/test_focus.xul rename : accessible/tests/mochitest/test_events_focusdoc.html => accessible/tests/mochitest/events/test_focusdoc.html rename : accessible/tests/mochitest/test_events_mutation.html => accessible/tests/mochitest/events/test_mutation.html rename : accessible/tests/mochitest/test_events_scroll.xul => accessible/tests/mochitest/events/test_scroll.xul rename : accessible/tests/mochitest/test_events_tree.xul => accessible/tests/mochitest/events/test_tree.xul rename : accessible/tests/mochitest/test_events_valuechange.html => accessible/tests/mochitest/events/test_valuechange.html
2010-01-20 14:16:32 +03:00
/**
* Fire state change event.
*/
static void FireEvent(mozilla::a11y::Accessible* aTarget, uint64_t aState,
bool aIsEnabled, bool aIsFromUserInput)
{
nsRefPtr<mozilla::a11y::AccStateChangeEvent> stateChangeEvent =
new mozilla::a11y::AccStateChangeEvent(aTarget, aState, aIsEnabled,
(aIsFromUserInput ?
mozilla::a11y::eFromUserInput :
mozilla::a11y::eNoUserInput));
FireEvent(stateChangeEvent);
}
Bug 540285 - stop explicit usage of nsAccEvent::prepareEvent, r=marcoz, davidb, ginn --HG-- rename : accessible/tests/mochitest/Makefile.in => accessible/tests/mochitest/events/Makefile.in rename : accessible/tests/mochitest/test_events_caretmove.html => accessible/tests/mochitest/events/test_caretmove.html rename : accessible/tests/mochitest/test_events_coalescence.html => accessible/tests/mochitest/events/test_coalescence.html rename : accessible/tests/mochitest/test_events_doc.html => accessible/tests/mochitest/events/test_doc.html rename : accessible/tests/mochitest/test_events_draganddrop.html => accessible/tests/mochitest/events/test_dragndrop.html rename : accessible/tests/mochitest/test_events_flush.html => accessible/tests/mochitest/events/test_flush.html rename : accessible/tests/mochitest/test_events_focus.html => accessible/tests/mochitest/events/test_focus.html rename : accessible/tests/mochitest/test_events_focus.xul => accessible/tests/mochitest/events/test_focus.xul rename : accessible/tests/mochitest/test_events_focusdoc.html => accessible/tests/mochitest/events/test_focusdoc.html rename : accessible/tests/mochitest/test_events_mutation.html => accessible/tests/mochitest/events/test_mutation.html rename : accessible/tests/mochitest/test_events_scroll.xul => accessible/tests/mochitest/events/test_scroll.xul rename : accessible/tests/mochitest/test_events_tree.xul => accessible/tests/mochitest/events/test_tree.xul rename : accessible/tests/mochitest/test_events_valuechange.html => accessible/tests/mochitest/events/test_valuechange.html
2010-01-20 14:16:32 +03: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
*/
static void GetEventAttributes(nsINode *aNode,
Bug 540285 - stop explicit usage of nsAccEvent::prepareEvent, r=marcoz, davidb, ginn --HG-- rename : accessible/tests/mochitest/Makefile.in => accessible/tests/mochitest/events/Makefile.in rename : accessible/tests/mochitest/test_events_caretmove.html => accessible/tests/mochitest/events/test_caretmove.html rename : accessible/tests/mochitest/test_events_coalescence.html => accessible/tests/mochitest/events/test_coalescence.html rename : accessible/tests/mochitest/test_events_doc.html => accessible/tests/mochitest/events/test_doc.html rename : accessible/tests/mochitest/test_events_draganddrop.html => accessible/tests/mochitest/events/test_dragndrop.html rename : accessible/tests/mochitest/test_events_flush.html => accessible/tests/mochitest/events/test_flush.html rename : accessible/tests/mochitest/test_events_focus.html => accessible/tests/mochitest/events/test_focus.html rename : accessible/tests/mochitest/test_events_focus.xul => accessible/tests/mochitest/events/test_focus.xul rename : accessible/tests/mochitest/test_events_focusdoc.html => accessible/tests/mochitest/events/test_focusdoc.html rename : accessible/tests/mochitest/test_events_mutation.html => accessible/tests/mochitest/events/test_mutation.html rename : accessible/tests/mochitest/test_events_scroll.xul => accessible/tests/mochitest/events/test_scroll.xul rename : accessible/tests/mochitest/test_events_tree.xul => accessible/tests/mochitest/events/test_tree.xul rename : accessible/tests/mochitest/test_events_valuechange.html => accessible/tests/mochitest/events/test_valuechange.html
2010-01-20 14:16:32 +03:00
nsIPersistentProperties *aAttributes);
private:
static mozilla::StaticRefPtr<nsINode> sEventTargetNode;
static bool sEventFromUserInput;
};
#endif