KiCad PCB EDA Suite
sch_edit_tool.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) 2019 KiCad Developers, see AUTHORS.txt for contributors.
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, you may find one here:
18  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19  * or you may search the http://www.gnu.org website for the version 2 license,
20  * or you may write to the Free Software Foundation, Inc.,
21  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22  */
23 
24 #ifndef KICAD_SCH_EDIT_TOOL_H
25 #define KICAD_SCH_EDIT_TOOL_H
26 
27 #include <tools/ee_tool_base.h>
28 #include <sch_base_frame.h>
29 
30 
31 class SCH_EDIT_FRAME;
32 class EE_SELECTION_TOOL;
33 
34 
35 class SCH_EDIT_TOOL : public EE_TOOL_BASE<SCH_EDIT_FRAME>
36 {
37 public:
38  SCH_EDIT_TOOL();
39  ~SCH_EDIT_TOOL() override { }
40 
42  bool Init() override;
43 
44  int Rotate( const TOOL_EVENT& aEvent );
45  int Mirror( const TOOL_EVENT& aEvent );
46 
47  int Duplicate( const TOOL_EVENT& aEvent );
48  int RepeatDrawItem( const TOOL_EVENT& aEvent );
49 
50  int Properties( const TOOL_EVENT& aEvent );
51  int EditField( const TOOL_EVENT& aEvent );
52  int AutoplaceFields( const TOOL_EVENT& aEvent );
53  int UpdateFields( const TOOL_EVENT& aEvent );
54  int ConvertDeMorgan( const TOOL_EVENT& aEvent );
55 
56  int ChangeShape( const TOOL_EVENT& aEvent );
57  int ChangeTextType( const TOOL_EVENT& aEvent );
58 
59  int BreakWire( const TOOL_EVENT& aEvent );
60 
61  int CleanupSheetPins( const TOOL_EVENT& aEvent );
62  int GlobalEdit( const TOOL_EVENT& aEvent );
63 
65  int DoDelete( const TOOL_EVENT& aEvent );
66 
68  int DeleteItemCursor( const TOOL_EVENT& aEvent );
69 
70 private:
71  void editComponentFieldText( SCH_FIELD* aField );
72 
74  void setTransitions() override;
75 
76 private:
78 };
79 
80 #endif //KICAD_SCH_EDIT_TOOL_H
Class SCH_FIELD instances are attached to a component and provide a place for the component's value,...
Definition: sch_field.h:52
int Rotate(const TOOL_EVENT &aEvent)
int BreakWire(const TOOL_EVENT &aEvent)
Schematic editor (Eeschema) main window.
int Properties(const TOOL_EVENT &aEvent)
int UpdateFields(const TOOL_EVENT &aEvent)
void setTransitions() override
Sets up handlers for various events.
void editComponentFieldText(SCH_FIELD *aField)
int Duplicate(const TOOL_EVENT &aEvent)
int ChangeShape(const TOOL_EVENT &aEvent)
Class TOOL_EVENT.
Definition: tool_event.h:168
int AutoplaceFields(const TOOL_EVENT &aEvent)
~SCH_EDIT_TOOL() override
Definition: sch_edit_tool.h:39
bool Init() override
Function Init() Init() is called once upon a registration of the tool.
int CleanupSheetPins(const TOOL_EVENT &aEvent)
int DeleteItemCursor(const TOOL_EVENT &aEvent)
Runs the deletion tool.
int Mirror(const TOOL_EVENT &aEvent)
EDA_ITEM * m_pickerItem
Definition: sch_edit_tool.h:77
int RepeatDrawItem(const TOOL_EVENT &aEvent)
int EditField(const TOOL_EVENT &aEvent)
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:150
Class EE_TOOL_BASE.
Definition: ee_tool_base.h:49
int DoDelete(const TOOL_EVENT &aEvent)
Deletes the selected items, or the item under the cursor.
int ConvertDeMorgan(const TOOL_EVENT &aEvent)
int ChangeTextType(const TOOL_EVENT &aEvent)