Clipboard::Data
Clipboard data.
| Header | #include "nativeui/clipboard.h" |
| Namespace | namespace nu |
| Type | class |
The Clipboard::Data is a move-only type, it can not be copied. When
creating a Clipboard::Data, the arguments should be passed as r-value
reference for best performance.
Constructors
Data()
Create a null data.
This constructor is useless in userland and should not be used by users, it is only usefull when writing language bindings or libraries.
Data(Clipboard::Data::Type type, std::string str)
Create a data that contains an string.
The type can only be Text or HTML.
Parameters
Clipboard::Data::Typetypestd::stringstr
Data(scoped_refptr<Image> image)
Create a data with type of Image.
Parameters
scoped_refptr<Image>image
Data(std::vector<base::FilePath> file_paths)
Create a data with type of FilePaths.
Parameters
std::vector<base::FilePath>file_paths
Methods
Clipboard::Data::Type type() const
Return the type of data.
Return
Clipboard::Data::Typestd::string str() const
Return the string content of data.
It can only be called when type is Text or HTML.
Return
std::stringImage* image() const
Return the image content of data.
It can only be called when type is Image.
Return
Image*std::vector<base::FilePath> file_paths() const
Return the file paths content of data.
It can only be called when type is FilePaths.
Return
std::vector<base::FilePath>