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

Qt-based workspace implementation of a single document manager. More...

#include <CSingleDocumentWorkspaceGuiComp.h>

Inheritance diagram for idocgui::CSingleDocumentWorkspaceGuiComp:
Collaboration diagram for idocgui::CSingleDocumentWorkspaceGuiComp:

Public Types

enum  GroupId { GI_WINDOW = 0x300 , GI_DOCUMENT , GI_VIEW }
 
typedef idocgui::TQtDocumentManagerWrap< idoc::CSingleDocumentManagerBase, istdgui::TRestorableGuiWrap< istdgui::TGuiComponentBase< QWidget > > > BaseClass
 
- Public Types inherited from idocgui::TQtDocumentManagerWrap< idoc::CSingleDocumentManagerBase, istdgui::TRestorableGuiWrap< istdgui::TGuiComponentBase< QWidget > > >
typedef idoc::CSingleDocumentManagerBase BaseClass
 
typedef BaseClass::Ids Ids
 
- Public Types inherited from idoc::IDocumentManager
enum  ChangeFlags {
  CF_DOCUMENT_RENAMED = 0x834d670 , CF_DOCUMENT_CREATED , CF_DOCUMENT_REMOVED , CF_DOCUMENT_COUNT_CHANGED ,
  CF_VIEW_ACTIVATION_CHANGED
}
 Possible changes in the mananger data model. More...
 
enum  OperationFlags {
  OF_FILE_NEW = 0x0001 , OF_FILE_OPEN = 0x0002 , OF_FILE_SAVE = 0x0004 , OF_FILE_SAVE_AS = 0x0008 ,
  OF_KNOWN_PATH = 0x0010
}
 Flags describing possible operations. More...
 
typedef QMap< QString, QByteArray > FileToTypeMap
 Map from file path to ducument type ID's.
 
- 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 idoc::IDocumentTypesInfo
enum  SupportedFeatures { SF_NEW_DOCUMENT = 0x0001 , SF_EDIT_DOCUMENT = 0x0010 , SF_DEFAULT = 0xffff }
 Enumeration for supported types of operation with the document. More...
 
typedef QVector< QByteArray > Ids
 
- Public Types inherited from istdgui::TRestorableGuiWrap< istdgui::TGuiComponentBase< QWidget > >
typedef istdgui::TGuiComponentBase< QWidget > BaseClass
 
- Public Types inherited from istdgui::TGuiComponentBase< QWidget >
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

 CSingleDocumentWorkspaceGuiComp ()
 
void SetActiveView (istd::IPolymorphic *viewPtr) override
 Indicate that some view is active now.
 
void OnTryClose (bool *ignoredPtr=nullptr) override
 Called on trying to close application.
 
- Public Member Functions inherited from idocgui::TQtDocumentManagerWrap< idoc::CSingleDocumentManagerBase, istdgui::TRestorableGuiWrap< istdgui::TGuiComponentBase< QWidget > > >
void OnRestoreSettings (const QSettings &settings) override
 
void OnSaveSettings (QSettings &settings) const override
 
QString GetSaveFilePath (const QByteArray &documentTypeId, const istd::IChangeable *dataObjectPtr, const QString &currentFilePath) const override
 
- Public Member Functions inherited from idoc::CSingleDocumentManagerBase
 CSingleDocumentManagerBase ()
 
virtual idoc::IUndoManagerGetUndoManagerForDocument (const istd::IChangeable *documentPtr) const
 Return undo mananger for document documenPtr.
 
virtual int GetDocumentsCount () const
 Get number of opened documents.
 
virtual istd::IChangeableGetDocumentFromIndex (int index, DocumentInfo *documentInfoPtr=nullptr) const
 Get document at specified index.
 
virtual int GetViewsCount (int documentIndex) const
 Get number of view for specified document.
 
virtual istd::IPolymorphic * GetViewFromIndex (int documentIndex, int viewIndex) const
 Get single view using its and document indices.
 
virtual istd::IPolymorphic * GetActiveView () const
 Return the active document.
 
virtual istd::IChangeableGetDocumentFromView (const istd::IPolymorphic &view, DocumentInfo *documentInfoPtr=nullptr) const
 Return the document assigned to view.
 
virtual istd::IPolymorphic * AddViewToDocument (const istd::IChangeable &document, const QByteArray &viewTypeId=QByteArray())
 Add a new view to the document.
 
virtual QByteArray GetDocumentTypeId (const istd::IChangeable &document) const
 Get ID of document type managed by this object.
 
virtual bool InsertNewDocument (const QByteArray &documentTypeId, bool createView=true, const QByteArray &viewTypeId="", istd::IChangeable **newDocumentPtr=nullptr, bool beQuiet=false, bool *ignoredPtr=nullptr)
 Creates a new document with the document ID documentTypeId.
 
virtual bool OpenDocument (const QByteArray *documentTypeIdPtr, const QString *fileNamePtr=nullptr, bool createView=true, const QByteArray &viewTypeId="", istd::IChangeable **documentPtr=nullptr, FileToTypeMap *loadedMapPtr=nullptr, bool beQuiet=false, bool *ignoredPtr=nullptr, iproc::IProgressManager *progressManagerPtr=nullptr)
 Opens document(s) from the file list.
 
virtual bool SaveDocument (int documentIndex=-1, bool requestFileName=false, FileToTypeMap *savedMapPtr=nullptr, bool beQuiet=false, bool *ignoredPtr=nullptr, iproc::IProgressManager *progressManagerPtr=nullptr)
 Save document.
 
virtual bool SaveDirtyDocuments (bool beQuiet=false, bool *ignoredPtr=nullptr)
 Ask user (optional) and save all dirty (changed) documents.
 
virtual bool CloseDocument (int documentIndex=-1, bool beQuiet=false, bool *ignoredPtr=nullptr)
 Close document and all its views.
 
virtual bool CloseView (istd::IPolymorphic *viewPtr=nullptr, bool beQuiet=false, bool *ignoredPtr=nullptr)
 Close view.
 
- Public Member Functions inherited from idoc::CTmplBasedDocumentManagerBase
 CTmplBasedDocumentManagerBase ()
 
virtual int GetAllowedOperationFlags (const istd::IPolymorphic *viewPtr=nullptr) const
 Get flags of allowed operations.
 
virtual bool IsFeatureSupported (int featureFlags, const QByteArray &documentTypeId) const
 Return true, if the feature(s) is supported by this document template.
 
virtual Ids GetDocumentTypeIds () const
 Get list of supported document ID's can be created for specified file.
 
virtual QString GetDocumentTypeName (const QByteArray &documentTypeId) const
 Get human readable name of some document type ID.
 
virtual ifile::IFileTypeInfoGetDocumentFileTypeInfo (const QByteArray &documentTypeId) const
 Get file type information object for some selected document type.
 
virtual Ids GetDocumentTypeIdsForFile (const QString &filePath) const
 Get list of supported document ID's can be created for specified file.
 
virtual QString GetDefaultDirectory (const QString &sugestedDir="", const QByteArray *documentTypeIdPtr=nullptr) const
 Return default directory for specified document type.
 
- Public Member Functions inherited from idoc::IDocumentManager
- Public Member Functions inherited from istd::IChangeable
virtual int GetSupportedOperations () const
 Get set of flags for supported operations.
 
virtual bool CopyFrom (const IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS)
 Copy this object from another one.
 
virtual bool IsEqual (const IChangeable &object) const
 Compare this object with another object.
 
virtual std::unique_ptr< IChangeableCloneMe (CompatibilityMode mode=CM_WITHOUT_REFS) const
 Make a copy of this object.
 
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 idoc::IDocumentTypesInfo
- Public Member Functions inherited from istdgui::TGuiComponentBase< QWidget >
 TGuiComponentBase ()
 
virtual QWidget * 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 Member Functions

virtual void UpdateTitle ()
 Update titles of views or all views of specified document.
 
virtual QString GenerateDocumentTitle () const
 Generate the title of the current document.
 
QString GetOpenFilePath (const QByteArray *documentTypeIdPtr=nullptr) const override
 Gets open file names.
 
void OnViewRegistered (istd::IPolymorphic *viewPtr) override
 Called after view is registered.
 
void OnViewRemoved (istd::IPolymorphic *viewPtr) override
 Called before view is removed.
 
bool QueryDocumentSave (bool *ignoredPtr) override
 Query user if this document can be closed.
 
void OnGuiCreated () override
 Called just after GUI is initialized.
 
void OnGuiDestroyed () override
 Called just before GUI is released.
 
void OnComponentCreated () override
 
void OnEndChanges (const ChangeSet &changeSet) override
 Callback function for end change event.
 
void OnRestoreSettings (const QSettings &settings) override
 
- Protected Member Functions inherited from idocgui::TQtDocumentManagerWrap< idoc::CSingleDocumentManagerBase, istdgui::TRestorableGuiWrap< istdgui::TGuiComponentBase< QWidget > > >
QStringList CreateFileDialogFilters (const QByteArray *documentTypeIdPtr, const istd::IChangeable *dataObjectPtr, int flags) const
 Creates the filter for the file selection dialog.
 
void UpdateLastDirectory (const QString &filePath) const
 
virtual QStringList GetOpenFilePathesFromDialog (const QByteArray *documentTypeIdPtr) const
 
- Protected Member Functions inherited from idoc::CSingleDocumentManagerBase
virtual bool OpenSingleDocument (const QString &filePath, bool createView, const QByteArray &viewTypeId, QByteArray &documentTypeId, bool beQuiet, bool *ignoredPtr, iproc::IProgressManager *progressManagerPtr)
 Open single document using its file path.
 
bool NewDocument (const QByteArray &documentTypeId, bool createView, const QByteArray &viewTypeId, bool initialize, bool beQuiet, bool *ignoredPtr)
 Create instance of specified document without attaching to this manager.
 
bool RegisterDocument ()
 Register (attach) created document as new working document.
 
void EnsureViewRemoved ()
 
QString GetCurrentDocumentFilePath () const
 
bool HasDocumentPendingChanges () const
 
virtual void OnUpdate (const istd::IChangeable::ChangeSet &changeSet)
 Called on update of observed model.
 
bool SerializeOpenDocument (iser::IArchive &archive)
 Serializes open documents information.
 
- Protected Member Functions inherited from idoc::CTmplBasedDocumentManagerBase
virtual const idoc::IDocumentTemplateGetDocumentTemplate () const
 
void SetDocumentTemplate (const idoc::IDocumentTemplate *documentTemplatePtr)
 
- Protected Member Functions inherited from istd::IChangeable
virtual void OnBeginChanges ()
 Callback function for begin change event.
 
- 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.
 
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.
 
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
- Protected Member Functions inherited from istdgui::TRestorableGuiWrap< istdgui::TGuiComponentBase< QWidget > >
bool CreateGui (QWidget *parentPtr) override
 
bool DestroyGui () override
 
- Protected Member Functions inherited from istdgui::TGuiComponentBase< QWidget >
virtual QWidget * CreateQtWidget (QWidget *parentPtr)
 Create slave widget object.
 
- Protected Member Functions inherited from istdgui::CGuiComponentBase
virtual void OnGuiShown ()
 Called from widget event filter when slave widget is shown.
 
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 OnRetranslate ()
 Called when non-GUI elements (like commands) should be retranslated.
 
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
 
void OnComponentDestroyed () 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 Attributes

istdgui::IGuiObjectm_lastViewPtr
 
QString m_organizationName
 
QString m_applicationName
 
- Protected Attributes inherited from istdgui::CGuiComponentBase
istd::CMainThreadCaller m_updateGuiCaller
 
imod::TModelWrap< VisualStatusm_visualStatus
 

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.
 
- Static Public Member Functions inherited from istdgui::CGuiComponentBase
static void MakeAutoSlotConnection (const QWidget &widget, QObject &object)
 
- 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())
 

Detailed Description

Qt-based workspace implementation of a single document manager.

Definition at line 32 of file CSingleDocumentWorkspaceGuiComp.h.

Member Typedef Documentation

◆ BaseClass

Member Enumeration Documentation

◆ GroupId

Enumerator
GI_WINDOW 
GI_DOCUMENT 
GI_VIEW 

Definition at line 52 of file CSingleDocumentWorkspaceGuiComp.h.

Constructor & Destructor Documentation

◆ CSingleDocumentWorkspaceGuiComp()

idocgui::CSingleDocumentWorkspaceGuiComp::CSingleDocumentWorkspaceGuiComp ( )

Member Function Documentation

◆ GenerateDocumentTitle()

virtual QString idocgui::CSingleDocumentWorkspaceGuiComp::GenerateDocumentTitle ( ) const
protectedvirtual

Generate the title of the current document.

◆ GetOpenFilePath()

QString idocgui::CSingleDocumentWorkspaceGuiComp::GetOpenFilePath ( const QByteArray * documentTypeIdPtr = nullptr) const
overrideprotectedvirtual

Gets open file names.

Implements idoc::CSingleDocumentManagerBase.

◆ OnComponentCreated()

void idocgui::CSingleDocumentWorkspaceGuiComp::OnComponentCreated ( )
overrideprotectedvirtual

Reimplemented from istdgui::CGuiComponentBase.

◆ OnEndChanges()

void idocgui::CSingleDocumentWorkspaceGuiComp::OnEndChanges ( const ChangeSet & changeSet)
overrideprotectedvirtual

Callback function for end change event.

Reimplemented from istd::IChangeable.

◆ OnGuiCreated()

void idocgui::CSingleDocumentWorkspaceGuiComp::OnGuiCreated ( )
overrideprotectedvirtual

Called just after GUI is initialized.

Reimplemented from istdgui::CGuiComponentBase.

◆ OnGuiDestroyed()

void idocgui::CSingleDocumentWorkspaceGuiComp::OnGuiDestroyed ( )
overrideprotectedvirtual

Called just before GUI is released.

Reimplemented from istdgui::CGuiComponentBase.

◆ OnRestoreSettings()

void idocgui::CSingleDocumentWorkspaceGuiComp::OnRestoreSettings ( const QSettings & settings)
overrideprotectedvirtual

◆ OnTryClose()

void idocgui::CSingleDocumentWorkspaceGuiComp::OnTryClose ( bool * ignoredPtr = nullptr)
overridevirtual

Called on trying to close application.

Parameters
ignoredPtrif it is not nullptr, ignoring of close is allowed. In this case implementation should set pointed value to true.

Reimplemented from istdgui::CGuiComponentBase.

◆ OnViewRegistered()

void idocgui::CSingleDocumentWorkspaceGuiComp::OnViewRegistered ( istd::IPolymorphic * viewPtr)
overrideprotectedvirtual

Called after view is registered.

Implements idoc::CSingleDocumentManagerBase.

◆ OnViewRemoved()

void idocgui::CSingleDocumentWorkspaceGuiComp::OnViewRemoved ( istd::IPolymorphic * viewPtr)
overrideprotectedvirtual

Called before view is removed.

Implements idoc::CSingleDocumentManagerBase.

◆ QueryDocumentSave()

bool idocgui::CSingleDocumentWorkspaceGuiComp::QueryDocumentSave ( bool * ignoredPtr)
overrideprotectedvirtual

Query user if this document can be closed.

Parameters
ignoredPtroptional return flag indicating that user ignored this close operation.

Implements idoc::CSingleDocumentManagerBase.

◆ SetActiveView()

void idocgui::CSingleDocumentWorkspaceGuiComp::SetActiveView ( istd::IPolymorphic * viewPtr)
overridevirtual

Indicate that some view is active now.

Implements idoc::IDocumentManager.

◆ UpdateTitle()

virtual void idocgui::CSingleDocumentWorkspaceGuiComp::UpdateTitle ( )
protectedvirtual

Update titles of views or all views of specified document.

Member Data Documentation

◆ m_applicationName

QString idocgui::CSingleDocumentWorkspaceGuiComp::m_applicationName
protected

Definition at line 104 of file CSingleDocumentWorkspaceGuiComp.h.

◆ m_lastViewPtr

istdgui::IGuiObject* idocgui::CSingleDocumentWorkspaceGuiComp::m_lastViewPtr
protected

Definition at line 101 of file CSingleDocumentWorkspaceGuiComp.h.

◆ m_organizationName

QString idocgui::CSingleDocumentWorkspaceGuiComp::m_organizationName
protected

Definition at line 103 of file CSingleDocumentWorkspaceGuiComp.h.


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

© Witold Gantzke and Kirill Lepskiy