ICF 3.0.5.47
Technical documentation of ICF Libraries
istdgui::CHierarchicalCommand Class Reference

Implementation of hierarchical command based on QAction from Qt. More...

#include <CHierarchicalCommand.h>

Inheritance diagram for istdgui::CHierarchicalCommand:
Collaboration diagram for istdgui::CHierarchicalCommand:

Public Types

typedef QAction BaseClass
 
typedef iprm::CEnableableParam BaseClass2
 
typedef iprm::CNameParam BaseClass3
 
- Public Types inherited from iprm::IEnableableParam
enum  ChangeFlags { CF_ENABLED = 0x089347 }
 
- Public Types inherited from istd::IChangeable
enum  ChangeFlags {
  CF_ICF_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 , SO_CHANGE_LOCK = 1 << 5
}
 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...
 
- 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::IHierarchicalCommandBaseClass
 
- Public Types inherited from istd::TChangeDelegator< ibase::IHierarchicalCommand >
typedef ibase::IHierarchicalCommand BaseClass
 
typedef CChangeDelegator BaseClass2
 
- Public Types inherited from istd::TIHierarchical< Interface >
enum  HierarchicalFlags { HF_CHILDS_SUPPORTED = 0x01 , HF_PARENT_SUPPORTED = 0x02 }
 Flags describing supported features of this hierarchical graph. More...
 
typedef Interface InterfaceType
 
- 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)
 
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::ICommandGetChild (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::IChangeableCloneMe (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
 
CHierarchicalCommandoperator= (const CHierarchicalCommand &command)
 
- Public Member Functions inherited from iprm::CEnableableParam
 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
 
- Public Member Functions inherited from iprm::IEnableableParam
- 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 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.
 
- Public Member Functions inherited from iprm::CNameParam
 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::IChangeableCloneMe (istd::IChangeable::CompatibilityMode mode=istd::IChangeable::CM_WITHOUT_REFS) const override
 Make a copy of this object.
 
- Public Member Functions inherited from iprm::INameParam
- Public Member Functions inherited from istd::THierarchicalBase< ibase::IHierarchicalCommand >
 THierarchicalBase ()
 
virtual void SetParentPtr (typename ibase::IHierarchicalCommand::InterfaceType *parentPtr)
 
int GetHierarchicalFlags () const override
 
int GetChildsCount () const override
 
typename ibase::IHierarchicalCommand::InterfaceTypeGetChild (int index) const override
 
typename ibase::IHierarchicalCommand::InterfaceTypeGetParent () const override
 
- Public Member Functions inherited from istd::TChangeDelegator< ibase::IHierarchicalCommand >
 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.
 
- Public Member Functions inherited from istd::TIHierarchical< Interface >
- Public Member Functions inherited from istd::CChangeDelegator
 CChangeDelegator ()
 
 CChangeDelegator (istd::IChangeable *slavePtr)
 
virtual void SetSlavePtr (istd::IChangeable *slavePtr)
 Gets the slave object pointer.
 
virtual istd::IChangeableGetSlavePtr () const
 Sets the slave object pointer.
 
- Public Member Functions inherited from istd::IChangeDelegator

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.
 
- Protected Member Functions inherited from istd::IChangeable

Additional Inherited Members

- Static Public Member Functions inherited from istd::IChangeable
static const ChangeSetGetNoChanges ()
 Get empty set of changes.
 
static const ChangeSetGetAnyChange ()
 Get anonymous change set.
 
static const ChangeSetGetAllChanges ()
 Get anonymous change set.
 
static const ChangeSetGetDelegatedChanges ()
 Get delegated change set.
 
- Protected Attributes inherited from iprm::CNameParam
QString m_name
 
- Protected Attributes inherited from istd::THierarchicalBase< ibase::IHierarchicalCommand >
typename ibase::IHierarchicalCommand::InterfaceTypem_parentPtr
 

Detailed Description

Implementation of hierarchical command based on QAction from Qt.

Definition at line 30 of file CHierarchicalCommand.h.

Member Typedef Documentation

◆ BaseClass

◆ BaseClass2

◆ BaseClass3

Constructor & Destructor Documentation

◆ CHierarchicalCommand()

istdgui::CHierarchicalCommand::CHierarchicalCommand ( const QString & name = "",
int priority = 100,
int staticFlags = CF_GLOBAL_MENU,
int groupId = GI_NORMAL )
explicit

Member Function Documentation

◆ CloneMe()

std::unique_ptr< istd::IChangeable > istdgui::CHierarchicalCommand::CloneMe ( istd::IChangeable::CompatibilityMode mode = istd::IChangeable::CM_WITHOUT_REFS) const
overridevirtual

Make a copy of this object.

You may check, if this functionality is supported over GetSupportedOperations().

Returns
new instance or nullptr, if this operation is not supported.

Reimplemented from iprm::CEnableableParam.

◆ CopyFrom()

bool istdgui::CHierarchicalCommand::CopyFrom ( const istd::IChangeable & object,
CompatibilityMode mode = CM_WITHOUT_REFS )
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.

◆ Execute()

bool istdgui::CHierarchicalCommand::Execute ( istd::IPolymorphic * contextPtr)
override

◆ FindInsertingIndex()

int istdgui::CHierarchicalCommand::FindInsertingIndex ( int priority) const
protected

Find index where element with specified priority should be inserted.

◆ FindTheSameCommand()

int istdgui::CHierarchicalCommand::FindTheSameCommand ( const ibase::IHierarchicalCommand & command) const
protected

Find the same command in child list.

Parameters
commandcommand will be used as search template.
Returns
index of found child or negative value, if no child is found.

◆ GetChild()

ibase::ICommand * istdgui::CHierarchicalCommand::GetChild ( int index) const
overridevirtual

Get child value.

Implements istd::TIHierarchical< Interface >.

Referenced by istdgui::CCommandTools::CreateMenu().

◆ GetChildsCount()

int istdgui::CHierarchicalCommand::GetChildsCount ( ) const
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().

◆ GetGroupId()

int istdgui::CHierarchicalCommand::GetGroupId ( ) const
override

◆ GetPriority()

int istdgui::CHierarchicalCommand::GetPriority ( ) const
override

◆ GetStaticFlags()

int istdgui::CHierarchicalCommand::GetStaticFlags ( ) const
override

◆ GetSupportedOperations()

int istdgui::CHierarchicalCommand::GetSupportedOperations ( ) const
overridevirtual

Get set of flags for supported operations.

See also
SupportedOperations

Reimplemented from istd::IChangeable.

◆ InsertChild()

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.

Parameters
commandPtrpointer to child command instance. It cannot be nullptr.
releaseFlagif true, command instance will be automatically removed.
indexindex position of command to be inserted. Negative value indicate end of collection. Please note, that position can be other in merged tree.

◆ IsEqual()

bool istdgui::CHierarchicalCommand::IsEqual ( const istd::IChangeable & object) const
overridevirtual

Compare this object with another object.

Parameters
objectObject to be compared You may check, if this functionality is supported over GetSupportedOperations().
Returns
true if the objects are identical and false otherwise.

Reimplemented from istd::IChangeable.

◆ JoinLinkFrom()

void istdgui::CHierarchicalCommand::JoinLinkFrom ( const ibase::IHierarchicalCommand * rootPtr)

Joint the second root as links.

Parameters
rootPtrpointer to root of commands tree. It cannot be nullptr.

◆ OnTriggered

void istdgui::CHierarchicalCommand::OnTriggered ( )
protectedslot

◆ operator!=()

bool istdgui::CHierarchicalCommand::operator!= ( const CHierarchicalCommand & command) const

◆ operator=()

CHierarchicalCommand & istdgui::CHierarchicalCommand::operator= ( const CHierarchicalCommand & command)

◆ operator==()

bool istdgui::CHierarchicalCommand::operator== ( const CHierarchicalCommand & command) const

◆ RemoveChild()

void istdgui::CHierarchicalCommand::RemoveChild ( int index)

Remove child at specified index.

◆ ResetChilds()

void istdgui::CHierarchicalCommand::ResetChilds ( )

Reset list of childs.

◆ Serialize()

bool istdgui::CHierarchicalCommand::Serialize ( iser::IArchive & archive)
overridevirtual

Load or store state of this object as a archive stream.

Type of operation is depending on archive type.

See also
iser::IArchive

Reimplemented from iprm::CEnableableParam.

◆ SetEnabled()

bool istdgui::CHierarchicalCommand::SetEnabled ( bool isEnabled = true)
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.

◆ SetGroupId()

void istdgui::CHierarchicalCommand::SetGroupId ( int groupId)

◆ SetName()

void istdgui::CHierarchicalCommand::SetName ( const QString & name)
overridevirtual

Set the object name.

Implements iprm::INameParam.

◆ SetPriority()

void istdgui::CHierarchicalCommand::SetPriority ( int priority)

◆ SetStaticFlags()

void istdgui::CHierarchicalCommand::SetStaticFlags ( int flags)

◆ SetVisuals()

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.

Parameters
namegeneral name, used in menus.
shortNameshort version of name used in toolbars.
descriptiondescription used as tool tip.
iconicon shown in menus and toolbars.

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

© Witold Gantzke and Kirill Lepskiy