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
CreateFootprint
(
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
64
int
CompareLibraryWithFile
(
const
TOOL_EVENT
& aEvent );
65
int
OpenDirectory
(
const
TOOL_EVENT
& aEvent );
66
int
OpenWithTextEditor
(
const
TOOL_EVENT
& aEvent );
67
int
ShowDatasheet
(
const
TOOL_EVENT
& aEvent );
68
69
int
ToggleLayersManager
(
const
TOOL_EVENT
& aEvent );
70
int
ToggleProperties
(
const
TOOL_EVENT
& aEvent );
71
int
Properties
(
const
TOOL_EVENT
& aEvent );
72
void
editFootprintPropertiesFromLibrary
(
const
LIB_ID
& aLibId );
73
74
int
EditTextAndGraphics
(
const
TOOL_EVENT
& aEvent );
75
76
int
CheckFootprint
(
const
TOOL_EVENT
& aEvent );
77
void
CrossProbe
(
const
PCB_MARKER
* aMarker );
78
void
DestroyCheckerDialog
();
79
80
int
CleanupGraphics
(
const
TOOL_EVENT
& aEvent );
81
int
RepairFootprint
(
const
TOOL_EVENT
& aEvent );
82
83
int
NextTab
(
const
TOOL_EVENT
& aEvent );
84
int
PrevTab
(
const
TOOL_EVENT
& aEvent );
85
int
CloseTab
(
const
TOOL_EVENT
& aEvent );
86
90
int
DefaultPadProperties
(
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::Revert
int Revert(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:386
FOOTPRINT_EDITOR_CONTROL::OpenWithTextEditor
int OpenWithTextEditor(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:788
FOOTPRINT_EDITOR_CONTROL::PasteFootprint
int PasteFootprint(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:414
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:393
FOOTPRINT_EDITOR_CONTROL::EditFootprint
int EditFootprint(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:847
FOOTPRINT_EDITOR_CONTROL::CloseTab
int CloseTab(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:1137
FOOTPRINT_EDITOR_CONTROL::ToggleProperties
int ToggleProperties(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:880
FOOTPRINT_EDITOR_CONTROL::Save
int Save(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:315
FOOTPRINT_EDITOR_CONTROL::OpenDirectory
int OpenDirectory(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:728
FOOTPRINT_EDITOR_CONTROL::FOOTPRINT_EDITOR_CONTROL
FOOTPRINT_EDITOR_CONTROL()
Definition
footprint_editor_control.cpp:65
FOOTPRINT_EDITOR_CONTROL::DestroyCheckerDialog
void DestroyCheckerDialog()
Definition
footprint_editor_control.cpp:1020
FOOTPRINT_EDITOR_CONTROL::CreateFootprint
int CreateFootprint(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:254
FOOTPRINT_EDITOR_CONTROL::EditTextAndGraphics
int EditTextAndGraphics(const TOOL_EVENT &aEvent)
Definition
pcbnew/dialogs/dialog_global_edit_text_and_graphics.cpp:642
FOOTPRINT_EDITOR_CONTROL::NextTab
int NextTab(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:1117
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:213
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:621
FOOTPRINT_EDITOR_CONTROL::DefaultPadProperties
int DefaultPadProperties(const TOOL_EVENT &aEvent)
Edit the properties used for new pad creation.
Definition
footprint_editor_control.cpp:975
FOOTPRINT_EDITOR_CONTROL::CrossProbe
void CrossProbe(const PCB_MARKER *aMarker)
Definition
footprint_editor_control.cpp:1008
FOOTPRINT_EDITOR_CONTROL::ChangeLineMode
int ChangeLineMode(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:1195
FOOTPRINT_EDITOR_CONTROL::ImportFootprint
int ImportFootprint(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:584
FOOTPRINT_EDITOR_CONTROL::CleanupGraphics
int CleanupGraphics(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:982
FOOTPRINT_EDITOR_CONTROL::ShowDatasheet
int ShowDatasheet(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:825
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:175
FOOTPRINT_EDITOR_CONTROL::PrevTab
int PrevTab(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:1127
FOOTPRINT_EDITOR_CONTROL::Properties
int Properties(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:887
FOOTPRINT_EDITOR_CONTROL::ToggleLayersManager
int ToggleLayersManager(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:873
FOOTPRINT_EDITOR_CONTROL::RepairFootprint
int RepairFootprint(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:1030
FOOTPRINT_EDITOR_CONTROL::RenameFootprint
int RenameFootprint(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:459
FOOTPRINT_EDITOR_CONTROL::DuplicateFootprint
int DuplicateFootprint(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:437
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:82
FOOTPRINT_EDITOR_CONTROL::OnAngleSnapModeChanged
int OnAngleSnapModeChanged(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:1204
FOOTPRINT_EDITOR_CONTROL::ExportFootprint
int ExportFootprint(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:612
FOOTPRINT_EDITOR_CONTROL::EditLibraryFootprint
int EditLibraryFootprint(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:854
FOOTPRINT_EDITOR_CONTROL::editFootprintPropertiesFromLibrary
void editFootprintPropertiesFromLibrary(const LIB_ID &aLibId)
Definition
footprint_editor_control.cpp:915
FOOTPRINT_EDITOR_CONTROL::DeleteFootprint
int DeleteFootprint(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:563
FOOTPRINT_EDITOR_CONTROL::SaveAs
int SaveAs(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:337
FOOTPRINT_EDITOR_CONTROL::setTransitions
void setTransitions() override
< Set up handlers for various events.
Definition
footprint_editor_control.cpp:1144
FOOTPRINT_EDITOR_CONTROL::CheckFootprint
int CheckFootprint(const TOOL_EVENT &aEvent)
Definition
footprint_editor_control.cpp:992
FOOTPRINT_EDIT_FRAME
Definition
footprint_edit_frame.h:47
FOOTPRINT
Definition
footprint.h:288
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:34
PCB_TOOL_BASE::PCB_TOOL_BASE
PCB_TOOL_BASE(TOOL_ID aId, const std::string &aName)
Constructor.
Definition
pcb_tool_base.h:74
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
pcb_tool_base.h
src
pcbnew
tools
footprint_editor_control.h
Generated on Fri Jun 26 2026 00:05:42 for KiCad PCB EDA Suite by
1.13.2