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

Go to the source code of this file.

Functions

bool SaveClipboard (const std::string &aTextUTF8)
 Store information to the system clipboard.
 
bool SaveTabularDataToClipboard (const std::vector< std::vector< wxString > > &aData)
 Store tabular data to the system clipboard.
 
bool GetTabularDataFromClipboard (std::vector< std::vector< wxString > > &aData)
 Attempt to get tabular data from the 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 58 of file clipboard.cpp.

References result.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), SYMBOL_EDIT_FRAME::DuplicateSymbol(), PCB_CONTROL::Paste(), PL_EDIT_TOOL::Paste(), SCH_EDITOR_CONTROL::Paste(), and SYMBOL_EDITOR_EDIT_TOOL::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 84 of file clipboard.cpp.

References image.

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

◆ GetTabularDataFromClipboard()

bool GetTabularDataFromClipboard ( std::vector< std::vector< wxString > > & aData)

◆ 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 38 of file clipboard.cpp.

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

◆ SaveTabularDataToClipboard()

bool SaveTabularDataToClipboard ( const std::vector< std::vector< wxString > > & aData)