Bug 1847324 - Add use counter for rewritable YouTube flash embeds r=emilio
[gecko.git] / widget / headless / HeadlessClipboard.h
blob75d7b74647871321b0ae55956e0246db8b098a09
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"
14 namespace mozilla {
15 namespace widget {
17 class HeadlessClipboard final : public nsBaseClipboard {
18 public:
19 HeadlessClipboard();
21 NS_DECL_ISUPPORTS_INHERITED
23 protected:
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;
38 private:
39 UniquePtr<HeadlessClipboardData>
40 mClipboards[nsIClipboard::kClipboardTypeCount];
43 } // namespace widget
44 } // namespace mozilla
46 #endif