Molybden API
Loading...
Searching...
No Matches
clipboard_data.hpp
1// Copyright (c) 2000-2024 TeamDev. All rights reserved.
2// TeamDev PROPRIETARY and CONFIDENTIAL.
3// Use is subject to license terms.
4
5#ifndef MOLYBDEN_CLIPBOARD_DATA_HPP
6#define MOLYBDEN_CLIPBOARD_DATA_HPP
7
8#include <memory>
9#include <string>
10
11namespace molybden {
12
17 public:
21 static std::shared_ptr<ClipboardDataType> create(
22 const std::string& mime_type);
23
27 static std::shared_ptr<ClipboardDataType> plainText();
28
32 static std::shared_ptr<ClipboardDataType> html();
33
37 static std::shared_ptr<ClipboardDataType> rtf();
38
42 virtual std::string mimeType() const = 0;
43
47 bool operator==(const ClipboardDataType& other) const;
48
49 virtual ~ClipboardDataType() = default;
50};
51
56 public:
63 static std::shared_ptr<ClipboardData> create(
64 std::shared_ptr<ClipboardDataType> type,
65 const std::string& data);
66
74 static std::shared_ptr<ClipboardData> create(
75 std::shared_ptr<ClipboardDataType> type,
76 const char* data,
77 size_t length);
78
82 virtual std::shared_ptr<ClipboardDataType> type() const = 0;
83
87 virtual size_t size() const = 0;
88
92 virtual const char* data() const = 0;
93
94 virtual ~ClipboardData() = default;
95};
96
97} // namespace molybden
98
99#endif // MOLYBDEN_CLIPBOARD_DATA_HPP
Represents the system clipboard data.
Definition clipboard_data.hpp:55
virtual std::shared_ptr< ClipboardDataType > type() const =0
Returns the type of the clipboard data.
static std::shared_ptr< ClipboardData > create(std::shared_ptr< ClipboardDataType > type, const std::string &data)
Creates a new clipboard data with the given type and data.
virtual const char * data() const =0
Returns the clipboard data.
static std::shared_ptr< ClipboardData > create(std::shared_ptr< ClipboardDataType > type, const char *data, size_t length)
Creates a new clipboard data with the given type and data.
virtual size_t size() const =0
Returns the size of the clipboard data.
Represents the type of a clipboard data.
Definition clipboard_data.hpp:16
static std::shared_ptr< ClipboardDataType > create(const std::string &mime_type)
Creates a new clipboard data type for the given MIME type.
static std::shared_ptr< ClipboardDataType > plainText()
Returns the clipboard data type for plain text.
static std::shared_ptr< ClipboardDataType > rtf()
Returns the clipboard data type for Rich Text Format (RTF).
static std::shared_ptr< ClipboardDataType > html()
Returns the clipboard data type for HTML.
bool operator==(const ClipboardDataType &other) const
Returns true if the given clipboard data type is equal to this one.
virtual std::string mimeType() const =0
Returns the MIME type of the clipboard data.