Go to the documentation of this file.
1 #ifndef idoc_CCompositeDocumentTemplateComp_included
2 #define idoc_CCompositeDocumentTemplateComp_included
5 // ACF includes
6 #include <icomp/CComponentBase.h>
10 namespace idoc
11 {
18  public icomp::CComponentBase,
19  virtual public IDocumentTemplate
20 {
21 public:
24  I_BEGIN_COMPONENT(CCompositeDocumentTemplateComp);
25  I_REGISTER_INTERFACE(idoc::IDocumentTemplate);
26  I_ASSIGN_MULTI_0(m_slaveTemplatesCompPtr, "SlaveTemplates", "Set of document templates", true);
29  // reimplemented (idoc::IDocumentTypesInfo)
30  virtual bool IsFeatureSupported(int featureFlags, const QByteArray& documentTypeId) const;
31  virtual Ids GetDocumentTypeIds() const;
32  virtual QString GetDocumentTypeName(const QByteArray& documentTypeId) const;
33  virtual ifile::IFileTypeInfo* GetDocumentFileTypeInfo(const QByteArray& documentTypeId) const;
34  virtual Ids GetDocumentTypeIdsForFile(const QString& filePath) const;
35  virtual QString GetDefaultDirectory(const QString& sugestedDir = "", const QByteArray* documentTypeIdPtr = NULL) const;
37  // reimplemented (idoc::IDocumentTemplate)
38  virtual Ids GetViewTypeIds(const QByteArray& documentTypeId) const;
39  virtual QString GetViewTypeName(
40  const QByteArray& documentTypeId,
41  const QByteArray& viewTypeId) const;
42  virtual ifile::IFilePersistence* GetFileLoader(const QByteArray& documentTypeId) const;
44  QByteArray& documentTypeId,
45  bool initialize = true,
46  bool beQuiet = false,
47  bool* ignoredFlagPtr = NULL) const;
49  const QByteArray& documentTypeId,
50  istd::IChangeable* documentPtr,
51  const QByteArray& viewTypeId = QByteArray()) const;
52  virtual idoc::IUndoManager* CreateUndoManager(const QByteArray& documentTypeId, istd::IChangeable* documentPtr) const;
54 protected:
55  // reimplemented (icomp::CComponentBase)
56  virtual void OnComponentCreated();
57  virtual void OnComponentDestroyed();
59 private:
60  I_MULTIREF(idoc::IDocumentTemplate, m_slaveTemplatesCompPtr);
62  typedef QMap<QByteArray, const idoc::IDocumentTemplate*> IdToTemplateMap;
63  IdToTemplateMap m_idToTemplateMap;
64 };
67 } // namespace idoc
70 #endif // !idoc_CCompositeDocumentTemplateComp_included
virtual istd::IChangeable * CreateDocument(QByteArray &documentTypeId, bool initialize=true, bool beQuiet=false, bool *ignoredFlagPtr=NULL) const
Creates a document instance for document type documentTypeId.
Provide loading and saving of objects.
Definition: IFileTypeInfo.h:22
Complex document template consists of more simple templates.
virtual QString GetDocumentTypeName(const QByteArray &documentTypeId) const
Get human readable name of some document type ID.
Base class for component implementation.
virtual QString GetDefaultDirectory(const QString &sugestedDir="", const QByteArray *documentTypeIdPtr=NULL) const
Return default directory for specified document type.
Common interface for data model objects, which can be changed.
Definition: IChangeable.h:24
Base interface for all used interfaces and implementations.
Definition: IPolymorphic.h:17
Common interface for a document template.
#define NULL
Definition: istd.h:64
virtual bool IsFeatureSupported(int featureFlags, const QByteArray &documentTypeId) const
Return true, if the feature(s) is supported by this document template.
virtual Ids GetDocumentTypeIdsForFile(const QString &filePath) const
Get list of supported document ID's can be created for specified file.
virtual Ids GetDocumentTypeIds() const
Get list of supported document ID's can be created for specified file.
virtual Ids GetViewTypeIds(const QByteArray &documentTypeId) const
Return supported view type IDs for specified document type.
virtual ifile::IFileTypeInfo * GetDocumentFileTypeInfo(const QByteArray &documentTypeId) const
Get file type information object for some selected document type.
virtual ifile::IFilePersistence * GetFileLoader(const QByteArray &documentTypeId) const
Get file loader/saver for spacified document ID.
Interface providing loading and saving of data objects.
virtual istd::IPolymorphic * CreateView(const QByteArray &documentTypeId, istd::IChangeable *documentPtr, const QByteArray &viewTypeId=QByteArray()) const
Creates a view instance for document document of type viewTypeId.
QVector< QByteArray > Ids
virtual idoc::IUndoManager * CreateUndoManager(const QByteArray &documentTypeId, istd::IChangeable *documentPtr) const
Creates an undo manger for a given document documentPtr.
Interface providing UNDO/REDO functionality.
Definition: IUndoManager.h:16
virtual QString GetViewTypeName(const QByteArray &documentTypeId, const QByteArray &viewTypeId) const
Get human readable name of some view type ID.

© 2007-2017 Witold Gantzke and Kirill Lepskiy