KiCad PCB EDA Suite
Loading...
Searching...
No Matches
headless_footprint_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 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef KICAD_HEADLESS_FOOTPRINT_CONTEXT_H
21#define KICAD_HEADLESS_FOOTPRINT_CONTEXT_H
22
23#include <memory>
24
25#include <lib_id.h>
26
28
30class BOARD;
31class KIWAY;
32class PROJECT;
33class TOOL_MANAGER;
34
35
37{
38public:
39 HEADLESS_FOOTPRINT_CONTEXT( std::unique_ptr<FOOTPRINT> aFootprint, const LIB_ID& aFPID,
40 PROJECT* aProject, APP_SETTINGS_BASE* aSettings,
41 KIWAY* aKiway = nullptr );
42
44
45 BOARD* GetBoard() const override;
46
47 PROJECT& Prj() const override;
48
49 TOOL_MANAGER* GetToolManager() const override;
50
51 KIWAY* GetKiway() const override { return m_kiway; }
52
53 bool CanAcceptApiCommands() const override { return true; }
54
55 LIB_ID GetLoadedFPID() const override;
56
57 bool SaveFootprint( FOOTPRINT* aFootprint ) override;
58
59 bool SaveFootprintInLibrary( FOOTPRINT* aFootprint, const wxString& aLibraryName ) override;
60
61private:
62 std::unique_ptr<BOARD> m_board;
66 std::unique_ptr<TOOL_MANAGER> m_toolManager;
67};
68
69#endif
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:323
TOOL_MANAGER * GetToolManager() const override
bool SaveFootprintInLibrary(FOOTPRINT *aFootprint, const wxString &aLibraryName) override
~HEADLESS_FOOTPRINT_CONTEXT() override
bool SaveFootprint(FOOTPRINT *aFootprint) override
std::unique_ptr< TOOL_MANAGER > m_toolManager
bool CanAcceptApiCommands() const override
HEADLESS_FOOTPRINT_CONTEXT(std::unique_ptr< FOOTPRINT > aFootprint, const LIB_ID &aFPID, PROJECT *aProject, APP_SETTINGS_BASE *aSettings, KIWAY *aKiway=nullptr)
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
Definition kiway.h:315
A logical library item identifier and consists of various portions much like a URI.
Definition lib_id.h:49
Container for project specific data.
Definition project.h:66
Master controller class: