Public Types | Public Member Functions | Protected Slots | Protected Member Functions | List of all members
iqtgui::CHierarchicalCommand Class Reference

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

#include <CHierarchicalCommand.h>

Inheritance diagram for iqtgui::CHierarchicalCommand:
iprm::CEnableableParam iprm::CNameParam istd::THierarchicalBase< ibase::IHierarchicalCommand > iprm::IEnableableParam iprm::INameParam istd::TChangeDelegator< ibase::IHierarchicalCommand > iser::ISerializable iser::ISerializable istd::TIHierarchical< Interface > istd::CChangeDelegator istd::IChangeable istd::IChangeable istd::IChangeDelegator istd::IPolymorphic istd::IPolymorphic istd::IChangeable istd::IPolymorphic

Public Types

typedef QAction BaseClass
 
typedef iprm::CEnableableParam BaseClass2
 
typedef iprm::CNameParam BaseClass3
 
- 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...
 
- 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< 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. More...
 
void InsertChild (CHierarchicalCommand *commandPtr, bool releaseFlag=false, int index=-1)
 Insert command to child list. More...
 
void RemoveChild (int index)
 Remove child at specified index. More...
 
void JoinLinkFrom (const ibase::IHierarchicalCommand *rootPtr)
 Joint the second root as links. More...
 
void SetVisuals (const QString &name, const QString &shortName, const QString &description, const QIcon &icon=QIcon())
 Set all visual elements of this command. More...
 
virtual int GetPriority () const
 
virtual int GetGroupId () const
 
virtual int GetStaticFlags () const
 
virtual bool Execute (istd::IPolymorphic *contextPtr)
 
virtual int GetChildsCount () const
 Get number of childs. More...
 
virtual ibase::ICommandGetChild (int index) const
 Get child value. More...
 
virtual void SetName (const QString &name)
 Set the object name. More...
 
virtual bool SetEnabled (bool isEnabled=true)
 Set something to isEnabled state. More...
 
virtual bool Serialize (iser::IArchive &archive)
 Load or store state of this object as a archive stream. More...
 
virtual int GetSupportedOperations () const
 Get set of flags for supported operations. More...
 
virtual bool CopyFrom (const istd::IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS)
 Copy this object from another one. More...
 
virtual bool IsEqual (const istd::IChangeable &object) const
 Compare this object with another object. More...
 
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)
 
virtual bool IsEnabled () const
 Return a true, if something is enabled. More...
 
virtual bool IsEnablingAllowed () const
 Return a true, if something can be enabled. More...
 
virtual bool CopyFrom (const IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS)
 
- Public Member Functions inherited from iser::ISerializable
virtual quint32 GetMinimalVersion (int versionId) const
 Get minimal needed version to correct storing of this data. More...
 
- Public Member Functions inherited from istd::IChangeable
virtual bool ResetData (CompatibilityMode mode=CM_WITHOUT_REFS)
 Reset data to its default state. More...
 
virtual void BeginChanges (const ChangeSet &changeSet)
 Starts the change transaction. More...
 
virtual void EndChanges (const ChangeSet &changeSet)
 Ends the change transaction. More...
 
virtual void BeginChangeGroup (const ChangeSet &changeSet)
 Starts group of changes. More...
 
virtual void EndChangeGroup (const ChangeSet &changeSet)
 Ends group of changes. More...
 
- Public Member Functions inherited from istd::IPolymorphic
virtual ~IPolymorphic ()
 
- Public Member Functions inherited from iprm::CNameParam
virtual const QString & GetName () const
 Get the object name. More...
 
virtual bool IsNameFixed () const
 Return true, if the name setting is enabled. More...
 
virtual bool CopyFrom (const IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS)
 
virtual istd::IChangeableCloneMe (istd::IChangeable::CompatibilityMode mode=istd::IChangeable::CM_WITHOUT_REFS) const
 Make a copy of this object. More...
 
- Public Member Functions inherited from istd::THierarchicalBase< ibase::IHierarchicalCommand >
 THierarchicalBase ()
 
virtual void SetParentPtr (typename ibase::IHierarchicalCommand::InterfaceType *parentPtr)
 
virtual int GetHierarchicalFlags () const
 
virtual typename
ibase::IHierarchicalCommand::InterfaceType
GetParent () const
 
- Public Member Functions inherited from istd::TChangeDelegator< ibase::IHierarchicalCommand >
 TChangeDelegator ()
 
 TChangeDelegator (istd::IChangeable *slavePtr)
 
virtual void OnBeginChanges ()
 Callback function for begin change event. More...
 
virtual void OnEndChanges (const istd::IChangeable::ChangeSet &changeSet)
 Callback function for end change event. More...
 
- Public Member Functions inherited from istd::CChangeDelegator
 CChangeDelegator ()
 
 CChangeDelegator (istd::IChangeable *slavePtr)
 
virtual void SetSlavePtr (istd::IChangeable *slavePtr)
 Gets the slave object pointer. More...
 
virtual istd::IChangeableGetSlavePtr () const
 Sets the slave object pointer. More...
 

Protected Slots

void OnTriggered ()
 

Protected Member Functions

int FindTheSameCommand (const ibase::IHierarchicalCommand &command) const
 Find the same command in child list. More...
 
int FindInsertingIndex (int priority) const
 Find index where element with specified priority should be inserted. More...
 

Additional Inherited Members

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

Detailed Description

Implementation of hierarchical command based on QAction from Qt.

Definition at line 29 of file CHierarchicalCommand.h.

Member Typedef Documentation

Definition at line 38 of file CHierarchicalCommand.h.

Definition at line 39 of file CHierarchicalCommand.h.

Definition at line 40 of file CHierarchicalCommand.h.

Constructor & Destructor Documentation

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

Member Function Documentation

virtual bool iqtgui::CHierarchicalCommand::CopyFrom ( const istd::IChangeable object,
CompatibilityMode  mode = CM_WITHOUT_REFS 
)
virtual

Copy this object from another one.

Default implementation in istd::IChangeable does nothing.

Reimplemented from istd::IChangeable.

virtual bool iqtgui::CHierarchicalCommand::Execute ( istd::IPolymorphic contextPtr)
virtual
int iqtgui::CHierarchicalCommand::FindInsertingIndex ( int  priority) const
protected

Find index where element with specified priority should be inserted.

int iqtgui::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.
virtual ibase::ICommand* iqtgui::CHierarchicalCommand::GetChild ( int  index) const
virtual
virtual int iqtgui::CHierarchicalCommand::GetChildsCount ( ) const
virtual

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.

Reimplemented from istd::THierarchicalBase< ibase::IHierarchicalCommand >.

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

virtual int iqtgui::CHierarchicalCommand::GetGroupId ( ) const
virtual
virtual int iqtgui::CHierarchicalCommand::GetPriority ( ) const
virtual
virtual int iqtgui::CHierarchicalCommand::GetStaticFlags ( ) const
virtual
virtual int iqtgui::CHierarchicalCommand::GetSupportedOperations ( ) const
virtual

Get set of flags for supported operations.

See Also
SupportedOperations

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.

Parameters
commandPtrpointer to child command instance. It cannot be NULL.
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.
virtual bool iqtgui::CHierarchicalCommand::IsEqual ( const istd::IChangeable object) const
virtual

Compare this object with another object.

Parameters
objectObject to be compared
Returns
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.

Parameters
rootPtrpointer to root of commands tree. It cannot be NULL.
void iqtgui::CHierarchicalCommand::OnTriggered ( )
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 childs.

virtual bool iqtgui::CHierarchicalCommand::Serialize ( iser::IArchive archive)
virtual

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.

virtual bool iqtgui::CHierarchicalCommand::SetEnabled ( bool  isEnabled = true)
virtual

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 iqtgui::CHierarchicalCommand::SetGroupId ( int  groupId)
virtual void iqtgui::CHierarchicalCommand::SetName ( const QString &  name)
virtual

Set the object name.

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.

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:

© 2007-2017 Witold Gantzke and Kirill Lepskiy