KiCad PCB EDA Suite
sch_drawing_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) 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 #ifndef SCH_DRAWING_TOOLS_H
26 #define SCH_DRAWING_TOOLS_H
27 
28 #include <tools/ee_tool_base.h>
29 #include <sch_base_frame.h>
30 #include <status_popup.h>
31 
32 class SCH_COMPONENT;
33 class SCH_BUS_WIRE_ENTRY;
34 class SCH_LABEL;
35 class SCHLIB_FILTER;
36 class SCH_EDIT_FRAME;
37 class EE_SELECTION_TOOL;
38 
39 
46 class SCH_DRAWING_TOOLS : public EE_TOOL_BASE<SCH_EDIT_FRAME>
47 {
48 public:
50  ~SCH_DRAWING_TOOLS() override { }
51 
53  bool Init() override;
54 
55  int PlaceComponent( const TOOL_EVENT& aEvent );
56  int SingleClickPlace( const TOOL_EVENT& aEvent );
57  int TwoClickPlace( const TOOL_EVENT& aEvent );
58  int DrawSheet( const TOOL_EVENT& aEvent );
59  int PlaceImage( const TOOL_EVENT& aEvent );
60 
61 private:
62 
63  void sizeSheet( SCH_SHEET* aSheet, VECTOR2I aPos );
64 
66  void setTransitions() override;
67 
68 private:
69  std::unique_ptr<STATUS_TEXT_POPUP> m_statusPopup;
70 };
71 
72 #endif /* SCH_DRAWING_TOOLS_H */
int TwoClickPlace(const TOOL_EVENT &aEvent)
bool Init() override
Function Init() Init() is called once upon a registration of the tool.
int PlaceComponent(const TOOL_EVENT &aEvent)
Class SCH_DRAWING_TOOLS.
~SCH_DRAWING_TOOLS() override
Schematic editor (Eeschema) main window.
int PlaceImage(const TOOL_EVENT &aEvent)
int SingleClickPlace(const TOOL_EVENT &aEvent)
Class TOOL_EVENT.
Definition: tool_event.h:171
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:209
Class SCH_COMPONENT describes a real schematic component.
Definition: sch_component.h:73
Class for a wire to bus entry.
Class EE_TOOL_BASE.
Definition: ee_tool_base.h:50
void setTransitions() override
Sets up handlers for various events.
int DrawSheet(const TOOL_EVENT &aEvent)
void sizeSheet(SCH_SHEET *aSheet, VECTOR2I aPos)
std::unique_ptr< STATUS_TEXT_POPUP > m_statusPopup