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 (C) 2021 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, you may find one here:
21 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
22 * or you may search the http://www.gnu.org website for the version 2 license,
23 * or you may write to the Free Software Foundation, Inc.,
24 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
25 */
26
27#ifndef FOOTPRINT_EDITOR_CONTROL_H
28#define FOOTPRINT_EDITOR_CONTROL_H
29
30#include <tools/pcb_tool_base.h>
31
32
35
40{
41public:
43
45 void Reset( RESET_REASON aReason ) override;
46
48 bool Init() override;
49
50 int NewFootprint( const TOOL_EVENT& aEvent );
51 int CreateFootprint( const TOOL_EVENT& aEvent );
52
53 int Save( const TOOL_EVENT& aEvent );
54 int SaveAs( const TOOL_EVENT& aEvent );
55 int Revert( const TOOL_EVENT& aEvent );
56
57 int EditFootprint( const TOOL_EVENT& aEvent );
58 int EditLibraryFootprint( const TOOL_EVENT& aEvent );
59 int CutCopyFootprint( const TOOL_EVENT& aEvent );
60 int PasteFootprint( const TOOL_EVENT& aEvent );
61 int DuplicateFootprint( const TOOL_EVENT& aEvent );
62 int RenameFootprint( const TOOL_EVENT& aEvent );
63 int DeleteFootprint( const TOOL_EVENT& aEvent );
64 int ImportFootprint( const TOOL_EVENT& aEvent );
65 int ExportFootprint( const TOOL_EVENT& aEvent );
66 int OpenDirectory( const TOOL_EVENT& aEvent );
67 int OpenWithTextEditor( const TOOL_EVENT& aEvent );
68 int ShowDatasheet( const TOOL_EVENT& aEvent );
69
70 int ToggleLayersManager( const TOOL_EVENT& aEvent );
71 int ToggleProperties( const TOOL_EVENT& aEvent );
72 int Properties( const TOOL_EVENT& aEvent );
73
74 int EditTextAndGraphics( const TOOL_EVENT& aEvent );
75
76 int CheckFootprint( const TOOL_EVENT& aEvent );
77 void CrossProbe( const PCB_MARKER* aMarker );
79
80 int CleanupGraphics( const TOOL_EVENT& aEvent );
81 int RepairFootprint( const TOOL_EVENT& aEvent );
82
86 int DefaultPadProperties( const TOOL_EVENT& aEvent );
87
88private:
90 void setTransitions() override;
91
95 void tryToSaveFootprintInLibrary( FOOTPRINT& aFootprint, const LIB_ID& aLibId );
96
99
100 // A private clipboard for cut/copy/past of an entire footprint
101 std::unique_ptr<FOOTPRINT> m_copiedFootprint;
102};
103
104#endif // FOOTPRINT_EDITOR_CONTROL_H
Module editor specific tools.
int Revert(const TOOL_EVENT &aEvent)
int OpenWithTextEditor(const TOOL_EVENT &aEvent)
int PasteFootprint(const TOOL_EVENT &aEvent)
DIALOG_FOOTPRINT_CHECKER * m_checkerDialog
int CutCopyFootprint(const TOOL_EVENT &aEvent)
int EditFootprint(const TOOL_EVENT &aEvent)
int ToggleProperties(const TOOL_EVENT &aEvent)
int Save(const TOOL_EVENT &aEvent)
int OpenDirectory(const TOOL_EVENT &aEvent)
int CreateFootprint(const TOOL_EVENT &aEvent)
FOOTPRINT_EDIT_FRAME * m_frame
int NewFootprint(const TOOL_EVENT &aEvent)
int DefaultPadProperties(const TOOL_EVENT &aEvent)
Edit the properties used for new pad creation.
void CrossProbe(const PCB_MARKER *aMarker)
int ImportFootprint(const TOOL_EVENT &aEvent)
int CleanupGraphics(const TOOL_EVENT &aEvent)
int ShowDatasheet(const TOOL_EVENT &aEvent)
void tryToSaveFootprintInLibrary(FOOTPRINT &aFootprint, const LIB_ID &aLibId)
Try to save the footprint in the library, if it is valid and writable.
int Properties(const TOOL_EVENT &aEvent)
int ToggleLayersManager(const TOOL_EVENT &aEvent)
int RepairFootprint(const TOOL_EVENT &aEvent)
int RenameFootprint(const TOOL_EVENT &aEvent)
int DuplicateFootprint(const TOOL_EVENT &aEvent)
std::unique_ptr< FOOTPRINT > m_copiedFootprint
bool Init() override
Init() is called once upon a registration of the tool.
int ExportFootprint(const TOOL_EVENT &aEvent)
int EditLibraryFootprint(const TOOL_EVENT &aEvent)
int DeleteFootprint(const TOOL_EVENT &aEvent)
int SaveAs(const TOOL_EVENT &aEvent)
void setTransitions() override
< Set up handlers for various events.
int CheckFootprint(const TOOL_EVENT &aEvent)
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:49
RESET_REASON
Determine the reason of reset for a tool.
Definition: tool_base.h:78
Generic, UI-independent tool event.
Definition: tool_event.h:167
void Reset() override