ICF 3.0.5.47
Technical documentation of ICF Libraries
idocgui::CMainWindowGuiComp Class Reference

Standard main window component for any document based application. More...

#include <CMainWindowGuiComp.h>

Inheritance diagram for idocgui::CMainWindowGuiComp:
Collaboration diagram for idocgui::CMainWindowGuiComp:

Public Types

enum  GroupId { GI_APPLICATION = 0x200 , GI_DOCUMENT , GI_UNDO , GI_RECENT_FILE }
 
enum  CommandProviderId { CPI_DOCUMENT_MANAGER = 100 , CPI_ACTIVE_VIEW , CPI_ACTIVE_DOCUMENT }
 
typedef CMainWindowGuiCompBase BaseClass
 
typedef imod::TSingleModelObserverBase< idoc::IDocumentManagerBaseClass2
 
- Public Types inherited from idocgui::CMainWindowGuiCompBase
typedef istdgui::CSimpleMainWindowGuiComp BaseClass
 
- Public Types inherited from istdgui::CSimpleMainWindowGuiComp
enum  GroupId { GI_SETTINGS = 0x400 }
 
enum  ModelId { MI_PREFERENCE_COMMAND = 0x1000 }
 
typedef CSimpleMainWindowGuiCompBase BaseClass
 
- Public Types inherited from istdgui::CSimpleMainWindowGuiCompBase
typedef istdgui::TRestorableGuiWrap< istdgui::TGuiComponentBase< QMainWindow > > BaseClass
 
- Public Types inherited from istdgui::TRestorableGuiWrap< istdgui::TGuiComponentBase< QMainWindow > >
typedef istdgui::TGuiComponentBase< QMainWindow > BaseClass
 
- Public Types inherited from istdgui::TGuiComponentBase< QMainWindow >
typedef CGuiComponentBase BaseClass
 
- Public Types inherited from istdgui::CGuiComponentBase
typedef ibase::TVisualChangesHandlerWrap< icomp::CComponentBaseBaseClass
 
- Public Types inherited from ibase::TVisualChangesHandlerWrap< icomp::CComponentBase >
typedef icomp::CComponentBase BaseClass
 

Public Member Functions

 CMainWindowGuiComp ()
 
bool OnModelAttached (imod::IModel *modelPtr, istd::IChangeable::ChangeSet &changeMask) override
 This call back function will be called, if an observable object is about to be attached.
 
bool OnModelDetached (imod::IModel *modelPtr) override
 This call back function will be called, if an observable object is about to be detached.
 
- Public Member Functions inherited from istdgui::CSimpleMainWindowGuiComp
 CSimpleMainWindowGuiComp ()
 
void OnTryClose (bool *ignoredPtr=nullptr) override
 Called on trying to close application.
 
- Public Member Functions inherited from istdgui::TGuiComponentBase< QMainWindow >
 TGuiComponentBase ()
 
virtual QMainWindow * GetQtWidget () const
 
- Public Member Functions inherited from istdgui::CGuiComponentBase
 I_REGISTER_SUBELEMENT_INTERFACE_T (VisualStatus, IVisualStatus, ExtractVisualStatus)
 
 I_REGISTER_SUBELEMENT_INTERFACE_T (VisualStatus, istd::IChangeable, ExtractVisualStatus)
 
 I_REGISTER_SUBELEMENT_INTERFACE_T (VisualStatus, imod::IModel, ExtractVisualStatus)
 
 CGuiComponentBase ()
 
bool IsGuiShown () const
 
bool IsGuiCreated () const override
 Inform if GUI was initilized.
 
QWidget * GetWidget () const override
 Get access to internal QWidget object.
 
- Public Member Functions inherited from ibase::TVisualChangesHandlerWrap< icomp::CComponentBase >
 TVisualChangesHandlerWrap (Args &&... args)
 
virtual void EnableVisualChangesHandler (bool enableLocalization=true)
 If enabled, listen to the language change event from the application context.
 
- Public Member Functions inherited from icomp::CComponentBase
 CComponentBase ()
 Create component and assign it to specific context.
 
 CComponentBase (const CComponentBase &)=delete
 
CComponentBaseoperator= (const CComponentBase &)=delete
 
virtual const ICompositeComponentGetParentComponent (bool ownerOnly=false) const
 Get parent of this component.
 
virtual void * GetInterface (const istd::CClassInfo &interfaceType, const QByteArray &subId="")
 Get access to specified component interface.
 
virtual const IComponentContextGetComponentContext () const
 Get access to component context describing all application-specified component information loaded from components registry.
 
virtual void SetComponentContext (const IComponentContext *contextPtr, const ICompositeComponent *parentPtr, bool isParentOwner)
 Set component context of this component.
 
- Public Member Functions inherited from icomp::IComponent
- Public Member Functions inherited from istdgui::IGuiObject

Protected Slots

void OnNew ()
 
void OnOpen ()
 
void OnSave ()
 
void OnSaveAs ()
 
void OnQuit ()
 
void OnUndo ()
 
void OnRedo ()
 
void OnCopyPathToClipboard ()
 
void OnOpenDocumentFolder ()
 
- Protected Slots inherited from istdgui::CSimpleMainWindowGuiComp
void OnShowToolbars ()
 
void OnFullScreen ()
 
void OnAbout ()
 
void OnHelpManual ()
 
void OnSettings ()
 
void OnShowOtherCommandTriggered (bool enabled)
 

Protected Member Functions

virtual bool OpenFile (const QString &fileName, const QByteArray *documentTypeIdPtr=nullptr)
 
virtual bool SaveActiveDocument ()
 
virtual void OnActiveViewChanged ()
 
virtual void OnActiveDocumentChanged ()
 
virtual void OnDragEnterEvent (QDragEnterEvent *dragEnterEventPtr)
 
virtual void OnDropEvent (QDropEvent *dropEventPtr)
 
void SetupNewCommand ()
 
bool HasDocumentTemplate () const
 
void UpdateUndoMenu ()
 
void OnNewDocument (const QByteArray &documentTypeId)
 
virtual bool SerializeRecentFileList (iser::IArchive &archive)
 
virtual void UpdateRecentFileList (const idoc::IDocumentManager::FileToTypeMap &fileToTypeMap)
 Updates displayed list of recent used files.
 
virtual void RemoveFromRecentFileList (const QString &filePath)
 
void UpdateFixedCommands (istdgui::CHierarchicalCommand &fixedCommands) override
 
void UpdateToolsCommands (istdgui::CHierarchicalCommand &toolsCommand) override
 
void AppendMenuActions (istdgui::CHierarchicalCommand &menuCommands) override
 
bool IsMainWindowActive (int index) const override
 
void OnGuiCreated () override
 Called just after GUI is initialized.
 
void OnGuiDestroyed () override
 Called just before GUI is released.
 
void OnRetranslate () override
 Called when non-GUI elements (like commands) should be retranslated.
 
void OnUpdate (const istd::IChangeable::ChangeSet &changeSet) override
 Called on update of observed model.
 
bool eventFilter (QObject *sourcePtr, QEvent *eventPtr) override
 
void OnComponentCreated () override
 
void OnComponentDestroyed () override
 
- Protected Member Functions inherited from istdgui::CSimpleMainWindowGuiComp
virtual void UpdateMenuActions ()
 
virtual void SetupMainWindowComponents (QMainWindow &mainWindow)
 
virtual void AddMainComponent (int componentIndex, istdgui::IMainWindowComponent &component)
 
virtual void RemoveMainComponent (istdgui::IMainWindowComponent &component)
 
virtual void CreateMenuBar ()
 
virtual void UpdateToolbarsVisibility ()
 
virtual void SetupMenu ()
 
virtual std::unique_ptr< QToolBar > CreateDefaultToolBar () const
 
virtual void UpdateViewCommands (istdgui::CHierarchicalCommand &viewCommand)
 
virtual void UpdateHelpCommands (istdgui::CHierarchicalCommand &helpCommand)
 
virtual void UpdateMainWindowComponentsVisibility ()
 Set main window visible or invisible, depending on menu commands.
 
void OnRestoreSettings (const QSettings &settings) override
 
void OnSaveSettings (QSettings &settings) const override
 
void OnGuiCreated () override
 Called just after GUI is initialized.
 
void OnGuiDestroyed () override
 Called just before GUI is released.
 
void OnRetranslate () override
 Called when non-GUI elements (like commands) should be retranslated.
 
void OnGuiShown () override
 Called from widget event filter when slave widget is shown.
 
bool eventFilter (QObject *sourcePtr, QEvent *eventPtr) override
 
- Protected Member Functions inherited from istdgui::TRestorableGuiWrap< istdgui::TGuiComponentBase< QMainWindow > >
bool CreateGui (QWidget *parentPtr) override
 
bool DestroyGui () override
 
- Protected Member Functions inherited from istdgui::TGuiComponentBase< QMainWindow >
virtual QWidget * CreateQtWidget (QWidget *parentPtr)
 Create slave widget object.
 
- Protected Member Functions inherited from istdgui::CGuiComponentBase
virtual void OnGuiHidden ()
 Called from widget event filter when slave widget is hidden.
 
virtual bool OnKeyPressed (QKeyEvent *event)
 Called from widget event filter when key is pressed.
 
virtual void OnGuiRetranslate ()
 Called from widget event filter when GUI should be retranslated.
 
void SetStatusIcon (const QIcon &icon)
 Set status icon;.
 
void SetStatusText (const QString &text)
 Set status text;.
 
void OnLanguageChanged () override
 
void OnDesignSchemaChanged () override
 
bool eventFilter (QObject *sourcePtr, QEvent *eventPtr) override
 
- Protected Member Functions inherited from ibase::TVisualChangesHandlerWrap< icomp::CComponentBase >
- Protected Member Functions inherited from icomp::CComponentBase
bool IsComponentActive () const
 Check if component is active.
 
virtual const IRealComponentStaticInfoGetComponentStaticInfo () const =0
 Get access to static info of this component.
 
- Protected Member Functions inherited from imod::TSingleModelObserverBase< idoc::IDocumentManager >
virtual idoc::IDocumentManagerCastFromModel (imod::IModel *modelPtr) const
 
 TSingleModelObserverBase ()
 
idoc::IDocumentManagerGetObservedObject () const
 Get instance of observed object.
 
idoc::IDocumentManagerGetObjectPtr () const
 Get instance of observed object.
 
bool AttachOrSetObject (idoc::IDocumentManager *objectPtr)
 Attach to model of object or set object pointer, if no connection is possible.
 
bool OnModelAttached (imod::IModel *modelPtr, istd::IChangeable::ChangeSet &changeMask) override
 This call back function will be called, if an observable object is about to be attached.
 
bool OnModelDetached (imod::IModel *modelPtr) override
 This call back function will be called, if an observable object is about to be detached.
 
- Protected Member Functions inherited from imod::CSingleModelObserverBase
void SetModelPtr (imod::IModel *modelPtr)
 Set internal model pointer to specified value.
 
 CSingleModelObserverBase ()
 
virtual ~CSingleModelObserverBase ()
 
imod::IModelGetObservedModel () const
 Get access to observed model.
 
imod::IModelGetModelPtr () const
 Get access to observed model.
 
void EnsureModelDetached ()
 Make sure this observer is detached.
 
void SetObservedIds (const istd::IChangeable::ChangeSet &changeMask)
 Set list of ID's beeing observed.
 
bool IsModelAttached (const imod::IModel *modelPtr=nullptr) const override
 Check if specified model is attached.
 
void BeforeModelChange (imod::IModel *modelPtr) override
 This function will be called before update of the observer contents occures.
 
void AfterModelChange (imod::IModel *modelPtr, const istd::IChangeable::ChangeSet &changeSet) override
 This function will be called after update of the observer contents occures.
 
- Protected Member Functions inherited from imod::IObserver

Additional Inherited Members

- Static Public Member Functions inherited from istdgui::CGuiComponentBase
static void MakeAutoSlotConnection (const QWidget &widget, QObject &object)
 
- Protected Types inherited from imod::TSingleModelObserverBase< idoc::IDocumentManager >
typedef CSingleModelObserverBase BaseClass
 
typedef idoc::IDocumentManager ModelType
 
- Protected Types inherited from imod::CSingleModelObserverBase
typedef imod::IModel ModelType
 
- Static Protected Member Functions inherited from icomp::CComponentBase
static const IRealComponentStaticInfoInitStaticInfo (IComponent *componentPtr)
 
static QByteArray GetComponentId (const IComponentContext *componentContextPtr, const QByteArray &contextId=QByteArray())
 
- Protected Attributes inherited from istdgui::CSimpleMainWindowGuiComp
CommandsObserver m_commandsObserver
 
- Protected Attributes inherited from istdgui::CGuiComponentBase
istd::CMainThreadCaller m_updateGuiCaller
 
imod::TModelWrap< VisualStatusm_visualStatus
 

Detailed Description

Standard main window component for any document based application.

Definition at line 77 of file CMainWindowGuiComp.h.

Member Typedef Documentation

◆ BaseClass

◆ BaseClass2

Member Enumeration Documentation

◆ CommandProviderId

Enumerator
CPI_DOCUMENT_MANAGER 
CPI_ACTIVE_VIEW 
CPI_ACTIVE_DOCUMENT 

Definition at line 110 of file CMainWindowGuiComp.h.

◆ GroupId

Enumerator
GI_APPLICATION 
GI_DOCUMENT 
GI_UNDO 
GI_RECENT_FILE 

Definition at line 102 of file CMainWindowGuiComp.h.

Constructor & Destructor Documentation

◆ CMainWindowGuiComp()

idocgui::CMainWindowGuiComp::CMainWindowGuiComp ( )

Member Function Documentation

◆ AppendMenuActions()

void idocgui::CMainWindowGuiComp::AppendMenuActions ( istdgui::CHierarchicalCommand & menuCommands)
overrideprotectedvirtual

Reimplemented from istdgui::CSimpleMainWindowGuiComp.

◆ eventFilter()

bool idocgui::CMainWindowGuiComp::eventFilter ( QObject * sourcePtr,
QEvent * eventPtr )
overrideprotected

◆ HasDocumentTemplate()

bool idocgui::CMainWindowGuiComp::HasDocumentTemplate ( ) const
protected

◆ IsMainWindowActive()

bool idocgui::CMainWindowGuiComp::IsMainWindowActive ( int index) const
overrideprotectedvirtual

Reimplemented from istdgui::CSimpleMainWindowGuiComp.

◆ OnActiveDocumentChanged()

virtual void idocgui::CMainWindowGuiComp::OnActiveDocumentChanged ( )
protectedvirtual

◆ OnActiveViewChanged()

virtual void idocgui::CMainWindowGuiComp::OnActiveViewChanged ( )
protectedvirtual

◆ OnComponentCreated()

void idocgui::CMainWindowGuiComp::OnComponentCreated ( )
overrideprotectedvirtual

Reimplemented from istdgui::CGuiComponentBase.

◆ OnComponentDestroyed()

void idocgui::CMainWindowGuiComp::OnComponentDestroyed ( )
overrideprotectedvirtual

Reimplemented from istdgui::CGuiComponentBase.

◆ OnCopyPathToClipboard

void idocgui::CMainWindowGuiComp::OnCopyPathToClipboard ( )
protectedslot

◆ OnDragEnterEvent()

virtual void idocgui::CMainWindowGuiComp::OnDragEnterEvent ( QDragEnterEvent * dragEnterEventPtr)
protectedvirtual

◆ OnDropEvent()

virtual void idocgui::CMainWindowGuiComp::OnDropEvent ( QDropEvent * dropEventPtr)
protectedvirtual

◆ OnGuiCreated()

void idocgui::CMainWindowGuiComp::OnGuiCreated ( )
overrideprotectedvirtual

Called just after GUI is initialized.

Reimplemented from istdgui::CGuiComponentBase.

◆ OnGuiDestroyed()

void idocgui::CMainWindowGuiComp::OnGuiDestroyed ( )
overrideprotectedvirtual

Called just before GUI is released.

Reimplemented from istdgui::CGuiComponentBase.

◆ OnModelAttached()

bool idocgui::CMainWindowGuiComp::OnModelAttached ( imod::IModel * modelPtr,
istd::IChangeable::ChangeSet & changeMask )
overridevirtual

This call back function will be called, if an observable object is about to be attached.

This function returns a true, if observable object is accepted by the implementation logic of the observer, otherwise returns false.

Parameters
modelPtrpointer to model object being attached.
changeMaskoutput parameter returning set of change ID's will be accepted. returns a false.

Implements imod::IObserver.

◆ OnModelDetached()

bool idocgui::CMainWindowGuiComp::OnModelDetached ( imod::IModel * modelPtr)
overridevirtual

This call back function will be called, if an observable object is about to be detached.

Implements imod::IObserver.

◆ OnNew

void idocgui::CMainWindowGuiComp::OnNew ( )
protectedslot

◆ OnNewDocument()

void idocgui::CMainWindowGuiComp::OnNewDocument ( const QByteArray & documentTypeId)
protected

◆ OnOpen

void idocgui::CMainWindowGuiComp::OnOpen ( )
protectedslot

◆ OnOpenDocumentFolder

void idocgui::CMainWindowGuiComp::OnOpenDocumentFolder ( )
protectedslot

◆ OnQuit

void idocgui::CMainWindowGuiComp::OnQuit ( )
protectedslot

◆ OnRedo

void idocgui::CMainWindowGuiComp::OnRedo ( )
protectedslot

◆ OnRetranslate()

void idocgui::CMainWindowGuiComp::OnRetranslate ( )
overrideprotectedvirtual

Called when non-GUI elements (like commands) should be retranslated.

Reimplemented from istdgui::CGuiComponentBase.

◆ OnSave

void idocgui::CMainWindowGuiComp::OnSave ( )
protectedslot

◆ OnSaveAs

void idocgui::CMainWindowGuiComp::OnSaveAs ( )
protectedslot

◆ OnUndo

void idocgui::CMainWindowGuiComp::OnUndo ( )
protectedslot

◆ OnUpdate()

void idocgui::CMainWindowGuiComp::OnUpdate ( const istd::IChangeable::ChangeSet & changeSet)
overrideprotectedvirtual

Called on update of observed model.

This method is designed to be overload by derrived classes.

Reimplemented from imod::CSingleModelObserverBase.

◆ OpenFile()

virtual bool idocgui::CMainWindowGuiComp::OpenFile ( const QString & fileName,
const QByteArray * documentTypeIdPtr = nullptr )
protectedvirtual

◆ RemoveFromRecentFileList()

virtual void idocgui::CMainWindowGuiComp::RemoveFromRecentFileList ( const QString & filePath)
protectedvirtual

◆ SaveActiveDocument()

virtual bool idocgui::CMainWindowGuiComp::SaveActiveDocument ( )
protectedvirtual

◆ SerializeRecentFileList()

virtual bool idocgui::CMainWindowGuiComp::SerializeRecentFileList ( iser::IArchive & archive)
protectedvirtual

◆ SetupNewCommand()

void idocgui::CMainWindowGuiComp::SetupNewCommand ( )
protected

◆ UpdateFixedCommands()

void idocgui::CMainWindowGuiComp::UpdateFixedCommands ( istdgui::CHierarchicalCommand & fixedCommands)
overrideprotectedvirtual

Reimplemented from istdgui::CSimpleMainWindowGuiComp.

◆ UpdateRecentFileList()

virtual void idocgui::CMainWindowGuiComp::UpdateRecentFileList ( const idoc::IDocumentManager::FileToTypeMap & fileToTypeMap)
protectedvirtual

Updates displayed list of recent used files.

Parameters
fileToTypeMaplist of new files and corresponding types.

◆ UpdateToolsCommands()

void idocgui::CMainWindowGuiComp::UpdateToolsCommands ( istdgui::CHierarchicalCommand & toolsCommand)
overrideprotectedvirtual

Reimplemented from istdgui::CSimpleMainWindowGuiComp.

◆ UpdateUndoMenu()

void idocgui::CMainWindowGuiComp::UpdateUndoMenu ( )
protected

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

© Witold Gantzke and Kirill Lepskiy