|
ACF $AcfVersion:0$
|
Provide set of user actions needed to manage documents in MVC (Model View Controller) concept. More...
#include <IDocumentManager.h>
Classes | |
| struct | DocumentInfo |
| Information about a document managed by the document manager. More... | |
Public Types | |
| 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. | |
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... | |
| typedef QMultiMap< QByteArray, QVariant > | ChangeInfoMap |
Public Types inherited from idoc::IDocumentTypesInfo | |
| 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. | |
Public Member Functions | |
| virtual int | GetAllowedOperationFlags (const istd::IPolymorphic *viewPtr=NULL) const =0 |
| Get flags of allowed operations. | |
| virtual idoc::IUndoManager * | GetUndoManagerForDocument (const istd::IChangeable *documentPtr) const =0 |
Return undo manager for document documentPtr. | |
| virtual int | GetDocumentsCount () const =0 |
| Get number of opened documents. | |
| virtual istd::IChangeable & | GetDocumentFromIndex (int index, DocumentInfo *documentInfoPtr=NULL) const =0 |
| Get document at specified index. | |
| virtual int | GetViewsCount (int documentIndex) const =0 |
| Get number of view for specified document. | |
| virtual istd::IPolymorphic * | GetViewFromIndex (int documentIndex, int viewIndex) const =0 |
| Get single view using its and document indices. | |
| virtual istd::IPolymorphic * | GetActiveView () const =0 |
| Return the active document. | |
| virtual void | SetActiveView (istd::IPolymorphic *viewPtr)=0 |
| Indicate that some view is active now. | |
| 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 QByteArray | GetDocumentTypeId (const istd::IChangeable &document) const =0 |
| 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)=0 |
Creates a new document with the document ID documentTypeId. | |
| virtual bool | OpenDocument (const QByteArray *documentTypeIdPtr=NULL, 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)=0 |
| 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)=0 |
| Save document. | |
| virtual bool | SaveDirtyDocuments (bool beQuiet=false, bool *ignoredPtr=NULL)=0 |
| Ask user (optional) and save all dirty (changed) documents. | |
| virtual bool | CloseDocument (int documentIndex=-1, bool beQuiet=false, bool *ignoredPtr=NULL)=0 |
| Close document and all its views. | |
| virtual bool | CloseView (istd::IPolymorphic *viewPtr=NULL, bool beQuiet=false, bool *ignoredPtr=NULL)=0 |
| Close view. | |
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 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. | |
Public Member Functions inherited from istd::IPolymorphic | |
| virtual | ~IPolymorphic () |
Public Member Functions inherited from idoc::IDocumentTypesInfo | |
| virtual bool | IsFeatureSupported (int featureFlags, const QByteArray &documentTypeId) const =0 |
Return true, if the feature(s) is supported by this document template. | |
| virtual Ids | GetDocumentTypeIds () const =0 |
| Get list of supported document type IDs. | |
| virtual QString | GetDocumentTypeName (const QByteArray &documentTypeId) const =0 |
| Get human readable name of some document type ID. | |
| virtual ifile::IFileTypeInfo * | GetDocumentFileTypeInfo (const QByteArray &documentTypeId) const =0 |
| Get file type information object for some selected document type. | |
| virtual Ids | GetDocumentTypeIdsForFile (const QString &filePath) const =0 |
| Get list of supported document IDs that can handle the specified file. | |
| virtual QString | GetDefaultDirectory (const QString &sugestedDir="", const QByteArray *documentTypeIdPtr=NULL) const =0 |
| Return default directory for specified document type. | |
Additional Inherited Members | |
Static Public Member Functions inherited from istd::IChangeable | |
| static const ChangeSet & | GetNoChanges () |
| Get empty set of changes. | |
| static const ChangeSet & | GetAnyChange () |
| Get anonymous change set. | |
| static const ChangeSet & | GetAllChanges () |
| Get anonymous change set. | |
| static const ChangeSet & | GetDelegatedChanges () |
| Get delegated change set. | |
Protected Member Functions inherited from istd::IChangeable | |
| virtual void | OnBeginChanges () |
| Callback function for begin change event. | |
| virtual void | OnEndChanges (const ChangeSet &changeSet) |
| Callback function for end change event. | |
Provide set of user actions needed to manage documents in MVC (Model View Controller) concept.
The document manager is the central component in the ACF document/view architecture. It manages the lifecycle of documents and their associated views, handles file operations (new, open, save, close), and maintains the document state.
Key responsibilities:
The manager supports both single and multi-document interfaces (SDI/MDI). For SDI applications, typically only one document is active at a time. For MDI applications, multiple documents can be open simultaneously with one being active.
Definition at line 84 of file IDocumentManager.h.
| typedef QMap<QString, QByteArray> idoc::IDocumentManager::FileToTypeMap |
Map from file path to document type ID's.
Used for tracking loaded files and their associated document types.
Definition at line 144 of file IDocumentManager.h.
Possible changes in the manager data model.
These flags are used to notify observers about specific changes in the document manager state.
Definition at line 93 of file IDocumentManager.h.
Flags describing possible operations that can be performed by the document manager.
These flags indicate which file operations are currently supported.
Definition at line 131 of file IDocumentManager.h.
|
pure virtual |
Add a new view to the document.
| document | document instance |
| viewTypeId | ID of view type, if it will be created. |
Implemented in idoc::CMultiDocumentManagerBase, and idoc::CSingleDocumentManagerBase.
|
pure virtual |
Close document and all its views.
| documentIndex | optional index of document to close, if negative then current active document will be closed. |
| beQuiet | if true, no user interaction will be done. Typically user will be asked for saving document. |
| ignoredPtr | optional return flag indicating that closing was aborted by user. |
Implemented in idoc::CMultiDocumentManagerBase, and idoc::CSingleDocumentManagerBase.
|
pure virtual |
Close view.
| viewPtr | pointer to view should be closed or NULL if current active view should be closed. |
| beQuiet | if true, no user interaction will be done. Typically user will be asked for saving document. |
| ignoredPtr | optional return flag indicating that closing was aborted by user. |
Implemented in idoc::CMultiDocumentManagerBase, and idoc::CSingleDocumentManagerBase.
|
pure virtual |
Return the active document.
If no document is active, the function return a NULL
Implemented in idoc::CMultiDocumentManagerBase, and idoc::CSingleDocumentManagerBase.
|
pure virtual |
Get flags of allowed operations.
| viewPtr | Optional pointer to a specific view to check operations for. If NULL, checks operations for the active view/document. |
Implemented in idoc::CTmplBasedDocumentManagerBase.
|
pure virtual |
Get document at specified index.
| index | Zero-based index of document (0 to GetDocumentsCount()-1). |
| documentInfoPtr | Optional pointer to receive additional information about the document. |
Implemented in idoc::CMultiDocumentManagerBase, and idoc::CSingleDocumentManagerBase.
|
pure virtual |
Return the document assigned to view.
| view | view object. |
| documentInfoPtr | optional return value describing some additional informations about document. |
NULL if no document for this view exists. Implemented in idoc::CMultiDocumentManagerBase, and idoc::CSingleDocumentManagerBase.
|
pure virtual |
Get number of opened documents.
Implemented in idoc::CMultiDocumentManagerBase, and idoc::CSingleDocumentManagerBase.
|
pure virtual |
Get ID of document type managed by this object.
Implemented in idoc::CMultiDocumentManagerBase, and idoc::CSingleDocumentManagerBase.
|
pure virtual |
Return undo manager for document documentPtr.
| documentPtr | Pointer to the document to get undo manager for. |
Each document can have its own undo manager to track and reverse changes.
Implemented in idoc::CMultiDocumentManagerBase, and idoc::CSingleDocumentManagerBase.
|
pure virtual |
Get single view using its and document indices.
Implemented in idoc::CMultiDocumentManagerBase, and idoc::CSingleDocumentManagerBase.
|
pure virtual |
Get number of view for specified document.
Implemented in idoc::CMultiDocumentManagerBase, and idoc::CSingleDocumentManagerBase.
|
pure virtual |
Creates a new document with the document ID documentTypeId.
| documentTypeId | ID of document type. |
| createView | if true, view will be automatically created. |
| viewTypeId | ID of view type, if it will be created. |
| newDocumentPtr | optional pointer where new created document will be returned. |
| beQuiet | if true, no user interaction will be done. |
| ignoredPtr | optional return flag indicating that creating was aborted by user. |
Implemented in idoc::CMultiDocumentManagerBase, and idoc::CSingleDocumentManagerBase.
|
pure virtual |
Opens document(s) from the file list.
| documentTypeIdPtr | optional ID of document type. If it is NULL, document type will be found automatically. |
| fileNamePtr | file name. |
| createView | if true, view will be automatically created. |
| viewTypeId | ID of view type, if it will be created. |
| loadedMapPtr | optional list of loaded files and its document type ID's. |
| beQuiet | if true, no user interaction will be done. |
| ignoredPtr | optional return flag indicating that opening was aborted by user. |
Implemented in idoc::CMultiDocumentManagerBase, and idoc::CSingleDocumentManagerBase.
|
pure virtual |
Ask user (optional) and save all dirty (changed) documents.
| beQuiet | if true, no user interaction will be done. Typically user will be asked for saving document. |
| ignoredPtr | optional return flag indicating that process was aborted by user. |
Implemented in idoc::CMultiDocumentManagerBase, and idoc::CSingleDocumentManagerBase.
|
pure virtual |
Save document.
| documentIndex | optional index of document to save, if negative then current active document will be saved. |
| requestFileName | if true, file name will be always requested by user. |
| savedMapPtr | optional list of files will be extended with currently saved file. |
| beQuiet | if true, no user interaction will be done. |
| ignoredPtr | optional return flag indicating that saving was aborted by user. |
Implemented in idoc::CMultiDocumentManagerBase, and idoc::CSingleDocumentManagerBase.
|
pure virtual |
Indicate that some view is active now.
Implemented in idoc::CMultiDocumentManagerBase, iqtdoc::CMultiDocumentWorkspaceGuiComp, and iqtdoc::CSingleDocumentWorkspaceGuiComp.