51 const QByteArray& documentTypeId,
52 bool createView =
true,
53 const QByteArray& viewTypeId =
"",
56 bool* ignoredPtr =
NULL)
override;
58 const QByteArray* documentTypeIdPtr,
59 const QString* fileNamePtr =
NULL,
60 bool createView =
true,
61 const QByteArray& viewTypeId =
"",
65 bool* ignoredPtr =
NULL,
68 int documentIndex = -1,
69 bool requestFileName =
false,
72 bool* ignoredPtr =
NULL,
75 virtual bool CloseDocument(
int documentIndex = -1,
bool beQuiet =
false,
bool* ignoredPtr =
NULL)
override;
97 const QByteArray& documentTypeId,
121 const QString& filePath,
123 const QByteArray& viewTypeId,
124 QByteArray& documentTypeId,
160 const QByteArray& documentTypeId,
162 const QByteArray& viewTypeId,
165 bool* ignoredPtr)
const;
Consume information about progress of some process.
Basic implementation of a template-based multiple document manager.
virtual istd::IChangeableSharedPtr 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.
SingleDocumentData * GetDocumentInfoFromPath(const QString &filePath) const
Get document info assigned to specified file.
virtual bool CloseDocument(int documentIndex=-1, bool beQuiet=false, bool *ignoredPtr=NULL) override
Close document and all its views.
virtual void SetActiveView(istd::IPolymorphic *viewPtr) override
Indicate that some view is active now.
virtual QByteArray GetDocumentTypeId(const istd::IChangeable &document) const override
Get ID of document type managed by this object.
virtual idoc::IUndoManager * GetUndoManagerForDocument(const istd::IChangeable *documentPtr) const override
Return undo manager for document documentPtr.
virtual void OnViewRemoved(istd::IPolymorphic *viewPtr)=0
Called before view is removed.
bool SerializeOpenDocumentList(iser::IArchive &archive)
Serializes open documents information.
istd::IChangeableSharedPtr DocumentPtr
idoc::IDocumentTemplate::ViewSharedPtr ViewPtr
bool RegisterDocument(SingleDocumentData *documentPtr)
Register (attach) created document as new working document.
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.
SingleDocumentData * GetActiveDocumentInfo() const
Get document info assigned to active view.
istd::IPolymorphic * m_activeViewPtr
virtual bool CloseView(istd::IPolymorphic *viewPtr=NULL, bool beQuiet=false, bool *ignoredPtr=NULL) override
Close view.
virtual istd::IPolymorphic * GetViewFromIndex(int documentIndex, int viewIndex) const override
Get single view using its and document indices.
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.
DocumentInfos m_documentInfos
virtual istd::IPolymorphic * AddViewToDocument(const istd::IChangeable &document, const QByteArray &viewTypeId=QByteArray()) override
Add a new view to the document.
virtual bool QueryDocumentSave(const SingleDocumentData &info, bool *ignoredPtr)=0
Query user if this document should be saved.
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 void OnViewRegistered(istd::IPolymorphic *viewPtr, const SingleDocumentData &documentData)=0
Called after view is registered.
virtual bool SaveDirtyDocuments(bool beQuiet=false, bool *ignoredPtr=NULL) override
Ask user (optional) and save all dirty (changed) documents.
istd::TPointerVector< SingleDocumentData > DocumentInfos
virtual istd::IPolymorphic * GetActiveView() const override
Return the active document.
SingleDocumentData * GetDocumentInfoFromView(const istd::IPolymorphic &view) const
Get document info assigned to specified view.
virtual istd::IChangeable * GetDocumentFromView(const istd::IPolymorphic &view, DocumentInfo *documentInfoPtr=NULL) const override
Return the document assigned to view.
virtual QStringList GetOpenFilePaths(const QByteArray *documentTypeIdPtr=NULL) const =0
Gets open file names.
int GetDocumentIndex(const SingleDocumentData &document) const
Get position index of the given document in the document 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.
idoc::IUndoManagerSharedPtr UndoManagerPtr
virtual void CloseAllDocuments()
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 void OnDocumentSaved()
Execute after document saved.
virtual QString GetSaveFilePath(const QByteArray &documentTypeId, const istd::IChangeable *dataObjectPtr, const QString ¤tFilePath) const =0
Gets save file name.
SingleDocumentData & GetSingleDocumentData(int index) const
Get internal document data object.
CMultiDocumentManagerBase()
Default constructor.
virtual int GetDocumentsCount() const override
Get number of opened documents.
Base implementation of document manager.
QMap< QString, QByteArray > FileToTypeMap
Map from file path to document type ID's.
Interface providing UNDO/REDO functionality.
Generic implementation of a data model changes notifier.
Represents an input/output persistence archive for object serialization.
Set of change flags (its IDs).
Common interface for data model objects, which can be changed.
Base interface for all used interfaces and implementations.
Implementation of a pointer container, which controls the live cycle of the pointer object.
Contains the system independent basic implementations of Document/View design pattern.
Document data definition.
SingleDocumentData(CMultiDocumentManagerBase *parentPtr, const QByteArray &documentTypeId, DocumentPtr &documentPtr)
UndoManagerPtr undoManagerPtr
virtual void OnModelChanged(int modelId, const istd::IChangeable::ChangeSet &changeSet) override
Called when some model observed by dispatcher will be changed.
virtual ~SingleDocumentData()
CMultiDocumentManagerBase * parentPtr
Information about a document managed by the document manager.