|
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 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.
|
|
enum | ChangeFlags {
CF_ICF_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
, SO_CHANGE_LOCK = 1 << 5
} |
| 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...
|
|
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 |
|
|
| CMultiDocumentManagerBase () |
| Default constructor.
|
|
virtual idoc::IUndoManager * | GetUndoManagerForDocument (const istd::IChangeable *documentPtr) const |
| Return undo mananger for document documenPtr .
|
|
virtual int | GetDocumentsCount () const |
| Get number of opened documents.
|
|
virtual istd::IChangeable & | GetDocumentFromIndex (int index, DocumentInfo *documentInfoPtr=nullptr) const |
| Get document at specified index.
|
|
virtual int | GetViewsCount (int documentIndex) const |
| Get number of view for specified document.
|
|
virtual istd::IPolymorphic * | GetViewFromIndex (int documentIndex, int viewIndex) const |
| Get single view using its and document indices.
|
|
virtual istd::IPolymorphic * | GetActiveView () const |
| Return the active document.
|
|
virtual void | SetActiveView (istd::IPolymorphic *viewPtr) |
| Indicate that some view is active now.
|
|
virtual istd::IChangeable * | GetDocumentFromView (const istd::IPolymorphic &view, DocumentInfo *documentInfoPtr=nullptr) const |
| Return the document assigned to view.
|
|
virtual istd::IPolymorphic * | AddViewToDocument (const istd::IChangeable &document, const QByteArray &viewTypeId=QByteArray()) |
| Add a new view to the document.
|
|
virtual QByteArray | GetDocumentTypeId (const istd::IChangeable &document) const |
| Get ID of document type managed by this object.
|
|
virtual bool | InsertNewDocument (const QByteArray &documentTypeId, bool createView=true, const QByteArray &viewTypeId="", istd::IChangeable **newDocumentPtr=nullptr, bool beQuiet=false, bool *ignoredPtr=nullptr) |
| Creates a new document with the document ID documentTypeId .
|
|
virtual bool | OpenDocument (const QByteArray *documentTypeIdPtr, const QString *fileNamePtr=nullptr, bool createView=true, const QByteArray &viewTypeId="", istd::IChangeable **documentPtr=nullptr, FileToTypeMap *loadedMapPtr=nullptr, bool beQuiet=false, bool *ignoredPtr=nullptr, iproc::IProgressManager *progressManagerPtr=nullptr) |
| Opens document(s) from the file list.
|
|
virtual bool | SaveDocument (int documentIndex=-1, bool requestFileName=false, FileToTypeMap *savedMapPtr=nullptr, bool beQuiet=false, bool *ignoredPtr=nullptr, iproc::IProgressManager *progressManagerPtr=nullptr) |
| Save document.
|
|
virtual bool | SaveDirtyDocuments (bool beQuiet=false, bool *ignoredPtr=nullptr) |
| Ask user (optional) and save all dirty (changed) documents.
|
|
virtual bool | CloseDocument (int documentIndex=-1, bool beQuiet=false, bool *ignoredPtr=nullptr) |
| Close document and all its views.
|
|
virtual bool | CloseView (istd::IPolymorphic *viewPtr=nullptr, bool beQuiet=false, bool *ignoredPtr=nullptr) |
| Close view.
|
|
| CTmplBasedDocumentManagerBase () |
|
virtual int | GetAllowedOperationFlags (const istd::IPolymorphic *viewPtr=nullptr) const |
| Get flags of allowed operations.
|
|
virtual bool | IsFeatureSupported (int featureFlags, const QByteArray &documentTypeId) const |
| Return true , if the feature(s) is supported by this document template.
|
|
virtual Ids | GetDocumentTypeIds () const |
| Get list of supported document ID's can be created for specified file.
|
|
virtual QString | GetDocumentTypeName (const QByteArray &documentTypeId) const |
| Get human readable name of some document type ID.
|
|
virtual ifile::IFileTypeInfo * | GetDocumentFileTypeInfo (const QByteArray &documentTypeId) const |
| Get file type information object for some selected document type.
|
|
virtual Ids | GetDocumentTypeIdsForFile (const QString &filePath) const |
| Get list of supported document ID's can be created for specified file.
|
|
virtual QString | GetDefaultDirectory (const QString &sugestedDir="", const QByteArray *documentTypeIdPtr=nullptr) const |
| 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 std::unique_ptr< 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 QMutex * | GetChangesLock () const |
| Get mutex beeing locked during changes, if available.
|
|
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 istd::IChangeable * | OpenSingleDocument (const QString &filePath, bool createView, const QByteArray &viewTypeId, QByteArray &documentTypeId, bool beQuiet, bool *ignoredPtr, iproc::IProgressManager *progressManagerPtr) |
| Open single document using its file path.
|
|
virtual void | CloseAllDocuments () |
|
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 std::unique_ptr< 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.
|
|
virtual void | OnViewRegistered (istd::IPolymorphic *viewPtr, const SingleDocumentData &documentData)=0 |
| Called after view is registered.
|
|
virtual void | OnViewRemoved (istd::IPolymorphic *viewPtr)=0 |
| Called before view is removed.
|
|
virtual QStringList | GetOpenFilePaths (const QByteArray *documentTypeIdPtr=nullptr) const =0 |
| Gets open file names.
|
|
virtual QString | GetSaveFilePath (const QByteArray &documentTypeId, const istd::IChangeable *dataObjectPtr, const QString ¤tFilePath) const =0 |
| Gets save file name.
|
|
virtual bool | QueryDocumentSave (const SingleDocumentData &info, bool *ignoredPtr)=0 |
| Query user if this document should be saved.
|
|
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 void | OnEndChanges (const ChangeSet &changeSet) |
| Callback function for end change event.
|
|
Basic implementation of a template-based multiple document manager.
Definition at line 27 of file CMultiDocumentManagerBase.h.