![]() |
ICF 3.0.5.47
Technical documentation of ICF Libraries
|
Implementation of hierarchical command based on QAction
from Qt.
More...
#include <CHierarchicalCommand.h>
Public Member Functions | |
CHierarchicalCommand (const QString &name="", int priority=100, int staticFlags=CF_GLOBAL_MENU, int groupId=GI_NORMAL) | |
void | SetPriority (int priority) |
void | SetStaticFlags (int flags) |
void | SetGroupId (int groupId) |
void | ResetChilds () |
Reset list of childs. | |
void | InsertChild (istd::TOptDelPtr< CHierarchicalCommand > &&commandPtr, 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. | |
int | GetPriority () const override |
int | GetGroupId () const override |
int | GetStaticFlags () const override |
bool | Execute (istd::IPolymorphic *contextPtr) override |
int | GetChildsCount () const override |
Get number of childs. | |
ibase::ICommand * | GetChild (int index) const override |
Get child value. | |
void | SetName (const QString &name) override |
Set the object name. | |
bool | SetEnabled (bool isEnabled=true) override |
Set something to isEnabled state. | |
bool | Serialize (iser::IArchive &archive) override |
Load or store state of this object as a archive stream. | |
int | GetSupportedOperations () const override |
Get set of flags for supported operations. | |
bool | CopyFrom (const istd::IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS) override |
Copy this object from another one. | |
std::unique_ptr< istd::IChangeable > | CloneMe (istd::IChangeable::CompatibilityMode mode=istd::IChangeable::CM_WITHOUT_REFS) const override |
Make a copy of this object. | |
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) |
![]() | |
CEnableableParam (bool isEnabled=true) | |
bool | IsEnabled () const override |
Return a true , if something is enabled. | |
bool | IsEnablingAllowed () const override |
Return a true , if something can be enabled. | |
bool | CopyFrom (const IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS) override |
![]() | |
![]() | |
virtual quint32 | GetMinimalVersion (int versionId) const |
Get minimal needed version to correct storing of this data. | |
![]() | |
virtual bool | ResetData (CompatibilityMode mode=CM_WITHOUT_REFS) |
Reset data to its default state. | |
virtual QMutex * | GetChangesLock () const |
Get mutex beeing locked during changes, if available. | |
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. | |
![]() | |
CNameParam (const QString &name="") | |
const QString & | GetName () const override |
Get the object name. | |
void | SetName (const QString &name) override |
Set the object name. | |
bool | IsNameFixed () const override |
Return true , if the name setting is enabled. | |
bool | Serialize (iser::IArchive &archive) override |
Load or store state of this object as a archive stream. | |
bool | CopyFrom (const IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS) override |
std::unique_ptr< istd::IChangeable > | CloneMe (istd::IChangeable::CompatibilityMode mode=istd::IChangeable::CM_WITHOUT_REFS) const override |
Make a copy of this object. | |
![]() | |
![]() | |
THierarchicalBase () | |
virtual void | SetParentPtr (typename ibase::IHierarchicalCommand::InterfaceType *parentPtr) |
int | GetHierarchicalFlags () const override |
int | GetChildsCount () const override |
typename ibase::IHierarchicalCommand::InterfaceType * | GetChild (int index) const override |
typename ibase::IHierarchicalCommand::InterfaceType * | GetParent () const override |
![]() | |
TChangeDelegator () | |
TChangeDelegator (istd::IChangeable *slavePtr) | |
virtual void | OnBeginChanges () |
Callback function for begin change event. | |
virtual void | OnEndChanges (const istd::IChangeable::ChangeSet &changeSet) |
Callback function for end change event. | |
![]() | |
![]() | |
CChangeDelegator () | |
CChangeDelegator (istd::IChangeable *slavePtr) | |
virtual void | SetSlavePtr (istd::IChangeable *slavePtr) |
Gets the slave object pointer. | |
virtual istd::IChangeable * | GetSlavePtr () const |
Sets 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 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. | |
![]() | |
QString | m_name |
![]() | |
typename ibase::IHierarchicalCommand::InterfaceType * | m_parentPtr |
Implementation of hierarchical command based on QAction
from Qt.
Definition at line 30 of file CHierarchicalCommand.h.
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.
You may check, if this functionality is supported over GetSupportedOperations()
.
Reimplemented from iprm::CEnableableParam.
|
overridevirtual |
Copy this object from another one.
Default implementation in istd::IChangeable does nothing. You may check, if this functionality is supported over GetSupportedOperations()
.
Reimplemented from istd::IChangeable.
|
override |
|
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 |
Get child value.
Implements istd::TIHierarchical< Interface >.
Referenced by istdgui::CCommandTools::CreateMenu().
|
overridevirtual |
Get number of childs.
For single direction graph when only parent connection is stored it will be always 0. To check if this feature is supported check HF_CHILDS_SUPPORTED in flags.
Implements istd::TIHierarchical< Interface >.
Referenced by istdgui::CCommandTools::CreateMenu().
|
override |
Referenced by istdgui::CCommandTools::CreateMenu().
|
override |
|
override |
Referenced by istdgui::CCommandTools::CreateMenu().
|
overridevirtual |
Get set of flags for supported operations.
Reimplemented from istd::IChangeable.
void istdgui::CHierarchicalCommand::InsertChild | ( | istd::TOptDelPtr< CHierarchicalCommand > && | commandPtr, |
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 nullptr. |
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 You may check, if this functionality is supported over GetSupportedOperations() . |
true
if the objects are identical and false
otherwise. Reimplemented from istd::IChangeable.
void istdgui::CHierarchicalCommand::JoinLinkFrom | ( | const ibase::IHierarchicalCommand * | rootPtr | ) |
Joint the second root as links.
rootPtr | pointer to root of commands tree. It cannot be nullptr. |
|
protectedslot |
bool istdgui::CHierarchicalCommand::operator!= | ( | const CHierarchicalCommand & | command | ) | const |
CHierarchicalCommand & istdgui::CHierarchicalCommand::operator= | ( | const CHierarchicalCommand & | command | ) |
bool istdgui::CHierarchicalCommand::operator== | ( | const CHierarchicalCommand & | command | ) | const |
void istdgui::CHierarchicalCommand::RemoveChild | ( | int | index | ) |
Remove child at specified index.
void istdgui::CHierarchicalCommand::ResetChilds | ( | ) |
Reset list of childs.
|
overridevirtual |
Load or store state of this object as a archive stream.
Type of operation is depending on archive type.
Reimplemented from iprm::CEnableableParam.
|
overridevirtual |
Set something to isEnabled
state.
The method returns true
if the changing of the enabling status was allowed, otherwise false
.
Reimplemented from iprm::CEnableableParam.
void istdgui::CHierarchicalCommand::SetGroupId | ( | int | groupId | ) |
|
overridevirtual |
Set the object name.
Implements iprm::INameParam.
void istdgui::CHierarchicalCommand::SetPriority | ( | int | priority | ) |
void istdgui::CHierarchicalCommand::SetStaticFlags | ( | int | flags | ) |
void istdgui::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. |
© Witold Gantzke and Kirill Lepskiy