Public Types | Public Member Functions | Protected Member Functions | List of all members
iqtdoc::CSingleDocumentWorkspaceGuiComp Class Reference

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

#include <CSingleDocumentWorkspaceGuiComp.h>

Inheritance diagram for iqtdoc::CSingleDocumentWorkspaceGuiComp:
iqtdoc::TQtDocumentManagerWrap< idoc::CSingleDocumentManagerBase, iqtgui::TRestorableGuiWrap< iqtgui::TGuiComponentBase< QWidget > > > idoc::CSingleDocumentManagerBase iqtgui::TRestorableGuiWrap< iqtgui::TGuiComponentBase< QWidget > > idoc::CTmplBasedDocumentManagerBase imod::CSingleModelObserverBase iqtgui::TGuiComponentBase< QWidget > idoc::IDocumentManager imod::IObserver iqtgui::CGuiComponentBase istd::IChangeable idoc::IDocumentTypesInfo istd::IPolymorphic ibase::TLocalizableWrap< icomp::CComponentBase > iqtgui::IGuiObject istd::IPolymorphic istd::IPolymorphic icomp::CComponentBase istd::IPolymorphic icomp::IComponent istd::IPolymorphic

Public Types

enum  GroupId { GI_WINDOW = 0x300, GI_DOCUMENT, GI_VIEW }
 
typedef
iqtdoc::TQtDocumentManagerWrap
< idoc::CSingleDocumentManagerBase,
iqtgui::TRestorableGuiWrap
< iqtgui::TGuiComponentBase
< QWidget > > > 
BaseClass
 
- Public Types inherited from iqtdoc::TQtDocumentManagerWrap< idoc::CSingleDocumentManagerBase, iqtgui::TRestorableGuiWrap< iqtgui::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. More...
 
- 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 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 iqtgui::TRestorableGuiWrap< iqtgui::TGuiComponentBase< QWidget > >
typedef
iqtgui::TGuiComponentBase
< QWidget > 
BaseClass
 
- Public Types inherited from iqtgui::TGuiComponentBase< QWidget >
typedef CGuiComponentBase BaseClass
 
- Public Types inherited from iqtgui::CGuiComponentBase
typedef icomp::CComponentBase BaseClass
 
- Public Types inherited from ibase::TLocalizableWrap< icomp::CComponentBase >
typedef icomp::CComponentBase BaseClass
 

Public Member Functions

 CSingleDocumentWorkspaceGuiComp ()
 
virtual void OnTryClose (bool *ignoredPtr=NULL)
 Called on trying to close application. More...
 
- Public Member Functions inherited from iqtdoc::TQtDocumentManagerWrap< idoc::CSingleDocumentManagerBase, iqtgui::TRestorableGuiWrap< iqtgui::TGuiComponentBase< QWidget > > >
virtual void OnSaveSettings (QSettings &settings) const
 
virtual QString GetSaveFilePath (const QByteArray &documentTypeId, const istd::IChangeable *dataObjectPtr, const QString &currentFilePath) const
 
- Public Member Functions inherited from idoc::CSingleDocumentManagerBase
 CSingleDocumentManagerBase ()
 
virtual idoc::IUndoManagerGetUndoManagerForDocument (const istd::IChangeable *documentPtr) const
 Return undo mananger for document documenPtr. More...
 
virtual int GetDocumentsCount () const
 Get number of opened documents. More...
 
virtual istd::IChangeableGetDocumentFromIndex (int index, DocumentInfo *documentInfoPtr=NULL) const
 Get document at specified index. More...
 
virtual int GetViewsCount (int documentIndex) const
 Get number of view for specified document. More...
 
virtual istd::IPolymorphicGetViewFromIndex (int documentIndex, int viewIndex) const
 Get single view using its and document indices. More...
 
virtual istd::IPolymorphicGetActiveView () const
 Return the active document. More...
 
virtual istd::IChangeableGetDocumentFromView (const istd::IPolymorphic &view, DocumentInfo *documentInfoPtr=NULL) const
 Return the document assigned to view. More...
 
virtual istd::IPolymorphicAddViewToDocument (const istd::IChangeable &document, const QByteArray &viewTypeId=QByteArray())
 Add a new view to the document. More...
 
virtual QByteArray GetDocumentTypeId (const istd::IChangeable &document) const
 Get ID of document type managed by this object. More...
 
virtual bool InsertNewDocument (const QByteArray &documentTypeId, bool createView=true, const QByteArray &viewTypeId="", istd::IChangeable **newDocumentPtr=NULL, bool beQuiet=false, bool *ignoredPtr=NULL)
 Creates a new document with the document ID documentTypeId. More...
 
virtual bool OpenDocument (const QByteArray *documentTypeIdPtr, const QString *fileNamePtr=NULL, bool createView=true, const QByteArray &viewTypeId="", istd::IChangeable **documentPtr=NULL, FileToTypeMap *loadedMapPtr=NULL, bool beQuiet=false, bool *ignoredPtr=NULL)
 Opens document(s) from the file list. More...
 
virtual bool SaveDocument (int documentIndex=-1, bool requestFileName=false, FileToTypeMap *savedMapPtr=NULL, bool beQuiet=false, bool *ignoredPtr=NULL)
 Save document. More...
 
virtual bool SaveDirtyDocuments (bool beQuiet=false, bool *ignoredPtr=NULL)
 Ask user (optional) and save all dirty (changed) documents. More...
 
virtual bool CloseDocument (int documentIndex=-1, bool beQuiet=false, bool *ignoredPtr=NULL)
 Close document and all its views. More...
 
virtual bool CloseView (istd::IPolymorphic *viewPtr=NULL, bool beQuiet=false, bool *ignoredPtr=NULL)
 Close view. More...
 
- Public Member Functions inherited from idoc::CTmplBasedDocumentManagerBase
 CTmplBasedDocumentManagerBase ()
 
virtual int GetAllowedOperationFlags (const istd::IPolymorphic *viewPtr=NULL) const
 Get flags of allowed operations. More...
 
virtual bool IsFeatureSupported (int featureFlags, const QByteArray &documentTypeId) const
 Return true, if the feature(s) is supported by this document template. More...
 
virtual Ids GetDocumentTypeIds () const
 Get list of supported document ID's can be created for specified file. More...
 
virtual QString GetDocumentTypeName (const QByteArray &documentTypeId) const
 Get human readable name of some document type ID. More...
 
virtual ifile::IFileTypeInfoGetDocumentFileTypeInfo (const QByteArray &documentTypeId) const
 Get file type information object for some selected document type. More...
 
virtual Ids GetDocumentTypeIdsForFile (const QString &filePath) const
 Get list of supported document ID's can be created for specified file. More...
 
virtual QString GetDefaultDirectory (const QString &sugestedDir="", const QByteArray *documentTypeIdPtr=NULL) const
 Return default directory for specified document type. More...
 
- Public Member Functions inherited from istd::IChangeable
virtual int GetSupportedOperations () const
 Get set of flags for supported operations. More...
 
virtual bool CopyFrom (const IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS)
 Copy this object from another one. More...
 
virtual bool IsEqual (const IChangeable &object) const
 Compare this object with another object. More...
 
virtual IChangeableCloneMe (CompatibilityMode mode=CM_WITHOUT_REFS) const
 Make a copy of this object. More...
 
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 iqtgui::TGuiComponentBase< QWidget >
 TGuiComponentBase ()
 
virtual QWidget * GetQtWidget () const
 
virtual QWidget * CreateQtWidget (QWidget *parentPtr)
 Create slave widget object. More...
 
- Public Member Functions inherited from iqtgui::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
 
virtual bool IsGuiCreated () const
 Inform if GUI was initilized. More...
 
virtual QWidget * GetWidget () const
 Get access to internal QWidget object. More...
 
- Public Member Functions inherited from ibase::TLocalizableWrap< icomp::CComponentBase >
 TLocalizableWrap ()
 
virtual void EnableLocalization (bool enableLocalization=true)
 If enabled, listen to the language change event from the application context. More...
 
- Public Member Functions inherited from icomp::CComponentBase
 CComponentBase ()
 Create component and assign it to specific context. More...
 
virtual const ICompositeComponentGetParentComponent (bool ownerOnly=false) const
 Get parent of this component. More...
 
virtual void * GetInterface (const istd::CClassInfo &interfaceType, const QByteArray &subId="")
 Get access to specified component interface. More...
 
virtual const IComponentContextGetComponentContext () const
 Get access to component context describing all application-specified component information loaded from components registry. More...
 
virtual void SetComponentContext (const icomp::IComponentContext *contextPtr, const ICompositeComponent *parentPtr, bool isParentOwner)
 Set component context of this component. More...
 

Protected Member Functions

void UpdateTitle ()
 Update titles of views or all views of specified document. More...
 
virtual QString GetOpenFilePath (const QByteArray *documentTypeIdPtr=NULL) const
 Gets open file names. More...
 
virtual void OnViewRegistered (istd::IPolymorphic *viewPtr)
 Called after view is registered. More...
 
virtual void OnViewRemoved (istd::IPolymorphic *viewPtr)
 Called before view is removed. More...
 
virtual bool QueryDocumentSave (bool *ignoredPtr)
 Query user if this document can be closed. More...
 
virtual void OnGuiCreated ()
 Called just after GUI is initialized. More...
 
virtual void OnGuiDestroyed ()
 Called just before GUI is released. More...
 
virtual void OnComponentCreated ()
 
virtual void OnEndChanges (const ChangeSet &changeSet)
 Callback function for end change event. More...
 
virtual void OnRestoreSettings (const QSettings &settings)
 
- Protected Member Functions inherited from iqtdoc::TQtDocumentManagerWrap< idoc::CSingleDocumentManagerBase, iqtgui::TRestorableGuiWrap< iqtgui::TGuiComponentBase< QWidget > > >
QStringList CreateFileDialogFilters (const QByteArray *documentTypeIdPtr, const istd::IChangeable *dataObjectPtr, int flags) const
 Creates the filter for the file selection dialog. More...
 
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)
 Open single document using its file path. More...
 
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. More...
 
bool RegisterDocument ()
 Register (attach) created document as new working document. More...
 
void EnsureViewRemoved ()
 
QString GetCurrentDocumentFilePath () const
 
bool HasDocumentPendingChanges () const
 
virtual void OnUpdate (const istd::IChangeable::ChangeSet &changeSet)
 Called on update of observed model. More...
 
bool SerializeOpenDocument (iser::IArchive &archive)
 Serializes open documents information. More...
 
- Protected Member Functions inherited from idoc::CTmplBasedDocumentManagerBase
virtual const
idoc::IDocumentTemplate
GetDocumentTemplate () const
 
void SetDocumentTemplate (const idoc::IDocumentTemplate *documentTemplatePtr)
 
- Protected Member Functions inherited from istd::IChangeable
virtual void OnBeginChanges ()
 Callback function for begin change event. More...
 
- Protected Member Functions inherited from imod::CSingleModelObserverBase
void SetModelPtr (imod::IModel *modelPtr)
 Set internal model pointer to specified value. More...
 
 CSingleModelObserverBase ()
 
virtual ~CSingleModelObserverBase ()
 
imod::IModelGetObservedModel () const
 Get access to observed model. More...
 
imod::IModelGetModelPtr () const
 Get access to observed model. More...
 
void EnsureModelDetached ()
 Make sure this observer is detached. More...
 
void SetObservedIds (const istd::IChangeable::ChangeSet &changeMask)
 Set list of ID's beeing observed. More...
 
virtual bool IsModelAttached (const imod::IModel *modelPtr=NULL) const
 Check if specified model is attached. More...
 
virtual bool OnModelAttached (imod::IModel *modelPtr, istd::IChangeable::ChangeSet &changeMask)
 This call back function will be called, if an observable object is about to be attached. More...
 
virtual bool OnModelDetached (imod::IModel *modelPtr)
 This call back function will be called, if an observable object is about to be detached. More...
 
virtual void BeforeUpdate (imod::IModel *modelPtr)
 This function will be called before update of the observer contents occures. More...
 
virtual void AfterUpdate (imod::IModel *modelPtr, const istd::IChangeable::ChangeSet &changeSet)
 This function will be called after update of the observer contents occures. More...
 
- Protected Member Functions inherited from iqtgui::TRestorableGuiWrap< iqtgui::TGuiComponentBase< QWidget > >
virtual bool CreateGui (QWidget *parentPtr)
 
virtual bool DestroyGui ()
 
- Protected Member Functions inherited from iqtgui::CGuiComponentBase
virtual void OnGuiShown ()
 Called from widget event filter when slave widget is shown. More...
 
virtual void OnGuiHidden ()
 Called from widget event filter when slave widget is hidden. More...
 
virtual bool OnKeyPressed (QKeyEvent *event)
 Called from widget event filter when key is pressed. More...
 
virtual void OnRetranslate ()
 Called when non-GUI elements (like commands) should be retranslated. More...
 
virtual void OnGuiRetranslate ()
 Called from widget event filter when GUI should be retranslated. More...
 
void SetStatusIcon (const QIcon &icon)
 Set status icon;. More...
 
void SetStatusText (const QString &text)
 Set status text;. More...
 
virtual void OnLanguageChanged ()
 
virtual bool eventFilter (QObject *sourcePtr, QEvent *eventPtr)
 
- Protected Member Functions inherited from icomp::CComponentBase
bool IsComponentActive () const
 Check if component is active. More...
 
virtual void OnComponentDestroyed ()
 
virtual const
icomp::IRealComponentStaticInfo
GetComponentStaticInfo () const =0
 Get access to static info of this component. 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 Types inherited from imod::CSingleModelObserverBase
typedef imod::IModel ModelType
 
- Static Protected Member Functions inherited from icomp::CComponentBase
static const
icomp::IRealComponentStaticInfo
InitStaticInfo (IComponent *componentPtr)
 
static QByteArray GetComponentId (const icomp::IComponentContext *componentContextPtr, const QByteArray &contextId=QByteArray())
 
- Protected Attributes inherited from iqtgui::CGuiComponentBase
imod::TModelWrap< VisualStatusm_visualStatus
 
- Static Protected Attributes inherited from imod::CSingleModelObserverBase
static const
istd::IChangeable::ChangeSet 
s_undoChanges
 

Detailed Description

Qt-based workspace implementation of a single document manager.

Definition at line 32 of file CSingleDocumentWorkspaceGuiComp.h.

Member Typedef Documentation

Definition at line 44 of file CSingleDocumentWorkspaceGuiComp.h.

Member Enumeration Documentation

Enumerator
GI_WINDOW 
GI_DOCUMENT 
GI_VIEW 

Definition at line 52 of file CSingleDocumentWorkspaceGuiComp.h.

Constructor & Destructor Documentation

iqtdoc::CSingleDocumentWorkspaceGuiComp::CSingleDocumentWorkspaceGuiComp ( )

Member Function Documentation

virtual QString iqtdoc::CSingleDocumentWorkspaceGuiComp::GetOpenFilePath ( const QByteArray *  documentTypeIdPtr = NULL) const
protectedvirtual

Gets open file names.

Implements idoc::CSingleDocumentManagerBase.

virtual void iqtdoc::CSingleDocumentWorkspaceGuiComp::OnComponentCreated ( )
protectedvirtual

Reimplemented from iqtgui::CGuiComponentBase.

virtual void iqtdoc::CSingleDocumentWorkspaceGuiComp::OnEndChanges ( const ChangeSet changeSet)
protectedvirtual

Callback function for end change event.

Reimplemented from istd::IChangeable.

virtual void iqtdoc::CSingleDocumentWorkspaceGuiComp::OnGuiCreated ( )
protectedvirtual

Called just after GUI is initialized.

Reimplemented from iqtgui::CGuiComponentBase.

virtual void iqtdoc::CSingleDocumentWorkspaceGuiComp::OnGuiDestroyed ( )
protectedvirtual

Called just before GUI is released.

Reimplemented from iqtgui::CGuiComponentBase.

virtual void iqtdoc::CSingleDocumentWorkspaceGuiComp::OnRestoreSettings ( const QSettings &  settings)
protectedvirtual
virtual void iqtdoc::CSingleDocumentWorkspaceGuiComp::OnTryClose ( bool *  ignoredPtr = NULL)
virtual

Called on trying to close application.

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

Reimplemented from iqtgui::CGuiComponentBase.

virtual void iqtdoc::CSingleDocumentWorkspaceGuiComp::OnViewRegistered ( istd::IPolymorphic viewPtr)
protectedvirtual

Called after view is registered.

Implements idoc::CSingleDocumentManagerBase.

virtual void iqtdoc::CSingleDocumentWorkspaceGuiComp::OnViewRemoved ( istd::IPolymorphic viewPtr)
protectedvirtual

Called before view is removed.

Implements idoc::CSingleDocumentManagerBase.

virtual bool iqtdoc::CSingleDocumentWorkspaceGuiComp::QueryDocumentSave ( bool *  ignoredPtr)
protectedvirtual

Query user if this document can be closed.

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

Implements idoc::CSingleDocumentManagerBase.

void iqtdoc::CSingleDocumentWorkspaceGuiComp::UpdateTitle ( )
protected

Update titles of views or all views of specified document.


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

© 2007-2017 Witold Gantzke and Kirill Lepskiy