Bug 1805294 [wpt PR 37463] - WebKit export of https://bugs.webkit.org/show_bug.cgi...
[gecko.git] / widget / nsBaseClipboard.h
blob90b97b7b27c8a74fdc5c68696df21db09a60c913
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 nsBaseClipboard_h__
7 #define nsBaseClipboard_h__
9 #include "mozilla/Logging.h"
10 #include "nsIClipboard.h"
11 #include "nsITransferable.h"
12 #include "nsCOMPtr.h"
14 static mozilla::LazyLogModule sWidgetClipboardLog("WidgetClipboard");
15 #define CLIPBOARD_LOG(...) \
16 MOZ_LOG(sWidgetClipboardLog, LogLevel::Debug, (__VA_ARGS__))
17 #define CLIPBOARD_LOG_ENABLED() \
18 MOZ_LOG_TEST(sWidgetClipboardLog, LogLevel::Debug)
20 class nsITransferable;
21 class nsIClipboardOwner;
22 class nsIWidget;
24 /**
25 * Native Win32 BaseClipboard wrapper
28 class nsBaseClipboard : public nsIClipboard {
29 public:
30 nsBaseClipboard();
32 // nsISupports
33 NS_DECL_ISUPPORTS
35 // nsIClipboard
36 NS_DECL_NSICLIPBOARD
38 protected:
39 virtual ~nsBaseClipboard();
41 NS_IMETHOD SetNativeClipboardData(int32_t aWhichClipboard) = 0;
42 NS_IMETHOD GetNativeClipboardData(nsITransferable* aTransferable,
43 int32_t aWhichClipboard) = 0;
45 bool mEmptyingForSetData;
46 nsCOMPtr<nsIClipboardOwner> mClipboardOwner;
47 nsCOMPtr<nsITransferable> mTransferable;
49 private:
50 bool mIgnoreEmptyNotification = false;
53 #endif // nsBaseClipboard_h__