Bug 1732219 - Add API for fetching the preview image. r=geckoview-reviewers,agi,mconley
[gecko.git] / dom / events / ClipboardEvent.h
blobf5e40348b50f869cb27997b9c47d1403a46bcf14
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 {
15 namespace dom {
16 class DataTransfer;
18 class ClipboardEvent : public Event {
19 public:
20 ClipboardEvent(EventTarget* aOwner, nsPresContext* aPresContext,
21 InternalClipboardEvent* aEvent);
23 NS_INLINE_DECL_REFCOUNTING_INHERITED(ClipboardEvent, Event)
25 virtual JSObject* WrapObjectInternal(
26 JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override {
27 return ClipboardEvent_Binding::Wrap(aCx, this, aGivenProto);
30 static already_AddRefed<ClipboardEvent> Constructor(
31 const GlobalObject& aGlobal, const nsAString& aType,
32 const ClipboardEventInit& aParam, ErrorResult& aRv);
34 DataTransfer* GetClipboardData();
36 void InitClipboardEvent(const nsAString& aType, bool aCanBubble,
37 bool aCancelable, DataTransfer* aClipboardData);
39 protected:
40 ~ClipboardEvent() = default;
43 } // namespace dom
44 } // namespace mozilla
46 already_AddRefed<mozilla::dom::ClipboardEvent> NS_NewDOMClipboardEvent(
47 mozilla::dom::EventTarget* aOwner, nsPresContext* aPresContext,
48 mozilla::InternalClipboardEvent* aEvent);
50 #endif // mozilla_dom_ClipboardEvent_h_