KiCad PCB EDA Suite
Loading...
Searching...
No Matches
clipboard.h File Reference
#include <memory>
#include <string>

Go to the source code of this file.

Functions

bool SaveClipboard (const std::string &aTextUTF8)
 Store information to the system clipboard.
 
std::string GetClipboardUTF8 ()
 Return the information currently stored in the system clipboard.
 
std::unique_ptr< wxImage > GetImageFromClipboard ()
 Get image data from the clipboard, if there is any.
 

Function Documentation

◆ GetClipboardUTF8()

std::string GetClipboardUTF8 ( )

Return the information currently stored in the system clipboard.

If data stored in the clipboard is in non-text format, empty string is returned.

Note
The clipboard is expected containing Unicode chars, not only ASCII7 chars. The returned string is UTF8 encoded

Definition at line 51 of file clipboard.cpp.

Referenced by SYMBOL_EDIT_FRAME::DuplicateSymbol(), SCH_EDITOR_CONTROL::Paste(), SYMBOL_EDITOR_EDIT_TOOL::Paste(), PL_EDIT_TOOL::Paste(), and PCB_CONTROL::Paste().

◆ GetImageFromClipboard()

std::unique_ptr< wxImage > GetImageFromClipboard ( )

Get image data from the clipboard, if there is any.

If there's a filename there, and it can be loaded as an image, do that.

Definition at line 77 of file clipboard.cpp.

References image.

Referenced by SCH_EDITOR_CONTROL::Paste(), PL_EDIT_TOOL::Paste(), and PCB_CONTROL::Paste().

◆ SaveClipboard()

bool SaveClipboard ( const std::string &  aTextUTF8)

Store information to the system clipboard.

Parameters
aTextis the information to be stored, expected UTF8 encoding. The text will be stored as Unicode string (not stored as UTF8 string).
Returns
False if error occurred.

Definition at line 31 of file clipboard.cpp.

Referenced by SYMBOL_EDITOR_EDIT_TOOL::Copy(), PL_EDIT_TOOL::Copy(), SCH_EDITOR_CONTROL::CopyAsText(), SYMBOL_EDITOR_EDIT_TOOL::CopyAsText(), EDIT_TOOL::copyToClipboardAsText(), and SCH_EDITOR_CONTROL::doCopy().