HAL
hal::ActionSetObjectData Class Reference

#include <action_set_object_data.h>

Inheritance diagram for hal::ActionSetObjectData:
Inheritance graph
Collaboration diagram for hal::ActionSetObjectData:
Collaboration graph

Public Member Functions

 ActionSetObjectData (QString category=QString(), QString key=QString(), QString type=QString(), QString val=QString())
 
bool exec () override
 
QString tagname () const override
 
void writeToXml (QXmlStreamWriter &xmlOut) const override
 
void readFromXml (QXmlStreamReader &xmlIn) override
 
void addToHash (QCryptographicHash &cryptoHash) const override
 
void setChangeKeyAndOrCategory (QString oldCategory, QString oldKey)
 
- Public Member Functions inherited from hal::UserAction
virtual ~UserAction ()
 
virtual UserActionObject object () const
 
virtual void setObject (const UserActionObject &obj)
 
int compoundOrder () const
 
void setCompoundOrder (int cmpord)
 
qint64 timeStamp () const
 
QString cryptographicHash (int recordNo) const
 
UserActionundoAction () const
 
QString debugDump () const
 
void setObjectLock (bool lock)
 
void setParentObjectLock (bool lock)
 
bool hasProjectModified () const
 

Additional Inherited Members

- Protected Member Functions inherited from hal::UserAction
 UserAction ()
 
void writeParentObjectToXml (QXmlStreamWriter &xmlOut) const
 
void readParentObjectFromXml (QXmlStreamReader &xmlIn)
 
- Static Protected Member Functions inherited from hal::UserAction
static QString setToText (const QSet< u32 > &set)
 
static QSet< u32setFromText (const QString &s)
 
static QString gridToText (const QHash< hal::Node, QPoint > &grid)
 
static QHash< hal::Node, QPointgridFromText (const QString &txt)
 
- Protected Attributes inherited from hal::UserAction
UserActionObject mObject
 
UserActionObject mParentObject
 
int mCompoundOrder
 
UserActionmUndoAction
 
qint64 mTimeStamp
 
bool mObjectLock
 
bool mParentObjectLock
 
bool mProjectModified
 

Detailed Description

Definition at line 31 of file action_set_object_data.h.

Constructor & Destructor Documentation

◆ ActionSetObjectData()

hal::ActionSetObjectData::ActionSetObjectData ( QString  category = QString(),
QString  key = QString(),
QString  type = QString(),
QString  val = QString() 
)

Definition at line 16 of file action_set_object_data.cpp.

Referenced by exec().

Member Function Documentation

◆ addToHash()

void hal::ActionSetObjectData::addToHash ( QCryptographicHash cryptoHash) const
overridevirtual

Hook for derived classes to add parameter to cryptographic hash.

Parameters
cryptoHash- Additional hash data.

Reimplemented from hal::UserAction.

Definition at line 116 of file action_set_object_data.cpp.

References QCryptographicHash::addData(), and QString::toUtf8().

◆ exec()

◆ readFromXml()

void hal::ActionSetObjectData::readFromXml ( QXmlStreamReader xmlIn)
overridevirtual

Reads user interaction as well as arguments from xml macro file.

Parameters
xmlIn- The xml reader.

Reimplemented from hal::UserAction.

Definition at line 91 of file action_set_object_data.cpp.

References QXmlStreamReader::name(), QXmlStreamReader::readElementText(), and QXmlStreamReader::readNextStartElement().

◆ setChangeKeyAndOrCategory()

void hal::ActionSetObjectData::setChangeKeyAndOrCategory ( QString  oldCategory,
QString  oldKey 
)

This function must be called when the key and/or category property of an already existing entry shall to be modified. Otherwise, instead of changing the 4 tupel from (oldKey, oldCat, oldType, oldVal) to (newKey, newCat, newType, newVal), a new entry would be inserted and both of them would coexist. (This also applies if, for example, one wants to only modify the category)

Parameters
oldKey- The old key that is to "potentionally" overwritten.
oldCategory- The old category that is to "potentionally" overwritten.

Definition at line 135 of file action_set_object_data.cpp.

Referenced by exec().

◆ tagname()

QString hal::ActionSetObjectData::tagname ( ) const
overridevirtual

The xml tagname for the action is purely virtual and needs to be implemented in derived class.

Returns
The tagname.

Implements hal::UserAction.

Definition at line 73 of file action_set_object_data.cpp.

References hal::ActionSetObjectDataFactory::sFactory, and hal::UserActionFactory::tagname().

◆ writeToXml()

void hal::ActionSetObjectData::writeToXml ( QXmlStreamWriter xmlOut) const
overridevirtual

Persist user interaction in xml macro file.

Parameters
xmlOut- The xml writer.

Reimplemented from hal::UserAction.

Definition at line 78 of file action_set_object_data.cpp.

References QXmlStreamWriter::writeTextElement().


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