|
ACF $AcfVersion:0$
|
Base implementation of document manager. More...
#include <CTmplBasedDocumentManagerBase.h>
Public Member Functions | |
| 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. | |
Public Member Functions inherited from idoc::IDocumentManager | |
| 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 () |
Protected Member Functions | |
| 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. | |
| virtual void | OnEndChanges (const ChangeSet &changeSet) |
| Callback function for end change event. | |
Additional Inherited Members | |
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 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. | |
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. | |
Base implementation of document manager.
This implementation base on the document template concept.
Definition at line 21 of file CTmplBasedDocumentManagerBase.h.
| idoc::CTmplBasedDocumentManagerBase::CTmplBasedDocumentManagerBase | ( | ) |
|
overridevirtual |
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. |
Implements idoc::IDocumentManager.
|
overridevirtual |
Return default directory for specified document type.
| suggestedDir | Template directory suggested by user or application. |
| documentTypeIdPtr | Optional pointer to ID of document type. |
If suggestedDir is provided and valid, it may be used. Otherwise, the type-specific default directory is returned.
Implements idoc::IDocumentTypesInfo.
|
overridevirtual |
Get file type information object for some selected document type.
| documentTypeId | ID of document type as returned by GetDocumentTypeIds(). |
Implements idoc::IDocumentTypesInfo.
|
protectedvirtual |
|
overridevirtual |
Get list of supported document type IDs.
Implements idoc::IDocumentTypesInfo.
|
overridevirtual |
Get list of supported document IDs that can handle the specified file.
| filePath | Full path to file to check. |
This method determines which document types are compatible with a given file based on file extension, content analysis, or other criteria.
Implements idoc::IDocumentTypesInfo.
|
overridevirtual |
Get human readable name of some document type ID.
| documentTypeId | ID of document type as returned by GetDocumentTypeIds(). |
Implements idoc::IDocumentTypesInfo.
|
overridevirtual |
Return true, if the feature(s) is supported by this document template.
| featureFlags | Bitwise OR of SupportedFeatures flags to check. |
| documentTypeId | ID of document type to check. |
Implements idoc::IDocumentTypesInfo.
|
protected |