KiCad PCB EDA Suite
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:
44
46 void Reset( RESET_REASON aReason ) override;
47
49 bool Init() override;
50
51 int NewFootprint( const TOOL_EVENT& aEvent );
52 int CreateFootprint( const TOOL_EVENT& aEvent );
53
54 int Save( const TOOL_EVENT& aEvent );
55 int SaveAs( const TOOL_EVENT& aEvent );
56 int Revert( const TOOL_EVENT& aEvent );
57
58 int EditFootprint( 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
67 int PinLibrary( const TOOL_EVENT& aEvent );
68 int UnpinLibrary( const TOOL_EVENT& aEvent );
69 int ToggleFootprintTree( const TOOL_EVENT& aEvent );
70 int ToggleLayersManager( const TOOL_EVENT& aEvent );
71 int Properties( const TOOL_EVENT& aEvent );
72
73 int EditTextAndGraphics( const TOOL_EVENT& aEvent );
74
75 int CheckFootprint( const TOOL_EVENT& aEvent );
77
78 int CleanupGraphics( const TOOL_EVENT& aEvent );
79 int RepairFootprint( const TOOL_EVENT& aEvent );
80
84 int DefaultPadProperties( const TOOL_EVENT& aEvent );
85
86private:
88 void setTransitions() override;
89
92
93 // A private clipboard for cut/copy/past of an entire footprint
94 std::unique_ptr<FOOTPRINT> m_copiedFootprint;
95};
96
97#endif // FOOTPRINT_EDITOR_CONTROL_H
Module editor specific tools.
int Revert(const TOOL_EVENT &aEvent)
int PinLibrary(const TOOL_EVENT &aEvent)
int PasteFootprint(const TOOL_EVENT &aEvent)
DIALOG_FOOTPRINT_CHECKER * m_checkerDialog
int ToggleFootprintTree(const TOOL_EVENT &aEvent)
int CutCopyFootprint(const TOOL_EVENT &aEvent)
int EditFootprint(const TOOL_EVENT &aEvent)
int Save(const TOOL_EVENT &aEvent)
void Reset(RESET_REASON aReason) override
Bring the tool to a known, initial state.
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.
int ImportFootprint(const TOOL_EVENT &aEvent)
int CleanupGraphics(const TOOL_EVENT &aEvent)
int UnpinLibrary(const TOOL_EVENT &aEvent)
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 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)
RESET_REASON
Determine the reason of reset for a tool.
Definition: tool_base.h:78
Generic, UI-independent tool event.
Definition: tool_event.h:155