117 template<
class Range>
121 for(
const auto& item : aRange )
122 Stage( item, aChangeType );
135 UNDO_REDO aModFlag = UNDO_REDO::UNSPECIFIED,
139 virtual void Push(
const wxString& aMessage = wxT(
"A commit" ),
int aFlags = 0 ) = 0;
Handles how to draw a screen (a board, a schematic ...)
Represent a set of changes (additions, deletions or modifications) of a data model (e....
COMMIT & Remove(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Notify observers that aItem has been removed.
virtual COMMIT & Stage(EDA_ITEM *aItem, CHANGE_TYPE aChangeType, BASE_SCREEN *aScreen=nullptr)
COMMIT & Modify(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Create an undo entry for an item that has been already modified.
COMMIT & Added(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Remove a new item from the model.
COMMIT & StageItems(const Range &aRange, CHANGE_TYPE aChangeType)
Add a change of the item aItem of type aChangeType to the change list.
COMMIT & createModified(EDA_ITEM *aItem, EDA_ITEM *aCopy, int aExtraFlags=0, BASE_SCREEN *aScreen=nullptr)
std::set< EDA_ITEM * > m_deletedItems
COMMIT & Modified(EDA_ITEM *aItem, EDA_ITEM *aCopy, BASE_SCREEN *aScreen=nullptr)
virtual void Push(const wxString &aMessage=wxT("A commit"), int aFlags=0)=0
Revert the commit by restoring the modified items state.
bool Empty() const
Returns status of an item.
virtual ~COMMIT()
Add a new item to the model.
COMMIT_LINE * findEntry(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Search for an entry describing change for a particular item.
virtual void makeEntry(EDA_ITEM *aItem, CHANGE_TYPE aType, EDA_ITEM *aCopy=nullptr, BASE_SCREEN *aScreen=nullptr)
COMMIT & Add(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Notify observers that aItem has been added.
std::set< EDA_ITEM * > m_changedItems
EDA_ITEM * GetFirst() const
COMMIT & Removed(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Modify a given item in the model.
virtual EDA_ITEM * parentObject(EDA_ITEM *aItem) const =0
virtual EDA_ITEM * makeImage(EDA_ITEM *aItem) const =0
int GetStatus(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
std::vector< COMMIT_LINE > m_changes
A base class for most all the KiCad significant classes used in schematics and boards.
A holder to handle information on schematic or board items.
CHANGE_TYPE operator|(CHANGE_TYPE aTypeA, T aTypeB)
CHANGE_TYPE
Types of changes.
@ CHT_DONE
Flag to indicate the change is already applied.
CHANGE_TYPE operator&(CHANGE_TYPE aTypeA, T aTypeB)
EDA_ITEM * m_copy
Optional copy of the item.
CHANGE_TYPE m_type
Modification type.
KIID m_parent
Parent item (primarily for undo of deleted items)
EDA_ITEM * m_item
Main item that is added/deleted/modified.
UNDO_REDO
Undo Redo considerations: Basically we have 3 cases New item Deleted item Modified item there is also...