6#include <QtCore/QByteArray>
10#include <QtCore/QString>
20 class IProgressManager;
260 const QByteArray& documentTypeId,
261 bool createView =
true,
262 const QByteArray& viewTypeId =
"",
264 bool beQuiet =
false,
265 bool* ignoredPtr =
NULL) = 0;
278 const QByteArray* documentTypeIdPtr =
NULL,
279 const QString* fileNamePtr =
NULL,
280 bool createView =
true,
281 const QByteArray& viewTypeId =
"",
284 bool beQuiet =
false,
285 bool* ignoredPtr =
NULL,
297 int documentIndex = -1,
298 bool requestFileName =
false,
300 bool beQuiet =
false,
301 bool* ignoredPtr =
NULL,
320 virtual bool CloseDocument(
int documentIndex = -1,
bool beQuiet =
false,
bool* ignoredPtr =
NULL) = 0;
Consume information about progress of some process.
Provide set of user actions needed to manage documents in MVC (Model View Controller) concept.
virtual idoc::IUndoManager * GetUndoManagerForDocument(const istd::IChangeable *documentPtr) const =0
Return undo manager for document documentPtr.
ChangeFlags
Possible changes in the manager data model.
@ CF_DOCUMENT_RENAMED
A document has been renamed or its file path has changed.
@ CF_VIEW_ACTIVATION_CHANGED
The active view has changed to a different view.
@ CF_DOCUMENT_COUNT_CHANGED
The total number of managed documents has changed.
@ CF_DOCUMENT_CREATED
A new document has been created.
@ CF_DOCUMENT_REMOVED
A document has been removed from the manager.
virtual bool CloseView(istd::IPolymorphic *viewPtr=NULL, bool beQuiet=false, bool *ignoredPtr=NULL)=0
Close view.
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 void SetActiveView(istd::IPolymorphic *viewPtr)=0
Indicate that some view is active now.
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 istd::IChangeable & GetDocumentFromIndex(int index, DocumentInfo *documentInfoPtr=NULL) const =0
Get document at specified index.
virtual istd::IPolymorphic * GetViewFromIndex(int documentIndex, int viewIndex) const =0
Get single view using its and document indices.
virtual int GetViewsCount(int documentIndex) const =0
Get number of view for specified document.
virtual int GetAllowedOperationFlags(const istd::IPolymorphic *viewPtr=NULL) const =0
Get flags of allowed operations.
virtual bool CloseDocument(int documentIndex=-1, bool beQuiet=false, bool *ignoredPtr=NULL)=0
Close document and all its views.
OperationFlags
Flags describing possible operations that can be performed by the document manager.
@ OF_FILE_NEW
New document creation is supported.
@ OF_KNOWN_PATH
Document has a known file path.
@ OF_FILE_SAVE
Saving documents is supported.
@ OF_FILE_OPEN
Opening existing documents is supported.
@ OF_FILE_SAVE_AS
Save As operation is supported.
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 QByteArray GetDocumentTypeId(const istd::IChangeable &document) const =0
Get ID of document type managed by this object.
virtual istd::IChangeable * GetDocumentFromView(const istd::IPolymorphic &view, DocumentInfo *documentInfoPtr=NULL) const =0
Return the document assigned to view.
QMap< QString, QByteArray > FileToTypeMap
Map from file path to document type ID's.
virtual bool SaveDirtyDocuments(bool beQuiet=false, bool *ignoredPtr=NULL)=0
Ask user (optional) and save all dirty (changed) documents.
virtual istd::IPolymorphic * AddViewToDocument(const istd::IChangeable &document, const QByteArray &viewTypeId=QByteArray())=0
Add a new view to the document.
virtual int GetDocumentsCount() const =0
Get number of opened documents.
virtual istd::IPolymorphic * GetActiveView() const =0
Return the active document.
Provide information about different document types.
Interface providing UNDO/REDO functionality.
Common interface for data model objects, which can be changed.
Base interface for all used interfaces and implementations.
This namespace contains basic implementations of standard primitives on the component level.
Contains the system independent basic implementations of Document/View design pattern.
Information about a document managed by the document manager.
QByteArray documentTypeId
Type identifier of the document.
bool isDirty
True if document has unsaved changes.
QString filePath
Full file path of the document, empty if not saved yet.