Bug 1882703 [wpt PR 44848] - Update wpt metadata, a=testonly
[gecko.git] / widget / headless / HeadlessClipboardData.h
blob6e9a0109e787f2f882347babeaabc3a025ba75da
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #ifndef mozilla_widget_HeadlessClipboardData_h
6 #define mozilla_widget_HeadlessClipboardData_h
8 #include "mozilla/RefPtr.h"
9 #include "nsString.h"
11 namespace mozilla {
12 namespace widget {
14 class HeadlessClipboardData final {
15 public:
16 HeadlessClipboardData() : mPlain(VoidString()), mHTML(VoidString()) {}
17 ~HeadlessClipboardData() = default;
19 // For text/plain
20 void SetText(const nsAString& aText);
21 bool HasText() const;
22 const nsAString& GetText() const;
24 // For text/html
25 void SetHTML(const nsAString& aHTML);
26 bool HasHTML() const;
27 const nsAString& GetHTML() const;
29 int32_t GetChangeCount() const;
31 // For other APIs
32 void Clear();
34 private:
35 nsString mPlain;
36 nsString mHTML;
38 int32_t mChangeCount = 0;
41 } // namespace widget
42 } // namespace mozilla
44 #endif // mozilla_widget_HeadlessClipboardData_h