ICF 3.0.5.47
Technical documentation of ICF Libraries
idoc::CSingleDocumentTemplateComp Class Reference

Document template component supported only one type of the provided document. More...

#include <CSingleDocumentTemplateComp.h>

Inheritance diagram for idoc::CSingleDocumentTemplateComp:
Collaboration diagram for idoc::CSingleDocumentTemplateComp:

Public Types

typedef icomp::CComponentBase BaseClass
 
typedef CSingleDocumentTemplateBase BaseClass2
 
- Public Types inherited from idoc::IDocumentTypesInfo
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
 

Public Member Functions

ifile::IFilePersistenceGetFileLoader (const QByteArray &documentTypeId) const override
 Get file loader/saver for spacified document ID.
 
std::unique_ptr< istd::IChangeableCreateDocument (QByteArray &documentTypeId, bool initialize=true, bool beQuiet=false, bool *ignoredFlagPtr=nullptr) const override
 Creates a document instance for document type documentTypeId.
 
std::unique_ptr< istd::IPolymorphic > CreateView (const QByteArray &documentTypeId, istd::IChangeable *documentPtr, const QByteArray &viewTypeId=QByteArray()) const override
 Creates a view instance for document document of type viewTypeId.
 
std::unique_ptr< IUndoManagerCreateUndoManager (const QByteArray &documentTypeId, istd::IChangeable *documentPtr) const override
 Creates an undo manger for a given document documentPtr.
 
- Public Member Functions inherited from icomp::CComponentBase
 CComponentBase ()
 Create component and assign it to specific context.
 
 CComponentBase (const CComponentBase &)=delete
 
CComponentBaseoperator= (const CComponentBase &)=delete
 
virtual const ICompositeComponentGetParentComponent (bool ownerOnly=false) const
 Get parent of this component.
 
virtual void * GetInterface (const istd::CClassInfo &interfaceType, const QByteArray &subId="")
 Get access to specified component interface.
 
virtual const IComponentContextGetComponentContext () const
 Get access to component context describing all application-specified component information loaded from components registry.
 
virtual void SetComponentContext (const IComponentContext *contextPtr, const ICompositeComponent *parentPtr, bool isParentOwner)
 Set component context of this component.
 
- Public Member Functions inherited from icomp::IComponent
- Public Member Functions inherited from idoc::CSingleDocumentTemplateBase
 CSingleDocumentTemplateBase ()
 
const QByteArray & GetDocumentTypeId () const
 
virtual void SetSupportedFeatures (int featureFlags)
 
virtual void SetDocumentTypeId (const QByteArray &id)
 
virtual void SetDocumentTypeName (const QString &name)
 
virtual void SetViewTypeId (const QByteArray &id)
 
virtual void SetViewTypeName (const QString &name)
 
virtual void SetDefaultDirectory (const QString &defaultDirectory)
 
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::IFileTypeInfoGetDocumentFileTypeInfo (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 Ids GetViewTypeIds (const QByteArray &documentTypeId) const
 Return supported view type IDs for specified document type.
 
virtual QString GetViewTypeName (const QByteArray &documentTypeId, const QByteArray &viewTypeId) const
 Get human readable name of some view type ID.
 
- Public Member Functions inherited from idoc::IDocumentTemplate
- Public Member Functions inherited from idoc::IDocumentTypesInfo

Protected Member Functions

virtual istd::IPolymorphic * ExtractViewInterface (icomp::IComponent *componentPtr) const
 Extract pointer of view interface from factorisied view component.
 
void OnComponentCreated () override
 
- Protected Member Functions inherited from icomp::CComponentBase
bool IsComponentActive () const
 Check if component is active.
 
virtual void OnComponentDestroyed ()
 
virtual const IRealComponentStaticInfoGetComponentStaticInfo () const =0
 Get access to static info of this component.
 
- Protected Member Functions inherited from idoc::CSingleDocumentTemplateBase
bool IsDocumentTypeSupported (const QByteArray &documentTypeId) const
 
bool IsViewTypeSupported (const QByteArray &viewTypeId) const
 

Additional Inherited Members

- Static Protected Member Functions inherited from icomp::CComponentBase
static const IRealComponentStaticInfoInitStaticInfo (IComponent *componentPtr)
 
static QByteArray GetComponentId (const IComponentContext *componentContextPtr, const QByteArray &contextId=QByteArray())
 

Detailed Description

Document template component supported only one type of the provided document.

Definition at line 23 of file CSingleDocumentTemplateComp.h.

Member Typedef Documentation

◆ BaseClass

◆ BaseClass2

Member Function Documentation

◆ CreateDocument()

std::unique_ptr< istd::IChangeable > idoc::CSingleDocumentTemplateComp::CreateDocument ( QByteArray & documentTypeId,
bool initialize = true,
bool beQuiet = false,
bool * ignoredFlagPtr = nullptr ) const
overridevirtual

Creates a document instance for document type documentTypeId.

Parameters
documentTypeIdID 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.
initializeIf 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).
ignoredFlagPtroptional output flag indicating that the user canceled this operation.

Implements idoc::IDocumentTemplate.

◆ CreateUndoManager()

std::unique_ptr< IUndoManager > idoc::CSingleDocumentTemplateComp::CreateUndoManager ( const QByteArray & documentTypeId,
istd::IChangeable * documentPtr ) const
overridevirtual

Creates an undo manger for a given document documentPtr.

Parameters
documentTypeIdID of document type.
documentPtrpointer to document object.
Returns
pointer to created instance of undo manager or nullptr, if creating of undo manager was impossible.

Implements idoc::IDocumentTemplate.

◆ CreateView()

std::unique_ptr< istd::IPolymorphic > idoc::CSingleDocumentTemplateComp::CreateView ( const QByteArray & documentTypeId,
istd::IChangeable * documentPtr,
const QByteArray & viewTypeId = QByteArray() ) const
overridevirtual

Creates a view instance for document document of type viewTypeId.

Parameters
documentTypeIdID of document type.
documentPtrpointer to document object.
viewTypeIdoptional ID specifying view type if more view types are supported.

Implements idoc::IDocumentTemplate.

◆ ExtractViewInterface()

virtual istd::IPolymorphic * idoc::CSingleDocumentTemplateComp::ExtractViewInterface ( icomp::IComponent * componentPtr) const
protectedvirtual

Extract pointer of view interface from factorisied view component.

This functionality is provided to allow derrived classes to extract implementation-specific GUI interfaces from created composited instances. Default is instance of interface imod::IObserver extracted, but for composite components it can be inaccurate for some cases.

Reimplemented in idocgui::CExtendedDocumentTemplateComp.

◆ GetFileLoader()

ifile::IFilePersistence * idoc::CSingleDocumentTemplateComp::GetFileLoader ( const QByteArray & documentTypeId) const
overridevirtual

Get file loader/saver for spacified document ID.

Parameters
documentTypeIdtype ID of document will be loaded/saved.

Implements idoc::IDocumentTemplate.

◆ OnComponentCreated()

void idoc::CSingleDocumentTemplateComp::OnComponentCreated ( )
overrideprotectedvirtual

Reimplemented from icomp::CComponentBase.


The documentation for this class was generated from the following file:

© Witold Gantzke and Kirill Lepskiy