2017-04-15 16:08:23 +00:00
|
|
|
/**
|
|
|
|
* @file kicad_clipboard.h
|
|
|
|
* @brief
|
|
|
|
* @author Kristoffer Ödmark
|
|
|
|
* @version 1.0
|
|
|
|
* @date 2017-05-03
|
|
|
|
*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2021-10-06 02:46:53 +00:00
|
|
|
* Copyright (C) 2017-2020 KiCad Developers, see AUTHORS.TXT for contributors.
|
2017-04-15 16:08:23 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef KICAD_CLIPBOARD_H
|
|
|
|
#define KICAD_CLIPBOARD_H
|
|
|
|
|
2020-11-14 18:11:28 +00:00
|
|
|
#include <board_item.h>
|
2020-11-12 20:19:22 +00:00
|
|
|
#include <footprint.h>
|
2023-12-24 01:21:58 +00:00
|
|
|
#include <pcb_io/kicad_sexpr/pcb_io_kicad_sexpr.h>
|
|
|
|
#include <pcb_io/kicad_sexpr/pcb_io_kicad_sexpr_parser.h>
|
2017-04-15 16:08:23 +00:00
|
|
|
#include <memory.h>
|
2020-12-16 13:31:32 +00:00
|
|
|
#include <tools/pcb_selection.h>
|
2017-04-15 16:08:23 +00:00
|
|
|
|
|
|
|
|
2023-12-24 01:21:58 +00:00
|
|
|
class CLIPBOARD_IO : public PCB_IO_KICAD_SEXPR
|
2017-04-15 16:08:23 +00:00
|
|
|
{
|
|
|
|
public:
|
2020-12-04 12:13:11 +00:00
|
|
|
CLIPBOARD_IO();
|
|
|
|
~CLIPBOARD_IO();
|
|
|
|
|
|
|
|
/*
|
2023-12-24 01:21:58 +00:00
|
|
|
* Saves the entire board to the clipboard formatted using the PCB_IO_KICAD_SEXPR formatting
|
2020-12-04 12:13:11 +00:00
|
|
|
*/
|
2023-08-13 02:11:58 +00:00
|
|
|
void SaveBoard( const wxString& aFileName, BOARD* aBoard,
|
2023-06-12 18:12:39 +00:00
|
|
|
const STRING_UTF8_MAP* aProperties = nullptr,
|
|
|
|
PROGRESS_REPORTER* aProgressReporter = nullptr ) override;
|
2020-12-04 12:13:11 +00:00
|
|
|
|
|
|
|
/*
|
2020-12-18 15:40:13 +00:00
|
|
|
* Write all the settings of the BOARD* set by setBoard() and then adds all the
|
2023-12-24 01:21:58 +00:00
|
|
|
* BOARD_ITEMs found in selection formatted by PCB_IO_KICAD_SEXPR to clipboard as sexpr text
|
2017-04-15 16:08:23 +00:00
|
|
|
*/
|
2020-12-16 13:31:32 +00:00
|
|
|
void SaveSelection( const PCB_SELECTION& selected, bool isFootprintEditor );
|
2017-04-15 16:08:23 +00:00
|
|
|
|
2017-05-18 17:21:30 +00:00
|
|
|
BOARD_ITEM* Parse();
|
|
|
|
|
2023-08-13 02:11:58 +00:00
|
|
|
BOARD* LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
|
|
|
|
const STRING_UTF8_MAP* aProperties = nullptr, PROJECT* aProject = nullptr,
|
|
|
|
PROGRESS_REPORTER* aProgressReporter = nullptr ) override;
|
2017-04-15 16:08:23 +00:00
|
|
|
|
2017-09-22 15:17:38 +00:00
|
|
|
void SetBoard( BOARD* aBoard );
|
2017-04-15 16:08:23 +00:00
|
|
|
|
2017-09-22 15:17:38 +00:00
|
|
|
private:
|
|
|
|
STRING_FORMATTER m_formatter;
|
2017-04-15 16:08:23 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* KICAD_CLIPBOARD_H */
|