98 enum class Kind : uint8_t { Empty, Text, Bytes };
167 [[nodiscard]]
virtual bool Has(
const String& type)
const = 0;
189 [[nodiscard]]
virtual size_t size()
const = 0;
#define UExport
Definition Exports.h:22
virtual ClipboardData & Remove(const String &type)=0
Remove the entry for a type (does nothing if no such entry exists).
virtual String AsText() const =0
Get the text/plain entry's text (an empty string when there is none, or when that entry holds bytes).
virtual bool Has(const String &type) const =0
Whether or not an entry exists for a type.
void operator=(const ClipboardData &)
virtual void set_source_url(const String &url)=0
Set the URL of the document this payload came from.
virtual ClipboardData & Set(const String &type, const ClipboardValue &value)=0
Set the value for a type (replaces any existing entry with the same type).
virtual String AsHTML() const =0
Get the text/html entry's text (an empty string when there is none, or when that entry holds bytes).
static RefPtr< ClipboardData > Create(const String &text)
Create a payload holding a single text/plain entry.
ClipboardData(const ClipboardData &)
virtual String type_at(size_t index) const =0
Get the type of the entry at a certain index, in insertion order (an empty string when index is out o...
virtual size_t size() const =0
Get the number of entries.
virtual ClipboardValue Get(const String &type) const =0
Get the value for a type (an empty value when no such entry exists).
virtual String source_url() const =0
Get the URL of the document this payload came from (can be empty).
static RefPtr< ClipboardData > Create()
Create an empty payload.
A single clipboard value: empty, UTF-8 text, or raw bytes.
Definition ClipboardData.h:20
ClipboardValue(RefPtr< Buffer > bytes)
Create a bytes value (a null buffer creates an empty value).
ClipboardValue(const String &text)
Create a text value.
ClipboardValue(ClipboardValue &&other) noexcept
Move constructor (other becomes empty).
ClipboardValue(std::nullptr_t)
Create an empty value (lets you pass nullptr where a value is expected).
ClipboardValue & operator=(ClipboardValue &&other) noexcept
Move assignment (other becomes empty).
bool is_text() const
Whether or not this value holds text.
bool is_bytes() const
Whether or not this value holds raw bytes.
ClipboardValue(const char *text)
Create a text value from a null-terminated UTF-8 string.
bool is_empty() const
Whether or not this value is empty (neither text nor bytes).
~ClipboardValue()
Destructor.
ClipboardValue & operator=(const ClipboardValue &other)
Copy assignment.
const String & text() const
Get the text (an empty string when this value doesn't hold text).
RefPtr< Buffer > bytes() const
Get the bytes (a null pointer when this value doesn't hold bytes).
ClipboardValue(const ClipboardValue &other)
Copy constructor.
ClipboardValue()
Create an empty value.
Interface for all ref-counted objects that will be managed using the RefPtr<> smart pointer.
Definition RefPtr.h:49
A nullable smart pointer.
Definition RefPtr.h:126
Unicode string container with conversions for UTF-8, UTF-16, and UTF-32.
Definition String.h:31
Root namespace for every public Ultralight type, function, and enumeration.