Clipboard::Data

Clipboard data.

Header#include "nativeui/clipboard.h"
Namespacenamespace nu
Typeclass

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

Data(scoped_refptr<Image> image)

Create a data with type of Image.

Parameters

Data(std::vector<base::FilePath> file_paths)

Create a data with type of FilePaths.

Parameters

Methods

Clipboard::Data::Type type() const

Return the type of data.

Return

Clipboard::Data::Type

std::string str() const

Return the string content of data.

It can only be called when type is Text or HTML.

Return

std::string

Image* 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>