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( TOOL_MANAGER* aToolMgr );
41  BOARD_COMMIT( EDA_DRAW_FRAME* aFrame );
42  BOARD_COMMIT( PCB_TOOL_BASE *aTool );
43 
44  virtual ~BOARD_COMMIT();
45 
46  virtual void Push( const wxString& aMessage = wxT( "A commit" ),
47  bool aCreateUndoEntry = true, bool aSetDirtyBit = true ) override;
48 
49  virtual void Revert() override;
50  COMMIT& Stage( EDA_ITEM* aItem, CHANGE_TYPE aChangeType ) override;
51  COMMIT& Stage( std::vector<EDA_ITEM*>& container, CHANGE_TYPE aChangeType ) override;
52  COMMIT& Stage(
53  const PICKED_ITEMS_LIST& aItems, UNDO_REDO aModFlag = UNDO_REDO::UNSPECIFIED ) override;
54 
63  void SetResolveNetConflicts( bool aResolve = true ) { m_resolveNetConflicts = aResolve; }
64 
65 private:
66  virtual EDA_ITEM* parentObject( EDA_ITEM* aItem ) const override;
67 
68 private:
72 };
73 
74 #endif
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:80
virtual void Revert() override
bool m_isFootprintEditor
Definition: board_commit.h:70
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:69
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:54
bool m_resolveNetConflicts
Definition: board_commit.h:71
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:65
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:100
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.
BOARD_COMMIT(TOOL_MANAGER *aToolMgr)
void SetResolveNetConflicts(bool aResolve=true)
Sets a flag that will cause Push() to resolve net conflicts on track/via clusters instead of the defa...
Definition: board_commit.h:63
COMMIT & Stage(EDA_ITEM *aItem, CHANGE_TYPE aChangeType) override