|
ACF $AcfVersion:0$
|
Implementation of hierarchical command based on QAction from Qt.
More...
#include <CHierarchicalCommand.h>
Public Types | |
| typedef QAction | BaseClass |
| typedef iprm::CEnableableParam | BaseClass2 |
| typedef iprm::CNameParam | BaseClass3 |
Public Types inherited from iprm::IEnableableParam | |
| enum | ChangeFlags { CF_ENABLED = 0x089347 } |
| Change notification flags. More... | |
Public Types inherited from istd::IChangeable | |
| enum | ChangeFlags { CF_ACF_INTERNAL = 0 , CF_ALL_DATA , CF_ANY , CF_DESTROYING , CF_DELEGATED , CF_NO_UNDO } |
| Data model change notification flags. More... | |
| enum | SupportedOperations { SO_NONE = 0 , SO_OBSERVE = 1 << 0 , SO_COPY = 1 << 1 , SO_CLONE = 1 << 2 , SO_COMPARE = 1 << 3 , SO_RESET = 1 << 4 } |
| Flags for supported operations. More... | |
| enum | CompatibilityMode { CM_STRICT , CM_WITHOUT_REFS , CM_WITH_REFS , CM_CONVERT } |
| Control how relationship betweeen objects are interpreted. More... | |
| typedef QMultiMap< QByteArray, QVariant > | ChangeInfoMap |
Public Types inherited from iprm::INameParam | |
| enum | ChangeFlags { CF_RENAME = 0x15345e0 } |
| Data model change notification flags. More... | |
Public Types inherited from istd::THierarchicalBase< ibase::IHierarchicalCommand > | |
| typedef istd::TChangeDelegator< ibase::IHierarchicalCommand > | BaseClass |
Public Types inherited from istd::TChangeDelegator< Base > | |
| typedef Base | BaseClass |
| typedef CChangeDelegator | BaseClass2 |
Public Types inherited from istd::CChangeDelegator | |
| typedef istd::IChangeable | BaseClass |
Public Member Functions | |
| CHierarchicalCommand (const QString &name="", int priority=100, int staticFlags=CF_GLOBAL_MENU, int groupId=GI_NORMAL, const QByteArray &commandId=QByteArray()) | |
| void | SetPriority (int priority) |
| void | SetStaticFlags (int flags) |
| void | SetCommandId (const QByteArray &commandId) |
| void | SetGroupId (int groupId) |
| void | ResetChilds () |
| Reset list of children. | |
| void | InsertChild (CHierarchicalCommand *commandPtr, bool releaseFlag=false, int index=-1) |
| Insert command to child list. | |
| void | RemoveChild (int index) |
| Remove child at specified index. | |
| void | JoinLinkFrom (const ibase::IHierarchicalCommand *rootPtr) |
| Joint the second root as links. | |
| void | SetVisuals (const QString &name, const QString &shortName, const QString &description, const QIcon &icon=QIcon()) |
| Set all visual elements of this command. | |
| virtual int | GetPriority () const override |
| virtual QByteArray | GetCommandId () const override |
| virtual int | GetGroupId () const override |
| virtual int | GetStaticFlags () const override |
| virtual bool | Execute (istd::IPolymorphic *contextPtr) override |
| virtual int | GetChildsCount () const override |
| virtual ibase::ICommand * | GetChild (int index) const override |
| virtual void | SetName (const QString &name) override |
| Set the object name. | |
| virtual bool | SetEnabled (bool isEnabled=true) override |
| Set the enabled state. | |
| virtual bool | Serialize (iser::IArchive &archive) override |
| Load or store state of this object as a archive stream. | |
| virtual int | GetSupportedOperations () const override |
| Get set of flags for supported operations. | |
| virtual bool | CopyFrom (const istd::IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS) override |
| Copy this object from another one. | |
| virtual istd::IChangeableUniquePtr | CloneMe (istd::IChangeable::CompatibilityMode mode=istd::IChangeable::CM_WITHOUT_REFS) const override |
| Make a copy of this object. | |
| virtual bool | IsEqual (const istd::IChangeable &object) const override |
| Compare this object with another object. | |
| bool | operator== (const CHierarchicalCommand &command) const |
| bool | operator!= (const CHierarchicalCommand &command) const |
| CHierarchicalCommand & | operator= (const CHierarchicalCommand &command) |
Public Member Functions inherited from iprm::CEnableableParam | |
| CEnableableParam (bool isEnabled=true) | |
| virtual bool | IsEnabled () const override |
| Return true if something is enabled. | |
| virtual bool | IsEnablingAllowed () const override |
| Return true if enabling/disabling is allowed. | |
| virtual bool | CopyFrom (const IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS) override |
Public Member Functions inherited from iser::ISerializable | |
| virtual quint32 | GetMinimalVersion (int versionId) const |
| Get minimal needed version to correct storing of this data. | |
Public Member Functions inherited from istd::IChangeable | |
| virtual void | BeginChanges (const ChangeSet &changeSet) |
| Starts the change transaction. | |
| virtual void | EndChanges (const ChangeSet &changeSet) |
| Ends the change transaction. | |
| virtual void | BeginChangeGroup (const ChangeSet &changeSet) |
| Starts group of changes. | |
| virtual void | EndChangeGroup (const ChangeSet &changeSet) |
| Ends group of changes. | |
Public Member Functions inherited from istd::IPolymorphic | |
| virtual | ~IPolymorphic () |
Public Member Functions inherited from iprm::CNameParam | |
| virtual const QString & | GetName () const override |
| Get the object name. | |
| virtual bool | IsNameFixed () const override |
| Return true if the name is fixed (non-editable). | |
| virtual bool | CopyFrom (const IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS) override |
| virtual bool | ResetData (CompatibilityMode mode=CM_WITHOUT_REFS) override |
| Reset data to its default state. | |
| virtual bool | IsEqual (const IChangeable &object) const override |
Public Member Functions inherited from istd::THierarchicalBase< ibase::IHierarchicalCommand > | |
| THierarchicalBase () | |
| virtual void | SetParentPtr (typename Base::InterfaceType *parentPtr) |
| virtual int | GetHierarchicalFlags () const override |
| virtual typename Base::InterfaceType * | GetParent () const override |
Public Member Functions inherited from istd::TChangeDelegator< Base > | |
| TChangeDelegator () | |
| TChangeDelegator (istd::IChangeable *slavePtr) | |
| virtual void | OnBeginChanges () override |
| Callback function for begin change event. | |
| virtual void | OnEndChanges (const istd::IChangeable::ChangeSet &changeSet) override |
| Callback function for end change event. | |
Public Member Functions inherited from istd::CChangeDelegator | |
| CChangeDelegator () | |
| CChangeDelegator (istd::IChangeable *slavePtr) | |
| virtual void | SetSlavePtr (istd::IChangeable *slavePtr) override |
| Sets the slave object pointer for change delegation. | |
| virtual istd::IChangeable * | GetSlavePtr () const override |
| Gets the slave object pointer. | |
Protected Slots | |
| void | OnTriggered () |
Protected Member Functions | |
| int | FindTheSameCommand (const ibase::IHierarchicalCommand &command) const |
| Find the same command in child list. | |
| int | FindInsertingIndex (int priority) const |
| Find index where element with specified priority should be inserted. | |
Additional Inherited Members | |
Static Public Member Functions inherited from istd::IChangeable | |
| static const ChangeSet & | GetNoChanges () |
| Get empty set of changes. | |
| static const ChangeSet & | GetAnyChange () |
| Get anonymous change set. | |
| static const ChangeSet & | GetAllChanges () |
| Get anonymous change set. | |
| static const ChangeSet & | GetDelegatedChanges () |
| Get delegated change set. | |
Protected Attributes inherited from iprm::CNameParam | |
| QString | m_name |
Protected Attributes inherited from istd::THierarchicalBase< ibase::IHierarchicalCommand > | |
| typename Base::InterfaceType * | m_parentPtr |
Implementation of hierarchical command based on QAction from Qt.
Definition at line 30 of file CHierarchicalCommand.h.
| typedef QAction iqtgui::CHierarchicalCommand::BaseClass |
Definition at line 39 of file CHierarchicalCommand.h.
Definition at line 40 of file CHierarchicalCommand.h.
Definition at line 41 of file CHierarchicalCommand.h.
|
explicit |
|
overridevirtual |
Make a copy of this object.
Reimplemented from iprm::CEnableableParam.
|
overridevirtual |
Copy this object from another one.
Default implementation in istd::IChangeable does nothing.
Reimplemented from istd::IChangeable.
|
overridevirtual |
|
protected |
Find index where element with specified priority should be inserted.
|
protected |
Find the same command in child list.
| command | command will be used as search template. |
|
overridevirtual |
Reimplemented from istd::THierarchicalBase< ibase::IHierarchicalCommand >.
Referenced by iqtgui::CCommandTools::CreateMenu().
|
overridevirtual |
Reimplemented from istd::THierarchicalBase< ibase::IHierarchicalCommand >.
Referenced by iqtgui::CCommandTools::CreateMenu().
|
overridevirtual |
|
overridevirtual |
Referenced by iqtgui::CCommandTools::CreateMenu().
|
overridevirtual |
|
overridevirtual |
Referenced by iqtgui::CCommandTools::CreateMenu().
|
overridevirtual |
Get set of flags for supported operations.
Reimplemented from istd::IChangeable.
| void iqtgui::CHierarchicalCommand::InsertChild | ( | CHierarchicalCommand * | commandPtr, |
| bool | releaseFlag = false, |
||
| int | index = -1 |
||
| ) |
Insert command to child list.
Please note, this pointer is not owned by this container and will not be removed.
| commandPtr | pointer to child command instance. It cannot be NULL. |
| releaseFlag | if true, command instance will be automatically removed. |
| index | index position of command to be inserted. Negative value indicate end of collection. Please note, that position can be other in merged tree. |
|
overridevirtual |
Compare this object with another object.
| object | Object to be compared |
true if the objects are identical and false otherwise. Reimplemented from istd::IChangeable.
| void iqtgui::CHierarchicalCommand::JoinLinkFrom | ( | const ibase::IHierarchicalCommand * | rootPtr | ) |
Joint the second root as links.
| rootPtr | pointer to root of commands tree. It cannot be NULL. |
|
protectedslot |
| bool iqtgui::CHierarchicalCommand::operator!= | ( | const CHierarchicalCommand & | command | ) | const |
| CHierarchicalCommand & iqtgui::CHierarchicalCommand::operator= | ( | const CHierarchicalCommand & | command | ) |
| bool iqtgui::CHierarchicalCommand::operator== | ( | const CHierarchicalCommand & | command | ) | const |
| void iqtgui::CHierarchicalCommand::RemoveChild | ( | int | index | ) |
Remove child at specified index.
| void iqtgui::CHierarchicalCommand::ResetChilds | ( | ) |
Reset list of children.
|
overridevirtual |
Load or store state of this object as a archive stream.
Type of operation is depending on archive type.
Reimplemented from iprm::CEnableableParam.
| void iqtgui::CHierarchicalCommand::SetCommandId | ( | const QByteArray & | commandId | ) |
|
overridevirtual |
Set the enabled state.
Changes whether the parameter is enabled or disabled.
| isEnabled | New enable state. true to enable, false to disable. |
Reimplemented from iprm::CEnableableParam.
| void iqtgui::CHierarchicalCommand::SetGroupId | ( | int | groupId | ) |
|
overridevirtual |
Set the object name.
Changes the name of this parameter.
| name | New name value. |
Reimplemented from iprm::CNameParam.
| void iqtgui::CHierarchicalCommand::SetPriority | ( | int | priority | ) |
| void iqtgui::CHierarchicalCommand::SetStaticFlags | ( | int | flags | ) |
| void iqtgui::CHierarchicalCommand::SetVisuals | ( | const QString & | name, |
| const QString & | shortName, | ||
| const QString & | description, | ||
| const QIcon & | icon = QIcon() |
||
| ) |
Set all visual elements of this command.
This method is designed to use in OnRetranslate() implementation and that's why it uses Qt QString.
| name | general name, used in menus. |
| shortName | short version of name used in toolbars. |
| description | description used as tool tip. |
| icon | icon shown in menus and toolbars. |