ACF $AcfVersion:0$
Classes | Typedefs

Contains the system independent basic implementations of Document/View design pattern. More...

Classes

class  CCompositeDocumentTemplateComp
 Complex document template consists of more simple templates. More...
 
class  CMultiDocumentManagerBase
 Basic implementation of a template-based multiple document manager. More...
 
class  CMultiPageDocumentFilePersistenceComp
 File based persistence of the multi-paged bitmap document. More...
 
class  CSelectedDocModelBinderComp
 Conditional model-observer binder depending on actual selection. More...
 
class  CSerializedUndoManagerComp
 Implements multi-level UNDO mechanism based on storing complete object state at each step using serialization. More...
 
class  CSingleDocumentManagerBase
 Basic implementation of a template-based single document manager. More...
 
class  CSingleDocumentTemplateBase
 Base class implementing document template for single document type. More...
 
class  CSingleDocumentTemplateComp
 Document template component supporting only one type of the provided document. More...
 
class  CStandardDocumentMetaInfo
 Implementation of the basic document's meta information. More...
 
class  CTextDocumentComp
 Simple implementation of a text document model. More...
 
class  CTextFileLoaderComp
 Persistence component for files containing plain text. More...
 
class  CTmplBasedDocumentManagerBase
 Base implementation of document manager. More...
 
class  IDocumentManager
 Provide set of user actions needed to manage documents in MVC (Model View Controller) concept. More...
 
class  IDocumentMetaInfo
 Interface for document meta-information. More...
 
class  IDocumentStateComparator
 Allows to store some document state used as reference for comparison. More...
 
class  IDocumentTemplate
 Common interface for a document template. More...
 
class  IDocumentTypesInfo
 Provide information about different document types. More...
 
class  IHelpFileProvider
 Allow to show help document to specified object or text. More...
 
class  IHelpInfoProvider
 Allow to show help document to specified object or text. More...
 
class  IHelpViewer
 Allow to show help document to specified object or text. More...
 
class  IMultiPageDocument
 Simple interface for a structured document. More...
 
class  IMultiPageDocumentProvider
 Common interface for a provider of a multi-page document. More...
 
class  ITextDocument
 Simple interface for a text document. More...
 
class  IUndoManager
 Interface providing UNDO/REDO functionality. More...
 
class  TMultiPageDocumentWrap
 Generic implementation of IMultiPageDocument interface. More...
 

Typedefs

typedef istd::TSharedInterfacePtr< IDocumentMetaInfoMetaInfoPtr
 
typedef istd::TUniqueInterfacePtr< IMultiPageDocumentIMultiPageDocumentPtr
 
typedef istd::TUniqueInterfacePtr< idoc::IUndoManagerIUndoManagerUniquePtr
 
typedef istd::TSharedInterfacePtr< idoc::IUndoManagerIUndoManagerSharedPtr
 
typedef idoc::TMultiPageDocumentWrap< idoc::IMultiPageDocumentCMultiPageDocumentBase
 

Detailed Description

Contains the system independent basic implementations of Document/View design pattern.

The idoc namespace provides the core infrastructure for building document-based applications using the Model-View-Controller (MVC) pattern. It includes interfaces and base implementations for managing documents, views, persistence, undo/redo functionality, and document metadata.

Key Concepts
Documents
Documents represent the application's data model. The framework provides several document types:
  • ITextDocument - Simple text documents
  • IMultiPageDocument - Multi-page structured documents
  • Custom document types can be created by implementing appropriate interfaces
Views
Views display document content to the user. Multiple views can display the same document, and different view types can provide different representations of the same data.
Document Templates
Templates (IDocumentTemplate) act as factories for creating documents and views. They define:
  • Which document types are supported
  • How to create document instances
  • How to create view instances for documents
  • File persistence mechanisms (loading/saving)
  • Undo manager creation
Document Manager
The document manager (IDocumentManager) is the central orchestrator that:
  • Manages the lifecycle of all open documents
  • Creates and manages views for documents
  • Handles file operations (new, open, save, close)
  • Tracks the active view/document
  • Manages undo/redo per document
  • Provides recent files tracking
Architecture Overview
|
|-- Manages documents and views
|-- Uses IDocumentTemplate for creation
|
+-----------+-----------+
| |
IDocumentTemplate Document instances
| |
+--------+--------+ +-- IMultiPageDocument
| | +-- Custom documents
Creates: Creates:
Documents Views Each with optional:
- IFilePersistence
Provide set of user actions needed to manage documents in MVC (Model View Controller) concept.
Interface for document meta-information.
Common interface for a document template.
Simple interface for a structured document.
Simple interface for a text document.
Interface providing UNDO/REDO functionality.
Example: Simple Text Document Application
// 1. Define document template in configuration
DocumentTypeId = "TextDocument"
DocumentTypeName = "Text Document"
DocumentFactory = "TextDocumentFactory"
ViewFactory = "TextViewFactory"
DocumentLoader = "TextFileLoader"
UndoManager = "SerializedUndoManager"
}
// 2. Use document manager to create documents
idoc::IDocumentManager* docMgr = GetDocumentManager();
QByteArray docType = "TextDocument";
// Create new document
docMgr->InsertNewDocument(docType, true);
// Open existing document
QString path = "/path/to/file.txt";
docMgr->OpenDocument(&docType, &path, true);
// Save active document
docMgr->SaveDocument();
// Get active view and document
istd::IChangeable* doc = docMgr->GetDocumentFromView(*view);
// Use undo/redo
if (undoMgr && undoMgr->GetAvailableUndoSteps() > 0) {
undoMgr->DoUndo();
}
Document template component supporting only one type of the provided document.
virtual idoc::IUndoManager * GetUndoManagerForDocument(const istd::IChangeable *documentPtr) const =0
Return undo manager for document documentPtr.
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 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 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 istd::IChangeable * GetDocumentFromView(const istd::IPolymorphic &view, DocumentInfo *documentInfoPtr=NULL) const =0
Return the document assigned to view.
virtual istd::IPolymorphic * GetActiveView() const =0
Return the active document.
virtual bool DoUndo(int steps=1)=0
Process UNDO steps.
virtual int GetAvailableUndoSteps() const =0
Get number of available UNDO levels.
Common interface for data model objects, which can be changed.
Definition IChangeable.h:28
Base interface for all used interfaces and implementations.
See Also
  • iqtdoc namespace for Qt-specific implementations
  • ifile namespace for file persistence
  • iser namespace for serialization

Typedef Documentation

◆ CMultiPageDocumentBase

Definition at line 356 of file TMultiPageDocumentWrap.h.

◆ IMultiPageDocumentPtr

Definition at line 148 of file IMultiPageDocument.h.

◆ IUndoManagerSharedPtr

Definition at line 125 of file IUndoManager.h.

◆ IUndoManagerUniquePtr

Definition at line 124 of file IUndoManager.h.

◆ MetaInfoPtr

Definition at line 219 of file IDocumentMetaInfo.h.