mousetrap v0.2.0
|
object representing the data in the systems clipboard More...
#include <clipboard.hpp>
Public Member Functions | |
Clipboard ()=delete | |
has no public constructor, use Widget::get_clipboard to create a clipboard | |
Clipboard (detail::ClipboardInternal *) | |
construct from internal | |
~Clipboard () | |
destructor | |
NativeObject | get_internal () const |
expose internal | |
operator GdkClipboard * () | |
expose as GdkClipboard \for_internal_use_only | |
bool | contains_string () const |
check if the clipboard contains a string | |
bool | contains_image () const |
check if the cliboard contains an image | |
bool | contains_file () const |
check if the clipboard contains a file, use get_string to retrieve the file path | |
bool | get_is_local () const |
check if the clipboards content was set from within the same application the widget belongs to | |
void | set_string (const std::string &string) |
override the data in the clipboard with a string | |
template<typename Function_t , typename Data_t > | |
bool | get_string (Function_t on_string_read, Data_t data) |
concurrently read the data in the clipboard. Once reading is done, on_string_read > will be called with the returned string | |
template<typename Function_t > | |
bool | get_string (Function_t on_string_read) |
concurrently read the data in the clipboard. Once reading is done, on_string_read > will be called with the returned string | |
void | set_image (const Image &image) |
override data in clipboard with an image | |
template<typename Function_t , typename Data_t > | |
bool | get_image (Function_t on_image_read, Data_t data) |
concurrently read the data in the clipboard. Once reading is done, on_string_read > will be called with the returned image | |
template<typename Function_t > | |
bool | get_image (Function_t on_image_read) |
concurrently read the data in the clipboard. Once reading is done, on_string_read > will be called with the returned image | |
void | set_file (const FileDescriptor &file) |
override data with a file | |
Protected Member Functions | |
Clipboard (const Widget *) | |
constructor from widget, usually a window | |
Friends | |
class | Widget |
object representing the data in the systems clipboard
bool mousetrap::Clipboard::contains_file | ( | ) | const |
check if the clipboard contains a file, use get_string to retrieve the file path
bool mousetrap::Clipboard::contains_image | ( | ) | const |
check if the cliboard contains an image
Referenced by get_image().
bool mousetrap::Clipboard::contains_string | ( | ) | const |
check if the clipboard contains a string
Referenced by get_string().
bool mousetrap::Clipboard::get_image | ( | Function_t | on_image_read | ) |
concurrently read the data in the clipboard. Once reading is done, on_string_read
> will be called with the returned image
on_image_read | lamdba with signature (Clipboard*, const Image&) -> void |
References contains_image().
bool mousetrap::Clipboard::get_image | ( | Function_t | on_image_read, |
Data_t | data | ||
) |
concurrently read the data in the clipboard. Once reading is done, on_string_read
> will be called with the returned image
on_image_read | lamdba with signature (Clipboard*, const Image&, Data_t) -> void |
data | arbitrary data |
References contains_image().
bool mousetrap::Clipboard::get_is_local | ( | ) | const |
check if the clipboards content was set from within the same application the widget belongs to
bool mousetrap::Clipboard::get_string | ( | Function_t | on_string_read | ) |
concurrently read the data in the clipboard. Once reading is done, on_string_read
> will be called with the returned string
on_string_read | lamdba with signature (Clipboard*, const std::string&) -> void |
References contains_string().
bool mousetrap::Clipboard::get_string | ( | Function_t | on_string_read, |
Data_t | data | ||
) |
concurrently read the data in the clipboard. Once reading is done, on_string_read
> will be called with the returned string
on_string_read | lamdba with signature (Clipboard*, const std::string&, Data_t) -> void |
data | arbitrary data |
References contains_string().
void mousetrap::Clipboard::set_file | ( | const FileDescriptor & | file | ) |
override data with a file
file |
void mousetrap::Clipboard::set_image | ( | const Image & | image | ) |
override data in clipboard with an image
image |
void mousetrap::Clipboard::set_string | ( | const std::string & | string | ) |
override the data in the clipboard with a string
string |