SymbolEditor  1.3.0
 All Classes Files Functions Variables Enumerations Enumerator Friends Pages
UpdateSymbolCommand Class Reference

Update symbol command class;. More...

#include <Commands.h>

Inheritance diagram for UpdateSymbolCommand:
Collaboration diagram for UpdateSymbolCommand:

Public Member Functions

 UpdateSymbolCommand (SymbolLibrary *library, qint16 index, const Symbol &symbol)
 
virtual ~UpdateSymbolCommand ()
 
virtual void undo ()
 
virtual void redo ()
 

Private Attributes

SymbolLibrarym_symbolLibrary
 
qint16 m_index
 
Symbol m_symbol
 
Symbol m_originalSymbol
 

Detailed Description

Update symbol command class;.

Implement updating a symbol in the library using the index specified. The index may be 0 for new symbols and a new index will be generated by the library.

The original Symbol is stored for a possible undo.

Definition at line 191 of file Commands.h.

Constructor & Destructor Documentation

UpdateSymbolCommand::UpdateSymbolCommand ( SymbolLibrary library,
qint16  index,
const Symbol symbol 
)

Constructor

Parameters
librarya pointer to the SymbolLibrary
indexthe index of the symbol to be updated
symbola const reference to a Symbol representing the updated symbol

Definition at line 331 of file Commands.cpp.

UpdateSymbolCommand::~UpdateSymbolCommand ( )
virtual

Destructor

Definition at line 343 of file Commands.cpp.

Member Function Documentation

void UpdateSymbolCommand::redo ( )
virtual

Redo the update symbol command. The original Symbol is saved for undo. This may be empty. The new Symbol is set in the library for the given index. If the index is 0 a new index is generated, returned and saved for undo.

Definition at line 368 of file Commands.cpp.

Here is the call graph for this function:

void UpdateSymbolCommand::undo ( )
virtual

Undo the update symbol command. If the original path was not empty it is restored to the indexed symbol otherwise the indexes symbol is removed from the library.

Definition at line 352 of file Commands.cpp.

Here is the call graph for this function:

Member Data Documentation

qint16 UpdateSymbolCommand::m_index
private

index of the symbol in the library

Definition at line 202 of file Commands.h.

Symbol UpdateSymbolCommand::m_originalSymbol
private

original symbol to be restored on undo

Definition at line 204 of file Commands.h.

Symbol UpdateSymbolCommand::m_symbol
private

the updated symbol

Definition at line 203 of file Commands.h.

SymbolLibrary* UpdateSymbolCommand::m_symbolLibrary
private

pointer to the symbol library

Definition at line 201 of file Commands.h.


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