1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef mozilla_widget_HeadlessClipboard_h
7 #define mozilla_widget_HeadlessClipboard_h
9 #include "nsBaseClipboard.h"
10 #include "nsIClipboard.h"
11 #include "mozilla/UniquePtr.h"
12 #include "HeadlessClipboardData.h"
17 class HeadlessClipboard final
: public nsBaseClipboard
{
21 NS_DECL_ISUPPORTS_INHERITED
24 ~HeadlessClipboard() = default;
26 // Implement the native clipboard behavior.
27 NS_IMETHOD
SetNativeClipboardData(nsITransferable
* aTransferable
,
28 nsIClipboardOwner
* aOwner
,
29 int32_t aWhichClipboard
) override
;
30 NS_IMETHOD
GetNativeClipboardData(nsITransferable
* aTransferable
,
31 int32_t aWhichClipboard
) override
;
32 nsresult
EmptyNativeClipboardData(int32_t aWhichClipboard
) override
;
33 mozilla::Result
<int32_t, nsresult
> GetNativeClipboardSequenceNumber(
34 int32_t aWhichClipboard
) override
;
35 mozilla::Result
<bool, nsresult
> HasNativeClipboardDataMatchingFlavors(
36 const nsTArray
<nsCString
>& aFlavorList
, int32_t aWhichClipboard
) override
;
39 UniquePtr
<HeadlessClipboardData
>
40 mClipboards
[nsIClipboard::kClipboardTypeCount
];
44 } // namespace mozilla