20 #ifndef LIBREPCB_EDITOR_CMDLISTELEMENTINSERT_H 21 #define LIBREPCB_EDITOR_CMDLISTELEMENTINSERT_H 26 #include "../undocommand.h" 45 template <
typename T,
typename P,
typename... OnEditedArgs>
52 const std::shared_ptr<T>& element,
53 int index = -1) noexcept
~CmdListElementInsert() noexcept
Definition: cmdlistelementinsert.h:58
bool performExecute() override
Execute the command the first time.
Definition: cmdlistelementinsert.h:65
CmdListElementInsert(SerializableObjectList< T, P, OnEditedArgs... > &list, const std::shared_ptr< T > &element, int index=-1) noexcept
Definition: cmdlistelementinsert.h:51
CmdListElementInsert()=delete
Definition: occmodel.cpp:77
int count() const noexcept
Definition: serializableobjectlist.h:199
int mIndex
Definition: cmdlistelementinsert.h:80
CmdListElementInsert & operator=(const CmdListElementInsert &rhs)=delete
SerializableObjectList< T, P, OnEditedArgs... > & mList
Definition: cmdlistelementinsert.h:78
void performRedo() override
Redo the command.
Definition: cmdlistelementinsert.h:75
The CmdListElementInsert class.
Definition: cmdlistelementinsert.h:46
The UndoCommand class represents a command which you can undo/redo.
Definition: undocommand.h:46
std::shared_ptr< T > mElement
Definition: cmdlistelementinsert.h:79
int insert(int index, const std::shared_ptr< T > &obj) noexcept
Definition: serializableobjectlist.h:336
void remove(int index) noexcept
Definition: serializableobjectlist.h:362
void performUndo() override
Undo the command.
Definition: cmdlistelementinsert.h:72