|
ACF $AcfVersion:0$
|
Common interface for a document template. More...
#include <IDocumentTemplate.h>
Public Types | |
| typedef istd::TUniqueInterfacePtr< istd::IPolymorphic > | ViewUniquePtr |
| Type definitions for view smart pointers. | |
| typedef istd::TSharedInterfacePtr< istd::IPolymorphic > | ViewSharedPtr |
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. | |
Public Member Functions | |
| virtual Ids | GetViewTypeIds (const QByteArray &documentTypeId) const =0 |
| Return supported view type IDs for specified document type. | |
| virtual QString | GetViewTypeName (const QByteArray &documentTypeId, const QByteArray &viewTypeId) const =0 |
| Get human readable name of some view type ID. | |
| virtual ifile::IFilePersistence * | GetFileLoader (const QByteArray &documentTypeId) const =0 |
| Get file loader/saver for specified document ID. | |
| virtual istd::IChangeableUniquePtr | CreateDocument (QByteArray &documentTypeId, bool initialize=true, bool beQuiet=false, bool *ignoredFlagPtr=NULL) const =0 |
Creates a document instance for document type documentTypeId. | |
| virtual ViewUniquePtr | CreateView (const QByteArray &documentTypeId, istd::IChangeable *documentPtr, const QByteArray &viewTypeId=QByteArray()) const =0 |
Creates a view instance for document document of type viewTypeId. | |
| virtual idoc::IUndoManagerUniquePtr | CreateUndoManager (const QByteArray &documentTypeId, istd::IChangeable *documentPtr) const =0 |
Creates an undo manager for a given document documentPtr. | |
Public Member Functions inherited from idoc::IDocumentTypesInfo | |
| virtual bool | IsFeatureSupported (int featureFlags, const QByteArray &documentTypeId) const =0 |
Return true, if the feature(s) is supported by this document template. | |
| virtual Ids | GetDocumentTypeIds () const =0 |
| Get list of supported document type IDs. | |
| virtual QString | GetDocumentTypeName (const QByteArray &documentTypeId) const =0 |
| Get human readable name of some document type ID. | |
| virtual ifile::IFileTypeInfo * | GetDocumentFileTypeInfo (const QByteArray &documentTypeId) const =0 |
| Get file type information object for some selected document type. | |
| virtual Ids | GetDocumentTypeIdsForFile (const QString &filePath) const =0 |
| Get list of supported document IDs that can handle the specified file. | |
| virtual QString | GetDefaultDirectory (const QString &sugestedDir="", const QByteArray *documentTypeIdPtr=NULL) const =0 |
| Return default directory for specified document type. | |
Public Member Functions inherited from istd::IPolymorphic | |
| virtual | ~IPolymorphic () |
Common interface for a document template.
Document template provides all necessary functionality for creating and controlling the data model of a document, its persistence, and its representation (view). A template acts as a factory for documents and views, and defines the relationship between document types, their file formats, and their visual representations.
The template is responsible for:
Templates can be single-type (supporting one document type) or composite (supporting multiple document types).
Definition at line 69 of file IDocumentTemplate.h.
Definition at line 76 of file IDocumentTemplate.h.
Type definitions for view smart pointers.
Definition at line 75 of file IDocumentTemplate.h.
|
pure virtual |
Creates a document instance for document type documentTypeId.
| documentTypeId | ID of document type, can be empty for default document. If document type is undefined (empty), this field will be used to return ID of used type. |
| initialize | If true, document should be filled with initial data (operation new), otherwise initialization is not needed (e.g., for document loading - filling of data will be done by loader). |
| beQuiet | If true, no user interaction dialogs will be shown. |
| ignoredFlagPtr | Optional output flag indicating that the user canceled this operation. |
Implemented in idoc::CCompositeDocumentTemplateComp, and idoc::CSingleDocumentTemplateComp.
|
pure virtual |
Creates an undo manager for a given document documentPtr.
| documentTypeId | ID of document type. |
| documentPtr | Pointer to document object that will use this undo manager. |
The undo manager tracks changes to the document and allows them to be undone/redone. Not all document types support undo functionality.
Implemented in idoc::CCompositeDocumentTemplateComp, and idoc::CSingleDocumentTemplateComp.
|
pure virtual |
Creates a view instance for document document of type viewTypeId.
| documentTypeId | ID of document type. |
| documentPtr | Pointer to document object that this view will display. |
| viewTypeId | Optional ID specifying view type if more view types are supported. If empty or not provided, the first/default view type for this document type is used. Use GetViewTypeIds() to discover available view types for a document type. |
The view is responsible for displaying the document's content to the user. Some document types support multiple view types (e.g., text view, hex view, preview).
Implemented in idoc::CCompositeDocumentTemplateComp, and idoc::CSingleDocumentTemplateComp.
|
pure virtual |
Get file loader/saver for specified document ID.
| documentTypeId | Type ID of document that will be loaded/saved. |
The file persistence object handles reading and writing documents to/from files.
Implemented in idoc::CCompositeDocumentTemplateComp, and idoc::CSingleDocumentTemplateComp.
|
pure virtual |
Return supported view type IDs for specified document type.
| documentTypeId | ID of document type. |
A single document type may support multiple view types (e.g., text view, hex view, preview).
Implemented in idoc::CCompositeDocumentTemplateComp, and idoc::CSingleDocumentTemplateBase.
|
pure virtual |
Get human readable name of some view type ID.
| documentTypeId | ID of document type. |
| viewTypeId | ID of view type. |
Implemented in idoc::CCompositeDocumentTemplateComp, and idoc::CSingleDocumentTemplateBase.