1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_TextEvent_h
8 #define mozilla_dom_TextEvent_h
10 #include "mozilla/dom/UIEvent.h"
12 #include "mozilla/dom/TextEventBinding.h"
13 #include "mozilla/EventForwards.h"
17 namespace mozilla::dom
{
19 class TextEvent
: public UIEvent
{
21 TextEvent(EventTarget
* aOwner
, nsPresContext
* aPresContext
,
22 InternalLegacyTextEvent
* aEvent
);
24 NS_INLINE_DECL_REFCOUNTING_INHERITED(TextEvent
, UIEvent
)
26 virtual JSObject
* WrapObjectInternal(
27 JSContext
* aCx
, JS::Handle
<JSObject
*> aGivenProto
) override
{
28 return TextEvent_Binding::Wrap(aCx
, this, aGivenProto
);
31 void GetData(nsAString
& aData
, nsIPrincipal
& aSubjectPrincipal
) const;
32 void InitTextEvent(const nsAString
& typeArg
, bool canBubbleArg
,
33 bool cancelableArg
, nsGlobalWindowInner
* viewArg
,
34 const nsAString
& dataArg
);
37 ~TextEvent() = default;
40 } // namespace mozilla::dom
42 already_AddRefed
<mozilla::dom::TextEvent
> NS_NewDOMTextEvent(
43 mozilla::dom::EventTarget
* aOwner
, nsPresContext
* aPresContext
,
44 mozilla::InternalLegacyTextEvent
* aEvent
);
46 #endif // mozilla_dom_InputEvent_h_