Backed out changeset 2450366cf7ca (bug 1891629) for causing win msix mochitest failures
[gecko.git] / dom / events / ClipboardEvent.h
blob08d96b3772850fda7817a209d4b581d13fbadc92
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_ClipboardEvent_h_
8 #define mozilla_dom_ClipboardEvent_h_
10 #include "mozilla/EventForwards.h"
11 #include "mozilla/dom/ClipboardEventBinding.h"
12 #include "mozilla/dom/Event.h"
14 namespace mozilla::dom {
15 class DataTransfer;
17 class ClipboardEvent : public Event {
18 public:
19 ClipboardEvent(EventTarget* aOwner, nsPresContext* aPresContext,
20 InternalClipboardEvent* aEvent);
22 NS_INLINE_DECL_REFCOUNTING_INHERITED(ClipboardEvent, Event)
24 virtual JSObject* WrapObjectInternal(
25 JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override {
26 return ClipboardEvent_Binding::Wrap(aCx, this, aGivenProto);
29 static already_AddRefed<ClipboardEvent> Constructor(
30 const GlobalObject& aGlobal, const nsAString& aType,
31 const ClipboardEventInit& aParam, ErrorResult& aRv);
33 DataTransfer* GetClipboardData();
35 void InitClipboardEvent(const nsAString& aType, bool aCanBubble,
36 bool aCancelable, DataTransfer* aClipboardData);
38 protected:
39 ~ClipboardEvent() = default;
42 } // namespace mozilla::dom
44 already_AddRefed<mozilla::dom::ClipboardEvent> NS_NewDOMClipboardEvent(
45 mozilla::dom::EventTarget* aOwner, nsPresContext* aPresContext,
46 mozilla::InternalClipboardEvent* aEvent);
48 #endif // mozilla_dom_ClipboardEvent_h_