QCAD Application Framework
CAD Application Development and Automation.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RFileImporterRegistry Class Reference

Registry of all available file importers (RFileImporter). More...

#include <RFileImporterRegistry.h>

List of all members.

Public Types

typedef bool(* CheckFunction )(const QString &, const QString &)
typedef RFileImporter *(* FactoryFunction )(RDocument &document, RMessageHandler *messageHandler, RProgressHandler *progressHandler)

Static Public Member Functions

static RFileImportergetFileImporter (const QString &fileName, const QString &nameFilter, RDocument &document, RMessageHandler *messageHandler=NULL, RProgressHandler *progressHandler=NULL)
static QStringList getFilterStrings ()
static void registerFileImporter (RFileImporterRegistry::FactoryFunction factoryFunction, RFileImporterRegistry::CheckFunction checkFunction, const QStringList &filters)
 Registers a file importer.
static void registerFileImporterScript (const QString &scriptFile, const QStringList &filters)

Static Private Attributes

static QList< CheckFunctioncheckFunctions
static QList< FactoryFunctionfactoryFunctions
static QStringList filterStrings
static QList< QString > scriptImporters

Detailed Description

Registry of all available file importers (RFileImporter).

File importers must register themselves in this registry to become available to the user of the application.

Scriptable:
This class is wrapped for script environments.

Member Typedef Documentation

typedef bool(* RFileImporterRegistry::CheckFunction)(const QString &, const QString &)
typedef RFileImporter*(* RFileImporterRegistry::FactoryFunction)(RDocument &document, RMessageHandler *messageHandler, RProgressHandler *progressHandler)

Member Function Documentation

RFileImporter * RFileImporterRegistry::getFileImporter ( const QString &  fileName,
const QString &  nameFilter,
RDocument document,
RMessageHandler messageHandler = NULL,
RProgressHandler progressHandler = NULL 
)
static
Returns:
A new instance of the first file importer found that can handle the given file or NULL if no suitable importer can be found.
static QStringList RFileImporterRegistry::getFilterStrings ( )
inlinestatic
Returns:
List of all available filter strings, e.g. for a file open dialog.
void RFileImporterRegistry::registerFileImporter ( RFileImporterRegistry::FactoryFunction  factoryFunction,
RFileImporterRegistry::CheckFunction  checkFunction,
const QStringList &  filters 
)
static

Registers a file importer.

   \par Non-Scriptable:

This function is not available in script environments.

Parameters:
factoryFunctionThe function that can be used to instantiate the importer.
checkFunctionThe function tht can be used to check whether the importer can import a given file.
void RFileImporterRegistry::registerFileImporterScript ( const QString &  scriptFile,
const QStringList &  filters 
)
static

Member Data Documentation

QList< RFileImporterRegistry::CheckFunction > RFileImporterRegistry::checkFunctions
staticprivate
QList< RFileImporterRegistry::FactoryFunction > RFileImporterRegistry::factoryFunctions
staticprivate
QStringList RFileImporterRegistry::filterStrings
staticprivate
QList< QString > RFileImporterRegistry::scriptImporters
staticprivate

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