This class is a Qt-based workspace implementation of a multi-document manager.
More...
|
| enum | GroupId { GI_WINDOW = 0x300
, GI_DOCUMENT
, GI_VIEW
} |
| |
| typedef iqtdoc::TQtDocumentManagerWrap< idoc::CMultiDocumentManagerBase, iqtgui::TRestorableGuiWrap< iqtgui::TGuiComponentBase< QMdiArea > > > | BaseClass |
| |
| typedef idoc::CMultiDocumentManagerBase | BaseClass |
| |
| typedef BaseClass::Ids | Ids |
| |
| enum | ModelId { MI_UNDO_MANAGER = 1
, MI_DOCUMENT
} |
| |
| 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< QMdiArea > | 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 |
| |
Public Types inherited from ibase::ICommandsProvider |
| enum | ChangeFlags { CF_COMMANDS = 0x62b7e8
} |
| |
|
| | CMultiDocumentWorkspaceGuiComp () |
| |
| virtual void | SetActiveView (istd::IPolymorphic *viewPtr) override |
| | Indicate that some view is active now.
|
| |
| virtual const ibase::IHierarchicalCommand * | GetCommands () const override |
| | Get list of menu commands.
|
| |
| virtual void | OnTryClose (bool *ignoredPtr=NULL) override |
| | Called when the application is attempting to close.
|
| |
| virtual void | OnGuiDesignChanged () override |
| |
| virtual QString | GetSaveFilePath (const QByteArray &documentTypeId, const istd::IChangeable *dataObjectPtr, const QString ¤tFilePath) const override |
| |
| | CMultiDocumentManagerBase () |
| | Default constructor.
|
| |
| 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 QMdiArea * | 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) |
| |
|
| void | UpdateAllTitles () |
| | Update titles of views or all views of specified document.
|
| |
| iqtgui::IGuiObject * | GetViewFromWidget (const QWidget &widget) const |
| | Find view object associated with specified Qt widget.
|
| |
| int | GetDocumentIndexFromWidget (const QWidget &widget) const |
| | Find index of document associated with specified Qt widget.
|
| |
| virtual void | CreateConnections () |
| | Creates signal/slot connnections for the implementation.
|
| |
| void | OnViewsCountChanged () |
| | Called when number of windows changed.
|
| |
| virtual istd::IChangeableSharedPtr | OpenSingleDocument (const QString &filePath, bool createView, const QByteArray &viewTypeId, QByteArray &documentTypeId, bool beQuiet, bool *ignoredPtr, ibase::IProgressManager *progressManagerPtr) override |
| | Open single document using its file path.
|
| |
| virtual bool | eventFilter (QObject *sourcePtr, QEvent *eventPtr) override |
| |
| virtual void | OnRestoreSettings (const QSettings &settings) override |
| |
| virtual void | OnSaveSettings (QSettings &settings) const override |
| |
| virtual void | CloseAllDocuments () override |
| |
| virtual QStringList | GetOpenFilePaths (const QByteArray *documentTypeIdPtr=NULL) const override |
| | Gets open file names.
|
| |
| virtual void | OnViewRegistered (istd::IPolymorphic *viewPtr, const SingleDocumentData &documentData) override |
| | Called after view is registered.
|
| |
| virtual void | OnViewRemoved (istd::IPolymorphic *viewPtr) override |
| | Called before view is removed.
|
| |
| virtual bool | QueryDocumentSave (const SingleDocumentData &info, bool *ignoredPtr) override |
| | Query user if this document should be saved.
|
| |
| virtual void | OnGuiCreated () override |
| | Called just after GUI is initialized.
|
| |
| virtual void | OnGuiDestroyed () override |
| | Called just before GUI is released.
|
| |
| virtual void | OnRetranslate () override |
| | Called when non-GUI elements (like commands) should be retranslated.
|
| |
| virtual void | OnGuiRetranslate () override |
| | Called from widget event filter when GUI should be retranslated.
|
| |
| virtual void | OnComponentCreated () override |
| |
| virtual void | OnEndChanges (const ChangeSet &changeSet) override |
| | Callback function for end change event.
|
| |
| 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 |
| |
| SingleDocumentData & | GetSingleDocumentData (int index) const |
| | Get internal document data object.
|
| |
| SingleDocumentData * | GetActiveDocumentInfo () const |
| | Get document info assigned to active view.
|
| |
| SingleDocumentData * | GetDocumentInfoFromView (const istd::IPolymorphic &view) const |
| | Get document info assigned to specified view.
|
| |
| SingleDocumentData * | GetDocumentInfoFromPath (const QString &filePath) const |
| | Get document info assigned to specified file.
|
| |
| int | GetDocumentIndex (const SingleDocumentData &document) const |
| | Get position index of the given document in the document list.
|
| |
| virtual SingleDocumentData * | CreateUnregisteredDocument (const QByteArray &documentTypeId, bool createView, const QByteArray &viewTypeId, bool initialize, bool beQuiet, bool *ignoredPtr) const |
| | Create instance of specified document without attaching to this manager.
|
| |
| bool | RegisterDocument (SingleDocumentData *documentPtr) |
| | Register (attach) created document as new working document.
|
| |
| bool | SerializeOpenDocumentList (iser::IArchive &archive) |
| | Serializes open documents information.
|
| |
| virtual void | OnDocumentSaved () |
| | Execute after document saved.
|
| |
| virtual const idoc::IDocumentTemplate * | GetDocumentTemplate () const |
| |
| void | SetDocumentTemplate (const idoc::IDocumentTemplate *documentTemplatePtr) |
| |
| virtual void | OnBeginChanges () |
| | Callback function for begin change event.
|
| |
| virtual bool | CreateGui (QWidget *parentPtr) override |
| |
| virtual bool | DestroyGui () override |
| |
| 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.
|
| |
| 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 void | OnComponentDestroyed () override |
| |
| virtual QIcon | CreateIcon (const QString &iconName) const |
| |
This class is a Qt-based workspace implementation of a multi-document manager.
Provides a Multiple Document Interface (MDI) workspace using Qt's QMdiArea. This component manages multiple documents simultaneously, each with its own view(s) displayed in the workspace. Users can switch between documents, tile/cascade windows, and work with multiple documents at once.
MDI applications are useful for:
- Image editors handling multiple images
- Text editors with multiple files open
- CAD applications with multiple drawings
- Any application where users work with multiple documents simultaneously
- Component Attributes
- ShowViewMaximized - Start with views maximized (default: true)
- ShowFilePathAsToolTip - Show full path in tab tooltip (default: false)
- AllowViewRepeating - Allow multiple views of same document (default: true)
- RememberOpenDocumentsOnExit - Restore session on restart (default: false)
- WorkspaceBackgroundColor - MDI area background color (default: empty = system)
- DefaultCreatedDocumentTypeId - Auto-create document type on startup
- Component References
- DocumentTemplate - Document template for creating documents (required)
- View Modes
- The workspace supports different view modes for organizing document windows:
- Tabbed - Documents appear in tabs (modern, clean interface)
- Windowed - Traditional MDI with movable/resizable sub-windows
- Configuration Example
DocumentTemplate = CompositeTemplate
ShowViewMaximized = false
ShowFilePathAsToolTip = true
AllowViewRepeating = true
RememberOpenDocumentsOnExit = true
DefaultCreatedDocumentTypeId = "TextDocument"
WorkspaceBackgroundColor = "#f0f0f0"
}
This class is a Qt-based workspace implementation of a multi-document manager.
- Tabbed Mode Configuration
DocumentTemplate = MyTemplate
ViewMode = "Tabbed"
IsViewCloseEnabled = true
IsTabsMovable = true
}
- Usage in Application
ApplicationInfo = AppInfo
DocumentManager = MultiDocManager
DocumentTemplate = CompositeTemplate
AllowViewRepeating = true
RememberOpenDocumentsOnExit = true
}
}
Standard main window component for any document-based application.
- Document Management Commands
- The workspace provides commands for:
- Window > Cascade - Arrange windows in cascade
- Window > Tile - Tile windows to fill workspace
- Window > Close - Close active document
- Window > Close All - Close all documents
- Window > Next - Switch to next document
- Window > Previous - Switch to previous document
- Window list - Quick selection of open documents
- Multiple Views
- When AllowViewRepeating is enabled, users can create multiple views of the same document (e.g., split view for large documents):
Provide set of user actions needed to manage documents in MVC (Model View Controller) concept.
virtual istd::IChangeable * GetDocumentFromView(const istd::IPolymorphic &view, DocumentInfo *documentInfoPtr=NULL) const =0
Return the document assigned to view.
virtual istd::IPolymorphic * AddViewToDocument(const istd::IChangeable &document, const QByteArray &viewTypeId=QByteArray())=0
Add a new view to the document.
virtual istd::IPolymorphic * GetActiveView() const =0
Return the active document.
Common interface for data model objects, which can be changed.
Base interface for all used interfaces and implementations.
- Session Restoration
- When RememberOpenDocumentsOnExit is enabled:
- All open document paths are saved on exit
- Documents are automatically reopened on next launch
- Window positions and states are preserved
- Active document is restored
- See also
- CMainWindowGuiComp, CMultiDocumentManagerBase, CSingleDocumentWorkspaceGuiComp
Definition at line 141 of file CMultiDocumentWorkspaceGuiComp.h.