KiCad PCB EDA Suite
board_commit.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) 2016 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 #ifndef __BOARD_COMMIT_H
26 #define __BOARD_COMMIT_H
27 
28 #include <commit.h>
29 
30 class BOARD_ITEM;
31 class PICKED_ITEMS_LIST;
32 class PCB_TOOL_BASE;
33 class TOOL_MANAGER;
34 class EDA_DRAW_FRAME;
35 class TOOL_BASE;
36 
37 class BOARD_COMMIT : public COMMIT
38 {
39 public:
40  BOARD_COMMIT( EDA_DRAW_FRAME* aFrame );
41  BOARD_COMMIT( PCB_TOOL_BASE *aTool );
42 
43  virtual ~BOARD_COMMIT();
44 
45  virtual void Push( const wxString& aMessage = wxT( "A commit" ),
46  bool aCreateUndoEntry = true, bool aSetDirtyBit = true ) override;
47 
48  virtual void Revert() override;
49  COMMIT& Stage( EDA_ITEM* aItem, CHANGE_TYPE aChangeType ) override;
50  COMMIT& Stage( std::vector<EDA_ITEM*>& container, CHANGE_TYPE aChangeType ) override;
51  COMMIT& Stage(
52  const PICKED_ITEMS_LIST& aItems, UNDO_REDO aModFlag = UNDO_REDO::UNSPECIFIED ) override;
53 
54 private:
55  virtual EDA_ITEM* parentObject( EDA_ITEM* aItem ) const override;
56 
57 private:
60 };
61 
62 #endif
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:82
virtual void Revert() override
bool m_isFootprintEditor
Definition: board_commit.h:59
Represent a set of changes (additions, deletions or modifications) of a data model (e....
Definition: commit.h:71
TOOL_MANAGER * m_toolMgr
Definition: board_commit.h:58
BOARD_COMMIT(EDA_DRAW_FRAME *aFrame)
The base class for create windows for drawing purpose.
virtual ~BOARD_COMMIT()
UNDO_REDO
Undo Redo considerations: Basically we have 3 cases New item Deleted item Modified item there is also...
virtual EDA_ITEM * parentObject(EDA_ITEM *aItem) const override
Master controller class:
Definition: tool_manager.h:52
A holder to handle information on schematic or board items.
CHANGE_TYPE
Types of changes.
Definition: commit.h:39
Base abstract interface for all kinds of tools.
Definition: tool_base.h:66
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:149
virtual void Push(const wxString &aMessage=wxT("A commit"), bool aCreateUndoEntry=true, bool aSetDirtyBit=true) override
Revert the commit by restoring the modified items state.
COMMIT & Stage(EDA_ITEM *aItem, CHANGE_TYPE aChangeType) override