KiCad PCB EDA Suite
footprint_editor_tools.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  * @author Maciej Suminski <maciej.suminski@cern.ch>
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
25 #ifndef MODULE_EDITOR_TOOLS_H
26 #define MODULE_EDITOR_TOOLS_H
27 
28 #include <tools/pcb_tool_base.h>
29 
30 
32 
33 
40 {
41 public:
43  ~MODULE_EDITOR_TOOLS() 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 ToggleFootprintTree( const TOOL_EVENT& aEvent );
66  int Properties( const TOOL_EVENT& aEvent );
67 
71  int DefaultPadProperties( const TOOL_EVENT& aEvent );
72 
77  int PlacePad( const TOOL_EVENT& aEvent );
78 
84  int CreateArray( TOOL_EVENT& aEvent );
85 
91  int CreatePadFromShapes( const TOOL_EVENT& aEvent );
92 
98  int ExplodePadToShapes( const TOOL_EVENT& aEvent );
99 
100 private:
102  void setTransitions() override;
103 
104 private:
106 
107  // A private clipboard for cut/copy/past of an entire footprint
108  std::unique_ptr<MODULE> m_copiedModule;
109 };
110 
111 #endif
void Reset(RESET_REASON aReason) override
Function Reset() Brings the tool to a known, initial state.
int CreateArray(TOOL_EVENT &aEvent)
Function CreateArray.
int DefaultPadProperties(const TOOL_EVENT &aEvent)
Edit the properties used for new pad creation.
int Properties(const TOOL_EVENT &aEvent)
int DeleteFootprint(const TOOL_EVENT &aEvent)
int CutCopyFootprint(const TOOL_EVENT &aEvent)
int EditFootprint(const TOOL_EVENT &aEvent)
FOOTPRINT_EDIT_FRAME * m_frame
int CreatePadFromShapes(const TOOL_EVENT &aEvent)
Function CreatePadFromShapes()
int ImportFootprint(const TOOL_EVENT &aEvent)
int ExplodePadToShapes(const TOOL_EVENT &aEvent)
Function ExplodePadToShapes()
int Revert(const TOOL_EVENT &aEvent)
int SaveAs(const TOOL_EVENT &aEvent)
int PlacePad(const TOOL_EVENT &aEvent)
Function PlacePad() Places a pad in module editor.
int Save(const TOOL_EVENT &aEvent)
Class TOOL_EVENT.
Definition: tool_event.h:168
int NewFootprint(const TOOL_EVENT &aEvent)
int ExportFootprint(const TOOL_EVENT &aEvent)
int PasteFootprint(const TOOL_EVENT &aEvent)
void setTransitions() override
Sets up handlers for various events.
bool Init() override
Function Init() Init() is called once upon a registration of the tool.
Class MODULE_EDITOR_TOOLS.
int CreateFootprint(const TOOL_EVENT &aEvent)
RESET_REASON
Determines the reason of reset for a tool
Definition: tool_base.h:79
std::unique_ptr< MODULE > m_copiedModule
int ToggleFootprintTree(const TOOL_EVENT &aEvent)