KiCad PCB EDA Suite
tool_base.cpp
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) 2013 CERN
5  * @author Tomasz Wlostowski <tomasz.wlostowski@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 #include <tool/tool_event.h>
26 #include <tool/tool_manager.h>
27 
28 #include <eda_draw_frame.h>
29 #include <eda_base_frame.h>
30 
32 {
33  return m_toolMgr->IsToolActive( m_toolId );
34 }
35 
37 {
38  return m_toolMgr->GetView();
39 }
40 
41 
43 {
44  return m_toolMgr->GetViewControls();
45 }
46 
47 
49 {
50  return m_toolMgr->GetEditFrame();
51 }
52 
53 
55 {
56  return m_toolMgr->GetModel();
57 }
58 
59 
61 {
62  m_toolMgr = aManager;
63 }
KIGFX::VIEW * GetView() const
Definition: tool_manager.h:280
EDA_BASE_FRAME * GetEditFrame() const
Definition: tool_manager.h:298
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:218
TOOL_ID m_toolId
Unique identifier for the tool, assigned by a TOOL_MANAGER instance.
Definition: tool_base.h:213
void attachManager(TOOL_MANAGER *aManager)
Function attachManager()
Definition: tool_base.cpp:60
EDA_BASE_FRAME * getEditFrameInt() const
Definition: tool_base.cpp:48
EDA_ITEM * GetModel() const
Definition: tool_manager.h:293
TOOL_MANAGER.
Definition: tool_manager.h:50
Base window classes and related definitions.
VIEW_CONTROLS is an interface for classes handling user events controlling the view behaviour (such a...
EDA_ITEM * getModelInt() const
Definition: tool_base.cpp:54
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:36
KIGFX::VIEW_CONTROLS * GetViewControls() const
Definition: tool_manager.h:285
The base frame for deriving all KiCad main window classes.
bool IsToolActive() const
Definition: tool_base.cpp:31
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
Definition: base_struct.h:166
bool IsToolActive(TOOL_ID aId) const
Function IsToolActive() Returns true if a tool with given id is active (executing)
KIGFX::VIEW_CONTROLS * getViewControls() const
Function getViewControls()
Definition: tool_base.cpp:42
VIEW.
Definition: view.h:61