KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pcb_design_block_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 The 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, see <https://www.gnu.org/licenses/>.
18 */
19
20
21#ifndef PCB_DESIGN_BLOCK_CONTROL_H
22#define PCB_DESIGN_BLOCK_CONTROL_H
23
25
27class PCB_EDIT_FRAME;
28
33{
34public:
35 PCB_DESIGN_BLOCK_CONTROL() : DESIGN_BLOCK_CONTROL( "pcbnew.PcbDesignBlockControl" ) {}
37
39 bool Init() override;
40
41 int SaveBoardAsDesignBlock( const TOOL_EVENT& aEvent );
42 int SaveSelectionAsDesignBlock( const TOOL_EVENT& aEvent );
43
44 int UpdateDesignBlockFromBoard( const TOOL_EVENT& aEvent );
45 int UpdateDesignBlockFromSelection( const TOOL_EVENT& aEvent );
46
47private:
50 void setTransitions() override;
51
53
55};
56
57
58#endif
DESIGN_BLOCK_CONTROL(const std::string &aName)
A logical library item identifier and consists of various portions much like a URI.
Definition lib_id.h:45
int SaveSelectionAsDesignBlock(const TOOL_EVENT &aEvent)
DESIGN_BLOCK_PANE * getDesignBlockPane() override
bool Init() override
Init() is called once upon a registration of the tool.
LIB_ID getSelectedLibId()
Set up handlers for various events.
int SaveBoardAsDesignBlock(const TOOL_EVENT &aEvent)
void setTransitions() override
This method is meant to be overridden in order to specify handlers for events.
int UpdateDesignBlockFromSelection(const TOOL_EVENT &aEvent)
int UpdateDesignBlockFromBoard(const TOOL_EVENT &aEvent)
The main frame for Pcbnew.
Generic, UI-independent tool event.
Definition tool_event.h:167