KiCad PCB EDA Suite
Loading...
Searching...
No Matches
footprint_editor_control.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 (C) 2014 CERN
5
* Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6
*
7
* @author Maciej Suminski <
[email protected]
>
8
*
9
* This program is free software; you can redistribute it and/or
10
* modify it under the terms of the GNU General Public License
11
* as published by the Free Software Foundation; either version 2
12
* of the License, or (at your option) any later version.
13
*
14
* This program is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
* GNU General Public License for more details.
18
*
19
* You should have received a copy of the GNU General Public License
20
* along with this program. If not, see <https://www.gnu.org/licenses/>.
21
*/
22
23
#ifndef FOOTPRINT_EDITOR_CONTROL_H
24
#define FOOTPRINT_EDITOR_CONTROL_H
25
26
#include <
tools/pcb_tool_base.h
>
27
28
29
class
FOOTPRINT_EDIT_FRAME
;
30
class
DIALOG_FOOTPRINT_CHECKER
;
31
35
class
FOOTPRINT_EDITOR_CONTROL
:
public
PCB_TOOL_BASE
36
{
37
public
:
38
FOOTPRINT_EDITOR_CONTROL
();
39
41
void
Reset
(
RESET_REASON
aReason )
override
;
42
44
bool
Init
()
override
;
45
46
int
NewFootprint
(
const
TOOL_EVENT
& aEvent );
47
int
CreateFootprintFromWizard
(
const
TOOL_EVENT
& aEvent );
48
49
int
Save
(
const
TOOL_EVENT
& aEvent );
50
int
SaveAs
(
const
TOOL_EVENT
& aEvent );
51
int
Revert
(
const
TOOL_EVENT
& aEvent );
52
53
int
EditFootprint
(
const
TOOL_EVENT
& aEvent );
54
int
EditLibraryFootprint
(
const
TOOL_EVENT
& aEvent );
55
int
CutCopyFootprint
(
const
TOOL_EVENT
& aEvent );
56
int
PasteFootprint
(
const
TOOL_EVENT
& aEvent );
57
int
DuplicateFootprint
(
const
TOOL_EVENT
& aEvent );
58
int
RenameFootprint
(
const
TOOL_EVENT
& aEvent );
59
int
DeleteFootprint
(
const
TOOL_EVENT
& aEvent );
60
int
ImportFootprint
(
const
TOOL_EVENT
& aEvent );
61
int
ExportFootprint
(
const
TOOL_EVENT
& aEvent );
62
int
ExportForOlderVersion
(
const
TOOL_EVENT
& aEvent );
63
int
ExportFootprintAsSVG
(
const
TOOL_EVENT
& aEvent );
64
66
int
CompareLibraryWithFile
(
const
TOOL_EVENT
& aEvent );
67
int
OpenDirectory
(
const
TOOL_EVENT
& aEvent );
68
int
OpenWithTextEditor
(
const
TOOL_EVENT
& aEvent );
69
int
ShowDatasheet
(
const
TOOL_EVENT
& aEvent );
70
int
ShowLibraryFieldsTable
(
const
TOOL_EVENT
& aEvent );
71
72
int
ToggleLayersManager
(
const
TOOL_EVENT
& aEvent );
73
int
ToggleProperties
(
const
TOOL_EVENT
& aEvent );
74
int
Properties
(
const
TOOL_EVENT
& aEvent );
75
void
editFootprintPropertiesFromLibrary
(
const
LIB_ID
& aLibId );
76
77
int
EditTextAndGraphics
(
const
TOOL_EVENT
& aEvent );
78
79
int
CheckFootprint
(
const
TOOL_EVENT
& aEvent );
80
void
CrossProbe
(
const
PCB_MARKER
* aMarker );
81
void
DestroyCheckerDialog
();
82
83
int
ShowFootprintUsers
(
const
TOOL_EVENT
& aEvent );
84
85
int
CleanupGraphics
(
const
TOOL_EVENT
& aEvent );
86
int
RepairFootprint
(
const
TOOL_EVENT
& aEvent );
87
88
int
NextTab
(
const
TOOL_EVENT
& aEvent );
89
int
PrevTab
(
const
TOOL_EVENT
& aEvent );
90
int
CloseTab
(
const
TOOL_EVENT
& aEvent );
91
92
private
:
94
void
setTransitions
()
override
;
95
99
void
tryToSaveFootprintInLibrary
(
FOOTPRINT
& aFootprint,
const
LIB_ID
& aLibId );
100
101
// Line-mode handlers
102
int
ChangeLineMode
(
const
TOOL_EVENT
& aEvent );
103
int
OnAngleSnapModeChanged
(
const
TOOL_EVENT
& aEvent );
104
105
FOOTPRINT_EDIT_FRAME
*
m_frame
;
106
DIALOG_FOOTPRINT_CHECKER
*
m_checkerDialog
;
107
108
// A private clipboard for cut/copy/past of an entire footprint
109
std::unique_ptr<FOOTPRINT>
m_copiedFootprint
;
110
};
111
112
#endif
// FOOTPRINT_EDITOR_CONTROL_H
DIALOG_FOOTPRINT_CHECKER
Definition
dialog_footprint_checker.h:31
FOOTPRINT_EDITOR_CONTROL::ExportForOlderVersion
int ExportForOlderVersion(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:630
FOOTPRINT_EDITOR_CONTROL::OpenWithTextEditor
int OpenWithTextEditor(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:898
FOOTPRINT_EDITOR_CONTROL::PasteFootprint
int PasteFootprint(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:435
FOOTPRINT_EDITOR_CONTROL::m_checkerDialog
DIALOG_FOOTPRINT_CHECKER * m_checkerDialog
Definition
footprint_editor_control.h:106
FOOTPRINT_EDITOR_CONTROL::CutCopyFootprint
int CutCopyFootprint(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:414
FOOTPRINT_EDITOR_CONTROL::EditFootprint
int EditFootprint(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:957
FOOTPRINT_EDITOR_CONTROL::CloseTab
int CloseTab(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:1254
FOOTPRINT_EDITOR_CONTROL::ToggleProperties
int ToggleProperties(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:990
FOOTPRINT_EDITOR_CONTROL::Save
int Save(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:333
FOOTPRINT_EDITOR_CONTROL::OpenDirectory
int OpenDirectory(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:838
FOOTPRINT_EDITOR_CONTROL::FOOTPRINT_EDITOR_CONTROL
FOOTPRINT_EDITOR_CONTROL()
Definition
footprint_editor_control.cpp:74
FOOTPRINT_EDITOR_CONTROL::DestroyCheckerDialog
void DestroyCheckerDialog()
Definition
footprint_editor_control.cpp:1137
FOOTPRINT_EDITOR_CONTROL::EditTextAndGraphics
int EditTextAndGraphics(const TOOL_EVENT &aEvent)
Definition
pcbnew/dialogs/dialog_global_edit_text_and_graphics.cpp:640
FOOTPRINT_EDITOR_CONTROL::NextTab
int NextTab(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:1234
FOOTPRINT_EDITOR_CONTROL::ExportFootprintAsSVG
int ExportFootprintAsSVG(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:685
FOOTPRINT_EDITOR_CONTROL::ShowLibraryFieldsTable
int ShowLibraryFieldsTable(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:1261
FOOTPRINT_EDITOR_CONTROL::m_frame
FOOTPRINT_EDIT_FRAME * m_frame
Definition
footprint_editor_control.h:105
FOOTPRINT_EDITOR_CONTROL::NewFootprint
int NewFootprint(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:228
FOOTPRINT_EDITOR_CONTROL::CompareLibraryWithFile
int CompareLibraryWithFile(const TOOL_EVENT &aEvent)
Diff the currently-selected footprint library against another .pretty directory.
Definition
footprint_editor_control.cpp:720
FOOTPRINT_EDITOR_CONTROL::CrossProbe
void CrossProbe(const PCB_MARKER *aMarker)
Definition
footprint_editor_control.cpp:1125
FOOTPRINT_EDITOR_CONTROL::ChangeLineMode
int ChangeLineMode(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:1336
FOOTPRINT_EDITOR_CONTROL::ShowFootprintUsers
int ShowFootprintUsers(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:1111
FOOTPRINT_EDITOR_CONTROL::ImportFootprint
int ImportFootprint(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:602
FOOTPRINT_EDITOR_CONTROL::CleanupGraphics
int CleanupGraphics(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:1085
FOOTPRINT_EDITOR_CONTROL::ShowDatasheet
int ShowDatasheet(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:935
FOOTPRINT_EDITOR_CONTROL::tryToSaveFootprintInLibrary
void tryToSaveFootprintInLibrary(FOOTPRINT &aFootprint, const LIB_ID &aLibId)
Try to save the footprint in the library, if it is valid and writable.
Definition
footprint_editor_control.cpp:187
FOOTPRINT_EDITOR_CONTROL::PrevTab
int PrevTab(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:1244
FOOTPRINT_EDITOR_CONTROL::Properties
int Properties(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:997
FOOTPRINT_EDITOR_CONTROL::ToggleLayersManager
int ToggleLayersManager(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:983
FOOTPRINT_EDITOR_CONTROL::RepairFootprint
int RepairFootprint(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:1147
FOOTPRINT_EDITOR_CONTROL::RenameFootprint
int RenameFootprint(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:480
FOOTPRINT_EDITOR_CONTROL::DuplicateFootprint
int DuplicateFootprint(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:458
FOOTPRINT_EDITOR_CONTROL::m_copiedFootprint
std::unique_ptr< FOOTPRINT > m_copiedFootprint
Definition
footprint_editor_control.h:109
FOOTPRINT_EDITOR_CONTROL::Init
bool Init() override
Init() is called once upon a registration of the tool.
Definition
footprint_editor_control.cpp:91
FOOTPRINT_EDITOR_CONTROL::CreateFootprintFromWizard
int CreateFootprintFromWizard(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:277
FOOTPRINT_EDITOR_CONTROL::OnAngleSnapModeChanged
int OnAngleSnapModeChanged(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:1345
FOOTPRINT_EDITOR_CONTROL::ExportFootprint
int ExportFootprint(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:676
FOOTPRINT_EDITOR_CONTROL::EditLibraryFootprint
int EditLibraryFootprint(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:964
FOOTPRINT_EDITOR_CONTROL::editFootprintPropertiesFromLibrary
void editFootprintPropertiesFromLibrary(const LIB_ID &aLibId)
Definition
footprint_editor_control.cpp:1025
FOOTPRINT_EDITOR_CONTROL::DeleteFootprint
int DeleteFootprint(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:585
FOOTPRINT_EDITOR_CONTROL::SaveAs
int SaveAs(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:358
FOOTPRINT_EDITOR_CONTROL::setTransitions
void setTransitions() override
< Set up handlers for various events.
Definition
footprint_editor_control.cpp:1280
FOOTPRINT_EDITOR_CONTROL::CheckFootprint
int CheckFootprint(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:1095
FOOTPRINT_EDIT_FRAME
Definition
footprint_edit_frame.h:52
FOOTPRINT
Definition
footprint.h:265
LIB_ID
A logical library item identifier and consists of various portions much like a URI.
Definition
lib_id.h:45
PCB_MARKER
Definition
pcb_marker.h:39
PCB_TOOL_BASE::PCB_TOOL_BASE
PCB_TOOL_BASE(TOOL_ID aId, const std::string &aName)
Constructor.
Definition
pcb_tool_base.h:75
TOOL_BASE::RESET_REASON
RESET_REASON
Determine the reason of reset for a tool.
Definition
tool_base.h:74
TOOL_EVENT
Generic, UI-independent tool event.
Definition
tool_event.h:167
Reset
void Reset() override
GitOperation::Revert
@ Revert
Definition
kicad_git_common.h:208
pcb_tool_base.h
src
pcbnew
tools
footprint_editor_control.h
Generated on Tue Nov 17 2026 00:06:25 for KiCad PCB EDA Suite by
1.13.2