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_InputEvent_h_
8 #define mozilla_dom_InputEvent_h_
10 #include "mozilla/dom/UIEvent.h"
12 #include "mozilla/dom/InputEventBinding.h"
13 #include "mozilla/dom/StaticRange.h"
14 #include "mozilla/EventForwards.h"
22 class InputEvent
: public UIEvent
{
24 InputEvent(EventTarget
* aOwner
, nsPresContext
* aPresContext
,
25 InternalEditorInputEvent
* aEvent
);
27 NS_INLINE_DECL_REFCOUNTING_INHERITED(InputEvent
, UIEvent
)
29 static already_AddRefed
<InputEvent
> Constructor(const GlobalObject
& aGlobal
,
30 const nsAString
& aType
,
31 const InputEventInit
& aParam
);
33 virtual JSObject
* WrapObjectInternal(
34 JSContext
* aCx
, JS::Handle
<JSObject
*> aGivenProto
) override
{
35 return InputEvent_Binding::Wrap(aCx
, this, aGivenProto
);
38 void GetInputType(nsAString
& aInputType
);
39 void GetData(nsAString
& aData
, CallerType aCallerType
= CallerType::System
);
40 already_AddRefed
<DataTransfer
> GetDataTransfer(
41 CallerType aCallerType
= CallerType::System
);
42 void GetTargetRanges(nsTArray
<RefPtr
<StaticRange
>>& aTargetRanges
);
46 ~InputEvent() = default;
48 // mInputTypeValue stores inputType attribute value if the instance is
49 // created by script and not initialized with known inputType value.
50 nsString mInputTypeValue
;
54 } // namespace mozilla
56 already_AddRefed
<mozilla::dom::InputEvent
> NS_NewDOMInputEvent(
57 mozilla::dom::EventTarget
* aOwner
, nsPresContext
* aPresContext
,
58 mozilla::InternalEditorInputEvent
* aEvent
);
60 #endif // mozilla_dom_InputEvent_h_