KiCad PCB EDA Suite
Loading...
Searching...
No Matches
clipboard.cpp File Reference
#include "clipboard.h"
#include <wx/clipbrd.h>
#include <wx/dataobj.h>
#include <wx/image.h>
#include <wx/log.h>
#include <wx/mstream.h>
#include <wx/string.h>
#include <wx/sstream.h>
#include <sstream>
#include <io/csv.h>

Go to the source code of this file.

Functions

bool SaveClipboard (const std::string &aTextUTF8)
 Store information to the system clipboard.
 
bool SaveClipboard (const std::string &aTextUTF8, const std::vector< CLIPBOARD_MIME_DATA > &aMimeData)
 Store information to the system clipboard with additional MIME types.
 
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.
 
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.
 

Function Documentation

◆ GetClipboardUTF8()

std::string GetClipboardUTF8 ( )

◆ 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 158 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() [1/2]

◆ SaveClipboard() [2/2]

bool SaveClipboard ( const std::string & aTextUTF8,
const std::vector< CLIPBOARD_MIME_DATA > & aMimeData )

Store information to the system clipboard with additional MIME types.

Creates a composite clipboard object with text as the primary format and additional custom MIME type data. When aMimeData is empty, falls back to SaveClipboard(aTextUTF8).

Parameters
aTextUTF8is the text to store, expected UTF8 encoding. Stored as primary text format.
aMimeDatais additional data to store by MIME type (e.g., image/svg+xml, image/png).
Returns
False if error occurred.

Definition at line 59 of file clipboard.cpp.

References image, and SaveClipboard().

◆ SaveTabularDataToClipboard()

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