KiCad PCB EDA Suite
lib_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) 2019 CERN
5  * Copyright (C) 2019 KiCad Developers, see AUTHORS.txt for contributors.
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 
26 #ifndef LIB_CONTROL_H
27 #define LIB_CONTROL_H
28 
29 #include <sch_base_frame.h>
30 #include <tools/ee_tool_base.h>
31 
32 class LIB_EDIT_FRAME;
33 
39 class LIB_CONTROL : public wxEvtHandler, public EE_TOOL_BASE<SCH_BASE_FRAME>
40 {
41 public:
43  EE_TOOL_BASE<SCH_BASE_FRAME>( "eeschema.SymbolLibraryControl" )
44  { }
45 
46  virtual ~LIB_CONTROL() { }
47 
49  bool Init() override;
50 
51  int AddLibrary( const TOOL_EVENT& aEvent );
52  int AddSymbol( const TOOL_EVENT& aEvent );
53  int EditSymbol( const TOOL_EVENT& aEvent );
54 
55  int Save( const TOOL_EVENT& aEvt );
56  int Revert( const TOOL_EVENT& aEvent );
57 
58  int CutCopyDelete( const TOOL_EVENT& aEvent );
59  int DuplicateSymbol( const TOOL_EVENT& aEvent );
60  int ExportSymbol( const TOOL_EVENT& aEvent );
61  int ExportView( const TOOL_EVENT& aEvent );
62  int ExportSymbolAsSVG( const TOOL_EVENT& aEvent );
63  int AddSymbolToSchematic( const TOOL_EVENT& aEvent );
64 
65  int OnDeMorgan( const TOOL_EVENT& aEvent );
66 
67  int ShowElectricalTypes( const TOOL_EVENT& aEvent );
68  int ShowComponentTree( const TOOL_EVENT& aEvent );
69  int ToggleSyncedPinsMode( const TOOL_EVENT& aEvent );
70 
71 private:
73  void setTransitions() override;
74 };
75 
76 
77 #endif // LIB_EDITOR_CONTROL_H
int AddLibrary(const TOOL_EVENT &aEvent)
Definition: lib_control.cpp:91
int EditSymbol(const TOOL_EVENT &aEvent)
int ToggleSyncedPinsMode(const TOOL_EVENT &aEvent)
int AddSymbol(const TOOL_EVENT &aEvent)
int ShowElectricalTypes(const TOOL_EVENT &aEvent)
int ExportView(const TOOL_EVENT &aEvent)
int ExportSymbol(const TOOL_EVENT &aEvent)
Class LIB_CONTROL.
Definition: lib_control.h:39
int Save(const TOOL_EVENT &aEvt)
Class TOOL_EVENT.
Definition: tool_event.h:168
int AddSymbolToSchematic(const TOOL_EVENT &aEvent)
void setTransitions() override
Sets up handlers for various events.
int CutCopyDelete(const TOOL_EVENT &aEvent)
int Revert(const TOOL_EVENT &aEvent)
The symbol library editor main window.
Class EE_TOOL_BASE.
Definition: ee_tool_base.h:50
int ExportSymbolAsSVG(const TOOL_EVENT &aEvent)
int DuplicateSymbol(const TOOL_EVENT &aEvent)
A shim class between EDA_DRAW_FRAME and several derived classes: LIB_EDIT_FRAME, LIB_VIEW_FRAME,...
virtual ~LIB_CONTROL()
Definition: lib_control.h:46
bool Init() override
Function Init() Init() is called once upon a registration of the tool.
Definition: lib_control.cpp:40
int ShowComponentTree(const TOOL_EVENT &aEvent)
int OnDeMorgan(const TOOL_EVENT &aEvent)