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 <maciej.suminski@cern.ch>
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 {
41 public:
43  ~FOOTPRINT_EDITOR_CONTROL() override;
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 DeleteFootprint( const TOOL_EVENT& aEvent );
62  int ImportFootprint( const TOOL_EVENT& aEvent );
63  int ExportFootprint( const TOOL_EVENT& aEvent );
64 
65  int PinLibrary( const TOOL_EVENT& aEvent );
66  int UnpinLibrary( const TOOL_EVENT& aEvent );
67  int ToggleFootprintTree( const TOOL_EVENT& aEvent );
68  int Properties( const TOOL_EVENT& aEvent );
69 
70  int CleanupGraphics( const TOOL_EVENT& aEvent );
71 
72  int CheckFootprint( const TOOL_EVENT& aEvent );
73  void DestroyCheckerDialog();
74 
78  int DefaultPadProperties( const TOOL_EVENT& aEvent );
79 
80 private:
82  void setTransitions() override;
83 
86 
87  // A private clipboard for cut/copy/past of an entire footprint
88  std::unique_ptr<FOOTPRINT> m_copiedFootprint;
89 };
90 
91 #endif // FOOTPRINT_EDITOR_CONTROL_H
int Save(const TOOL_EVENT &aEvent)
int DefaultPadProperties(const TOOL_EVENT &aEvent)
Edit the properties used for new pad creation.
Module editor specific tools.
DIALOG_FOOTPRINT_CHECKER * m_checkerDialog
int PasteFootprint(const TOOL_EVENT &aEvent)
std::unique_ptr< FOOTPRINT > m_copiedFootprint
bool Init() override
Init() is called once upon a registration of the tool.
int ImportFootprint(const TOOL_EVENT &aEvent)
FOOTPRINT_EDIT_FRAME * m_frame
int CreateFootprint(const TOOL_EVENT &aEvent)
int CleanupGraphics(const TOOL_EVENT &aEvent)
int ToggleFootprintTree(const TOOL_EVENT &aEvent)
int CutCopyFootprint(const TOOL_EVENT &aEvent)
Generic, UI-independent tool event.
Definition: tool_event.h:173
int Revert(const TOOL_EVENT &aEvent)
int NewFootprint(const TOOL_EVENT &aEvent)
void setTransitions() override
< Set up handlers for various events.
void Reset(RESET_REASON aReason) override
Bring the tool to a known, initial state.
int EditFootprint(const TOOL_EVENT &aEvent)
int DeleteFootprint(const TOOL_EVENT &aEvent)
int CheckFootprint(const TOOL_EVENT &aEvent)
int ExportFootprint(const TOOL_EVENT &aEvent)
RESET_REASON
Determine the reason of reset for a tool.
Definition: tool_base.h:78
int UnpinLibrary(const TOOL_EVENT &aEvent)
int SaveAs(const TOOL_EVENT &aEvent)
int PinLibrary(const TOOL_EVENT &aEvent)
int Properties(const TOOL_EVENT &aEvent)