KiCad PCB EDA Suite
Loading...
Searching...
No Matches
kicad_clipboard.h
Go to the documentation of this file.
1
29
30#ifndef KICAD_CLIPBOARD_H
31#define KICAD_CLIPBOARD_H
32
33#include <board_item.h>
36#include <memory.h>
37#include <tools/pcb_selection.h>
38
39
41{
42public:
45
46 void SetWriter( std::function<void(const wxString&)> aWriter ) { m_writer = aWriter; }
47 void SetReader( std::function<wxString()> aReader ) { m_reader = aReader; }
48
49 /*
50 * Saves the entire board to the clipboard formatted using the PCB_IO_KICAD_SEXPR formatting
51 */
52 void SaveBoard( const wxString& aFileName, BOARD* aBoard,
53 const std::map<std::string, UTF8>* aProperties = nullptr ) override;
54
55 /*
56 * Write all the settings of the BOARD* set by setBoard() and then adds all the
57 * BOARD_ITEMs found in selection formatted by PCB_IO_KICAD_SEXPR to clipboard as sexpr text
58 */
59 void SaveSelection( const PCB_SELECTION& selected, bool isFootprintEditor );
60
62
63 BOARD* LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
64 const std::map<std::string, UTF8>* aProperties = nullptr, PROJECT* aProject = nullptr ) override;
65
66 void SetBoard( BOARD* aBoard );
67
68private:
69 static void clipboardWriter( const wxString& aData );
70 static wxString clipboardReader();
71
73 std::function<void(const wxString&)> m_writer;
74 std::function<wxString()> m_reader;
75};
76
77
78#endif /* KICAD_CLIPBOARD_H */
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition board_item.h:84
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:322
void SaveSelection(const PCB_SELECTION &selected, bool isFootprintEditor)
STRING_FORMATTER m_formatter
void SetWriter(std::function< void(const wxString &)> aWriter)
BOARD_ITEM * Parse()
void SaveBoard(const wxString &aFileName, BOARD *aBoard, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Write aBoard to a storage file in a format that this PCB_IO implementation knows about or it can be u...
static void clipboardWriter(const wxString &aData)
static wxString clipboardReader()
void SetReader(std::function< wxString()> aReader)
void SetBoard(BOARD *aBoard)
std::function< wxString()> m_reader
BOARD * LoadBoard(const wxString &aFileName, BOARD *aAppendToMe, const std::map< std::string, UTF8 > *aProperties=nullptr, PROJECT *aProject=nullptr) override
Load information from some input file format that this PCB_IO implementation knows about into either ...
std::function< void(const wxString &)> m_writer
PCB_IO_KICAD_SEXPR(int aControlFlags=CTL_FOR_BOARD)
Container for project specific data.
Definition project.h:65
Implement an OUTPUTFORMATTER to a memory buffer.
Definition richio.h:422
Pcbnew s-expression file format parser definition.