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 int32_t aWhichClipboard
) override
;
29 NS_IMETHOD
GetNativeClipboardData(nsITransferable
* aTransferable
,
30 int32_t aWhichClipboard
) override
;
31 nsresult
EmptyNativeClipboardData(int32_t aWhichClipboard
) override
;
32 mozilla::Result
<int32_t, nsresult
> GetNativeClipboardSequenceNumber(
33 int32_t aWhichClipboard
) override
;
34 mozilla::Result
<bool, nsresult
> HasNativeClipboardDataMatchingFlavors(
35 const nsTArray
<nsCString
>& aFlavorList
, int32_t aWhichClipboard
) override
;
38 UniquePtr
<HeadlessClipboardData
>
39 mClipboards
[nsIClipboard::kClipboardTypeCount
];
43 } // namespace mozilla