LibrePCB Developers Documentation
Loading...
Searching...
No Matches
CmdProjectLibraryAddElement< ElementType > Class Template Referencefinal

The CmdProjectLibraryAddElement class. More...

#include <cmdprojectlibraryaddelement.h>

+ Inheritance diagram for CmdProjectLibraryAddElement< ElementType >:
+ Collaboration diagram for CmdProjectLibraryAddElement< ElementType >:

Public Member Functions

 CmdProjectLibraryAddElement (ProjectLibrary &library, ElementType &element) noexcept
 
 ~CmdProjectLibraryAddElement () noexcept
 
- Public Member Functions inherited from UndoCommand
 UndoCommand ()=delete
 
 UndoCommand (const UndoCommand &other)=delete
 
 UndoCommand (const QString &text) noexcept
 
virtual ~UndoCommand () noexcept
 
const QString & getText () const noexcept
 
bool wasEverExecuted () const noexcept
 This method shows whether that command was ever executed (execute() called successfully)
 
bool wasEverReverted () const noexcept
 This method shows whether that command was ever reverted (undo() called at least one time)
 
bool isCurrentlyExecuted () const noexcept
 This method shows whether that command is currently executed (redo() called one time more than undo())
 
virtual bool execute () final
 Execute the command (must only be called once)
 
virtual void undo () final
 Undo the command.
 
virtual void redo () final
 Redo the command.
 
UndoCommandoperator= (const UndoCommand &rhs)=delete
 

Private Member Functions

bool performExecute () override
 Execute the command the first time.
 
void performUndo () override
 Undo the command.
 
void performRedo () override
 Redo the command.
 
void addElement ()
 
void removeElement ()
 
void addElement ()
 
void addElement ()
 
void addElement ()
 
void addElement ()
 
void removeElement ()
 
void removeElement ()
 
void removeElement ()
 
void removeElement ()
 

Private Attributes

ProjectLibrarymLibrary
 
ElementType & mElement
 

Additional Inherited Members

Detailed Description

template<typename ElementType>
class librepcb::editor::CmdProjectLibraryAddElement< ElementType >

The CmdProjectLibraryAddElement class.

Constructor & Destructor Documentation

◆ CmdProjectLibraryAddElement()

template<typename ElementType >
CmdProjectLibraryAddElement ( ProjectLibrary library,
ElementType &  element 
)
noexcept

◆ ~CmdProjectLibraryAddElement()

template<typename ElementType >
~CmdProjectLibraryAddElement ( )
noexcept

Member Function Documentation

◆ performExecute()

template<typename ElementType >
bool performExecute ( )
overrideprivatevirtual

Execute the command the first time.

Note
This method must be implemented in all derived classes. If the first time execution is exactly identical to an "redo" action, you can simple call librepcb::editor::UndoCommand::performRedo() in the implementation of this method.
Return values
trueIf the command has done some changes
falseIf the command has done nothing (the command can be deleted)

Implements UndoCommand.

◆ performUndo()

template<typename ElementType >
void performUndo ( )
overrideprivatevirtual

Undo the command.

Note
This method must be implemented in all derived classes.

Implements UndoCommand.

◆ performRedo()

template<typename ElementType >
void performRedo ( )
overrideprivatevirtual

Redo the command.

Note
This method must be implemented in all derived classes.

Implements UndoCommand.

◆ addElement() [1/5]

template<typename ElementType >
void addElement ( )
private

◆ removeElement() [1/5]

template<typename ElementType >
void removeElement ( )
private

◆ addElement() [2/5]

void addElement ( )
private

◆ addElement() [3/5]

void addElement ( )
private

◆ addElement() [4/5]

void addElement ( )
private

◆ addElement() [5/5]

void addElement ( )
private

◆ removeElement() [2/5]

void removeElement ( )
private

◆ removeElement() [3/5]

void removeElement ( )
private

◆ removeElement() [4/5]

void removeElement ( )
private

◆ removeElement() [5/5]

void removeElement ( )
private

Member Data Documentation

◆ mLibrary

template<typename ElementType >
ProjectLibrary& mLibrary
private

◆ mElement

template<typename ElementType >
ElementType& mElement
private

The documentation for this class was generated from the following files: