KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pcb_context.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5 * @author Jon Evans <[email protected]>
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
21#ifndef KICAD_PCB_CONTEXT_H
22#define KICAD_PCB_CONTEXT_H
23
24#include <memory>
25
26#include <wx/string.h>
27
28#include <api/board_context.h>
29
31class NETLIST;
32class PCB_EDIT_FRAME;
33class REPORTER;
34
35
38{
39public:
40 virtual wxString GetCurrentFileName() const = 0;
41
42 virtual bool SaveBoard() = 0;
43
44 virtual bool SavePcbCopy( const wxString& aFileName, bool aCreateProject, bool aHeadless ) = 0;
45
49 virtual bool ReadNetlistFromFile( const wxString& aFilename, NETLIST& aNetlist, REPORTER& aReporter ) = 0;
50
54 virtual std::unique_ptr<BOARD_NETLIST_UPDATER> MakeNetlistUpdater() = 0;
55
59 virtual void OnNetlistChanged( BOARD_NETLIST_UPDATER& aUpdater ) = 0;
60};
61
62
63std::shared_ptr<PCB_CONTEXT> CreatePcbFrameContext( PCB_EDIT_FRAME* aFrame );
64
65#endif
Base interface for board-level API contexts; shared by PCB editor and footprint editor.
Update the BOARD with a new netlist.
Store information read from a netlist along with the flags used to update the NETLIST in the BOARD.
PCB-editor-specific context; extends BOARD_CONTEXT with save/filename operations.
Definition pcb_context.h:38
virtual bool SaveBoard()=0
virtual wxString GetCurrentFileName() const =0
virtual void OnNetlistChanged(BOARD_NETLIST_UPDATER &aUpdater)=0
Post-import board sync (nets, classes, DRC, ratsnest, new footprint placement).
virtual bool ReadNetlistFromFile(const wxString &aFilename, NETLIST &aNetlist, REPORTER &aReporter)=0
Read a netlist file and preload component footprints.
virtual bool SavePcbCopy(const wxString &aFileName, bool aCreateProject, bool aHeadless)=0
virtual std::unique_ptr< BOARD_NETLIST_UPDATER > MakeNetlistUpdater()=0
Create a netlist updater bound to this context's board.
The main frame for Pcbnew.
A pure virtual class used to derive REPORTER objects from.
Definition reporter.h:71
std::shared_ptr< PCB_CONTEXT > CreatePcbFrameContext(PCB_EDIT_FRAME *aFrame)