|
| enum | GroupId { GI_WINDOW = 0x300
, GI_DOCUMENT
, GI_VIEW
} |
| |
| typedef iqtdoc::TQtDocumentManagerWrap< idoc::CSingleDocumentManagerBase, iqtgui::TRestorableGuiWrap< iqtgui::TGuiComponentBase< QWidget > > > | BaseClass |
| |
| typedef idoc::CSingleDocumentManagerBase | BaseClass |
| |
| typedef BaseClass::Ids | Ids |
| |
| enum | ChangeFlags {
CF_DOCUMENT_RENAMED = 0x834d670
, CF_DOCUMENT_CREATED
, CF_DOCUMENT_REMOVED
, CF_DOCUMENT_COUNT_CHANGED
,
CF_VIEW_ACTIVATION_CHANGED
} |
| | Possible changes in the manager 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 that can be performed by the document manager. More...
|
| |
| typedef QMap< QString, QByteArray > | FileToTypeMap |
| | Map from file path to document type ID's.
|
| |
| 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...
|
| |
| typedef QMultiMap< QByteArray, QVariant > | ChangeInfoMap |
| |
| enum | SupportedFeatures { SF_NEW_DOCUMENT = 0x0001
, SF_EDIT_DOCUMENT = 0x0010
, SF_DEFAULT = 0xffff
} |
| | Enumeration for supported types of operations with documents. More...
|
| |
| typedef QVector< QByteArray > | Ids |
| | Type definition for document type ID collections.
|
| |
| typedef iqtgui::TGuiComponentBase< QWidget > | BaseClass |
| |
| typedef CGuiComponentBase | BaseClass |
| |
| typedef TMakeIconProviderCompWrap< ibase::TLocalizableWrap< icomp::CComponentBase > > | BaseClass |
| |
| typedef ibase::TLocalizableWrap< icomp::CComponentBase > | BaseClass |
| |
Public Types inherited from iqtgui::TDesignSchemaHandlerWrap< Base > |
| typedef Base | BaseClass |
| |
|
| | CSingleDocumentWorkspaceGuiComp () |
| |
| virtual void | SetActiveView (istd::IPolymorphic *viewPtr) override |
| | Indicate that some view is active now.
|
| |
| virtual void | OnTryClose (bool *ignoredPtr=NULL) override |
| | Called when the application is attempting to close.
|
| |
| virtual void | OnSaveSettings (QSettings &settings) const override |
| |
| virtual QString | GetSaveFilePath (const QByteArray &documentTypeId, const istd::IChangeable *dataObjectPtr, const QString ¤tFilePath) const override |
| |
| | CSingleDocumentManagerBase () |
| |
| virtual idoc::IUndoManager * | GetUndoManagerForDocument (const istd::IChangeable *documentPtr) const override |
| | Return undo manager for document documentPtr.
|
| |
| virtual int | GetDocumentsCount () const override |
| | Get number of opened documents.
|
| |
| virtual istd::IChangeable & | GetDocumentFromIndex (int index, DocumentInfo *documentInfoPtr=NULL) const override |
| | Get document at specified index.
|
| |
| virtual int | GetViewsCount (int documentIndex) const override |
| | Get number of view for specified document.
|
| |
| virtual istd::IPolymorphic * | GetViewFromIndex (int documentIndex, int viewIndex) const override |
| | Get single view using its and document indices.
|
| |
| virtual istd::IPolymorphic * | GetActiveView () const override |
| | Return the active document.
|
| |
| virtual istd::IChangeable * | GetDocumentFromView (const istd::IPolymorphic &view, DocumentInfo *documentInfoPtr=NULL) const override |
| | Return the document assigned to view.
|
| |
| virtual istd::IPolymorphic * | AddViewToDocument (const istd::IChangeable &document, const QByteArray &viewTypeId=QByteArray()) override |
| | Add a new view to the document.
|
| |
| virtual QByteArray | GetDocumentTypeId (const istd::IChangeable &document) const override |
| | Get ID of document type managed by this object.
|
| |
| virtual bool | InsertNewDocument (const QByteArray &documentTypeId, bool createView=true, const QByteArray &viewTypeId="", istd::IChangeableSharedPtr *newDocumentPtr=nullptr, bool beQuiet=false, bool *ignoredPtr=NULL) override |
| | Creates a new document with the document ID documentTypeId.
|
| |
| virtual bool | OpenDocument (const QByteArray *documentTypeIdPtr, const QString *fileNamePtr=NULL, bool createView=true, const QByteArray &viewTypeId="", istd::IChangeableSharedPtr *documentPtr=nullptr, FileToTypeMap *loadedMapPtr=NULL, bool beQuiet=false, bool *ignoredPtr=NULL, ibase::IProgressManager *progressManagerPtr=NULL) override |
| | Opens document(s) from the file list.
|
| |
| virtual bool | SaveDocument (int documentIndex=-1, bool requestFileName=false, FileToTypeMap *savedMapPtr=NULL, bool beQuiet=false, bool *ignoredPtr=NULL, ibase::IProgressManager *progressManagerPtr=NULL) override |
| | Save document.
|
| |
| virtual bool | SaveDirtyDocuments (bool beQuiet=false, bool *ignoredPtr=NULL) override |
| | Ask user (optional) and save all dirty (changed) documents.
|
| |
| virtual bool | CloseDocument (int documentIndex=-1, bool beQuiet=false, bool *ignoredPtr=NULL) override |
| | Close document and all its views.
|
| |
| virtual bool | CloseView (istd::IPolymorphic *viewPtr=NULL, bool beQuiet=false, bool *ignoredPtr=NULL) override |
| | Close view.
|
| |
| | CTmplBasedDocumentManagerBase () |
| |
| virtual int | GetAllowedOperationFlags (const istd::IPolymorphic *viewPtr=NULL) const override |
| | Get flags of allowed operations.
|
| |
| virtual bool | IsFeatureSupported (int featureFlags, const QByteArray &documentTypeId) const override |
| | Return true, if the feature(s) is supported by this document template.
|
| |
| virtual Ids | GetDocumentTypeIds () const override |
| | Get list of supported document type IDs.
|
| |
| virtual QString | GetDocumentTypeName (const QByteArray &documentTypeId) const override |
| | Get human readable name of some document type ID.
|
| |
| virtual ifile::IFileTypeInfo * | GetDocumentFileTypeInfo (const QByteArray &documentTypeId) const override |
| | Get file type information object for some selected document type.
|
| |
| virtual Ids | GetDocumentTypeIdsForFile (const QString &filePath) const override |
| | Get list of supported document IDs that can handle the specified file.
|
| |
| virtual QString | GetDefaultDirectory (const QString &sugestedDir="", const QByteArray *documentTypeIdPtr=NULL) const override |
| | Return default directory for specified document type.
|
| |
| 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 istd::TUniqueInterfacePtr< istd::IChangeable > | CloneMe (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 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.
|
| |
| virtual | ~IPolymorphic () |
| |
| | TGuiComponentBase () |
| |
| virtual QWidget * | GetQtWidget () const |
| |
| virtual QWidget * | CreateQtWidget (QWidget *parentPtr) override |
| | Create slave widget object.
|
| |
| | 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 override |
| | Checks if the GUI has been initialized and created.
|
| |
| virtual QWidget * | GetWidget () const override |
| | Gets access to the internal QWidget object.
|
| |
Public Member Functions inherited from iqtgui::TDesignSchemaHandlerWrap< Base > |
| | TDesignSchemaHandlerWrap () |
| |
| virtual void | EnableDesignHandler (bool enable=true) |
| | If enabled, listen to the design schema change events from the application context.
|
| |
| virtual QIcon | GetIcon (const QString &iconName) const |
| |
| virtual QString | GetIconPath (const QString &iconName) const |
| |
| virtual QString | GetStyleSheetPath (const QString &styleSheetPath) const |
| |
| QByteArray | GetCurrentThemeId () const |
| |
| void | SetThemeId (const QByteArray &themeId) |
| |
|
| virtual void | UpdateTitle () |
| | Update titles of views or all views of specified document.
|
| |
| virtual QString | GenerateDocumentTitle () const |
| | Generate the title of the current document.
|
| |
| virtual QString | GetOpenFilePath (const QByteArray *documentTypeIdPtr=NULL) const override |
| | Gets open file names.
|
| |
| virtual void | OnViewRegistered (istd::IPolymorphic *viewPtr) override |
| | Called after view is registered.
|
| |
| virtual void | OnViewRemoved (istd::IPolymorphic *viewPtr) override |
| | Called before view is removed.
|
| |
| virtual void | OnDocumentRegistered () override |
| | Called after document is registered.
|
| |
| virtual void | OnDocumentClosed () override |
| | Called before document is closed.
|
| |
| virtual bool | QueryDocumentSave (bool *ignoredPtr) override |
| | Query user if this document can be closed.
|
| |
| virtual void | OnGuiCreated () override |
| | Called just after GUI is initialized.
|
| |
| virtual void | OnGuiDestroyed () override |
| | Called just before GUI is released.
|
| |
| virtual void | OnComponentCreated () override |
| |
| virtual void | OnEndChanges (const ChangeSet &changeSet) override |
| | Callback function for end change event.
|
| |
| virtual void | OnRestoreSettings (const QSettings &settings) override |
| |
| | I_TEXTATTR (m_defaultDocumentTitleAttrPtr) |
| |
| virtual 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 |
| |
| virtual void | BeforeSavingDocument (const QString &filePath) |
| | Called just before the document is saved via persistence.
|
| |
| virtual void | AfterSavingDocument (bool saveState) |
| | Called immediately after saving the document via persistence.
|
| |
| virtual bool | OpenSingleDocument (const QString &filePath, bool createView, const QByteArray &viewTypeId, QByteArray &documentTypeId, bool beQuiet, bool *ignoredPtr, ibase::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 |
| |
| void | OnUndoManagerUpdate (const istd::IChangeable::ChangeSet &changeSet) |
| |
| virtual void | OnUpdate (const istd::IChangeable::ChangeSet &changeSet) override |
| | Called on update of observed model.
|
| |
| bool | SerializeOpenDocument (iser::IArchive &archive) |
| | Serializes open documents information.
|
| |
| virtual const idoc::IDocumentTemplate * | GetDocumentTemplate () const |
| |
| void | SetDocumentTemplate (const idoc::IDocumentTemplate *documentTemplatePtr) |
| |
| virtual void | OnBeginChanges () |
| | Callback function for begin change event.
|
| |
| void | SetModelPtr (imod::IModel *modelPtr) |
| | Set internal model pointer to specified value.
|
| |
| | CSingleModelObserverBase () |
| |
| virtual | ~CSingleModelObserverBase () |
| |
| imod::IModel * | GetObservedModel () const |
| | Get access to observed model.
|
| |
| imod::IModel * | GetModelPtr () 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.
|
| |
| virtual bool | IsModelAttached (const imod::IModel *modelPtr=NULL) const override |
| | Checks if the specified model is currently attached to this observer.
|
| |
| virtual bool | OnModelAttached (imod::IModel *modelPtr, istd::IChangeable::ChangeSet &changeMask) override |
| | Callback invoked when an observable model is about to be attached to this observer.
|
| |
| virtual bool | OnModelDetached (imod::IModel *modelPtr) override |
| | Callback invoked when an observable model is about to be detached from this observer.
|
| |
| virtual void | BeforeUpdate (imod::IModel *modelPtr) override |
| | Callback invoked before an update of the observer's content occurs.
|
| |
| virtual void | AfterUpdate (imod::IModel *modelPtr, const istd::IChangeable::ChangeSet &changeSet) override |
| | Callback invoked after an update of the observer's content occurs.
|
| |
| virtual bool | CreateGui (QWidget *parentPtr) override |
| |
| virtual bool | DestroyGui () override |
| |
| virtual void | OnGuiDesignChanged () |
| |
| 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 | SetDefaultVisualStatus () |
| |
| virtual void | OnLanguageChanged () override |
| |
| virtual void | OnDesignSchemaChanged (const QByteArray &themeId) override |
| |
| virtual bool | eventFilter (QObject *sourcePtr, QEvent *eventPtr) override |
| |
| virtual void | OnComponentDestroyed () override |
| |
| virtual QIcon | CreateIcon (const QString &iconName) const |
| |
Qt-based workspace implementation of a single document manager.
This component provides a workspace widget for Single Document Interface (SDI) applications. It manages a single document at a time, creating and displaying views within the workspace. When a new document is opened, it replaces the current document.
SDI applications typically have one main window with one document, similar to:
- Notepad
- Simple text editors
- Image viewers with one image at a time
- Component Attributes
- DefaultDocumentTitle - Title for untitled documents (default: "<no name>")
- RememberOpenDocumentOnExit - Restore last document on restart (default: false)
- Component References
- DocumentTemplate - Document template for creating documents (required)
- Configuration Example
DefaultDocumentTitle = "Untitled"
RememberOpenDocumentOnExit = true
DocumentTemplate = MyDocumentTemplate
}
Qt-based workspace implementation of a single document manager.
- Usage in Main Window
ApplicationInfo = AppInfo
DocumentManager = DocumentManager
DocumentTemplate = TextDocumentTemplate
DefaultDocumentTitle = "New Document"
RememberOpenDocumentOnExit = true
}
}
Standard main window component for any document-based application.
- Features
- Automatic view management (creates and destroys views as needed)
- Window title updates with document name
- Optional document persistence between sessions
- Clean workspace for single-document workflows
- Integrated with ACF GUI restoration system
- Typical Workflow
- User opens document via File > Open
- Workspace creates view for document
- View is displayed in workspace widget
- Window title updates to show document name
- User works with document
- On File > Open (another document), previous document is closed (with save prompt if dirty)
- New document and view are created
- See also
- CMainWindowGuiComp, CSingleDocumentManagerBase, CMultiDocumentWorkspaceGuiComp
Definition at line 90 of file CSingleDocumentWorkspaceGuiComp.h.