ACF $AcfVersion:0$
Public Types | Public Member Functions | List of all members
idoc::IDocumentTypesInfo Class Referenceabstract

Provide information about different document types. More...

#include <IDocumentTypesInfo.h>

Inheritance diagram for idoc::IDocumentTypesInfo:
istd::IPolymorphic idoc::IDocumentManager idoc::IDocumentTemplate idoc::CTmplBasedDocumentManagerBase idoc::CCompositeDocumentTemplateComp idoc::CSingleDocumentTemplateBase idoc::CMultiDocumentManagerBase idoc::CSingleDocumentManagerBase idoc::CSingleDocumentTemplateComp iqtdoc::TQtDocumentManagerWrap< idoc::CMultiDocumentManagerBase, iqtgui::TRestorableGuiWrap< iqtgui::TGuiComponentBase< QMdiArea > > > iqtdoc::TQtDocumentManagerWrap< idoc::CSingleDocumentManagerBase, iqtgui::TRestorableGuiWrap< iqtgui::TGuiComponentBase< QWidget > > > iqtdoc::CExtendedDocumentTemplateComp iqtdoc::CMultiDocumentWorkspaceGuiComp iqtdoc::CSingleDocumentWorkspaceGuiComp

Public Types

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 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::IFileTypeInfoGetDocumentFileTypeInfo (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 ()
 

Detailed Description

Provide information about different document types.

This interface provides metadata about document types supported by a template or manager. It includes information about document type IDs, names, supported features, file types, and default directories.

Document types define what kinds of documents can be created or opened by the application. Each type has a unique ID and associated metadata that describes its capabilities.

Usage Example
idoc::IDocumentTypesInfo* typesInfo = GetDocumentTypesInfo();
// Get all supported document types
for (const QByteArray& typeId : typeIds) {
QString name = typesInfo->GetDocumentTypeName(typeId);
qDebug() << "Type:" << name << "ID:" << typeId;
// Check supported features
bool canCreate = typesInfo->IsFeatureSupported(
bool canEdit = typesInfo->IsFeatureSupported(
qDebug() << " Can create:" << canCreate << "Can edit:" << canEdit;
// Get file type info
ifile::IFileTypeInfo* fileInfo = typesInfo->GetDocumentFileTypeInfo(typeId);
if (fileInfo) {
QString filter = fileInfo->GetFileDialogFilter();
qDebug() << " File filter:" << filter;
}
}
// Get document types for a specific file
QString filePath = "/path/to/document.txt";
typesInfo->GetDocumentTypeIdsForFile(filePath);
for (const QByteArray& typeId : compatibleTypes) {
qDebug() << "File compatible with:" << typesInfo->GetDocumentTypeName(typeId);
}
// Get default directory for a document type
QString defaultDir = typesInfo->GetDefaultDirectory("", &typeIds[0]);
Provide information about different document types.
virtual QString GetDefaultDirectory(const QString &sugestedDir="", const QByteArray *documentTypeIdPtr=NULL) const =0
Return default directory for specified document type.
virtual ifile::IFileTypeInfo * GetDocumentFileTypeInfo(const QByteArray &documentTypeId) const =0
Get file type information object for some selected document type.
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 bool IsFeatureSupported(int featureFlags, const QByteArray &documentTypeId) const =0
Return true, if the feature(s) is supported by this document template.
QVector< QByteArray > Ids
Type definition for document type ID collections.
@ SF_EDIT_DOCUMENT
A document is editable (content can be modified).
@ SF_NEW_DOCUMENT
A new document can be created (File > New).
virtual Ids GetDocumentTypeIdsForFile(const QString &filePath) const =0
Get list of supported document IDs that can handle the specified file.
Provide loading and saving of objects.
See also
IDocumentTemplate, IDocumentManager

Definition at line 68 of file IDocumentTypesInfo.h.

Member Typedef Documentation

◆ Ids

typedef QVector<QByteArray> idoc::IDocumentTypesInfo::Ids

Type definition for document type ID collections.

Definition at line 74 of file IDocumentTypesInfo.h.

Member Enumeration Documentation

◆ SupportedFeatures

Enumeration for supported types of operations with documents.

Enumerator
SF_NEW_DOCUMENT 

A new document can be created (File > New).

SF_EDIT_DOCUMENT 

A document is editable (content can be modified).

SF_DEFAULT 

All features are supported.

Definition at line 79 of file IDocumentTypesInfo.h.

Member Function Documentation

◆ GetDefaultDirectory()

virtual QString idoc::IDocumentTypesInfo::GetDefaultDirectory ( const QString &  sugestedDir = "",
const QByteArray *  documentTypeIdPtr = NULL 
) const
pure virtual

Return default directory for specified document type.

Parameters
suggestedDirTemplate directory suggested by user or application.
documentTypeIdPtrOptional pointer to ID of document type.
Returns
Resolved default directory path to use for file dialogs.

If suggestedDir is provided and valid, it may be used. Otherwise, the type-specific default directory is returned.

Implemented in idoc::CCompositeDocumentTemplateComp, idoc::CSingleDocumentTemplateBase, and idoc::CTmplBasedDocumentManagerBase.

◆ GetDocumentFileTypeInfo()

virtual ifile::IFileTypeInfo * idoc::IDocumentTypesInfo::GetDocumentFileTypeInfo ( const QByteArray &  documentTypeId) const
pure virtual

Get file type information object for some selected document type.

Parameters
documentTypeIdID of document type as returned by GetDocumentTypeIds().
Returns
Pointer to file type info providing file extensions, filters, etc., or NULL if not available.

Implemented in idoc::CCompositeDocumentTemplateComp, idoc::CSingleDocumentTemplateBase, and idoc::CTmplBasedDocumentManagerBase.

◆ GetDocumentTypeIds()

virtual Ids idoc::IDocumentTypesInfo::GetDocumentTypeIds ( ) const
pure virtual

Get list of supported document type IDs.

Returns
Vector of document type IDs supported by this template/manager.

Implemented in idoc::CCompositeDocumentTemplateComp, idoc::CSingleDocumentTemplateBase, and idoc::CTmplBasedDocumentManagerBase.

◆ GetDocumentTypeIdsForFile()

virtual Ids idoc::IDocumentTypesInfo::GetDocumentTypeIdsForFile ( const QString &  filePath) const
pure virtual

Get list of supported document IDs that can handle the specified file.

Parameters
filePathFull path to file to check.
Returns
Vector of document type IDs that can open/handle this file.

This method determines which document types are compatible with a given file based on file extension, content analysis, or other criteria.

Implemented in idoc::CCompositeDocumentTemplateComp, idoc::CSingleDocumentTemplateBase, idoc::CTmplBasedDocumentManagerBase, and iqtdoc::CExtendedDocumentTemplateComp.

◆ GetDocumentTypeName()

virtual QString idoc::IDocumentTypesInfo::GetDocumentTypeName ( const QByteArray &  documentTypeId) const
pure virtual

Get human readable name of some document type ID.

Parameters
documentTypeIdID of document type as returned by GetDocumentTypeIds().
Returns
Localized, user-friendly name of the document type (e.g., "Text Document", "Image File").

Implemented in idoc::CCompositeDocumentTemplateComp, idoc::CSingleDocumentTemplateBase, and idoc::CTmplBasedDocumentManagerBase.

◆ IsFeatureSupported()

virtual bool idoc::IDocumentTypesInfo::IsFeatureSupported ( int  featureFlags,
const QByteArray &  documentTypeId 
) const
pure virtual

Return true, if the feature(s) is supported by this document template.

Parameters
featureFlagsBitwise OR of SupportedFeatures flags to check.
documentTypeIdID of document type to check.
Returns
True if all specified features are supported for this document type.

Implemented in idoc::CCompositeDocumentTemplateComp, idoc::CSingleDocumentTemplateBase, and idoc::CTmplBasedDocumentManagerBase.


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