FileInterface Class Reference

Interface class for file and object handling. More...

#include <FileInterface.hh>

List of all members.

Public Slots

Load Save Implementation



virtual int addEmpty ()=0
 Create an empty object.
virtual int loadObject (QString)=0
 Load an object from the given file.
virtual bool saveObject (int, QString)=0
 Save an object from the given file.

Public Member Functions

Widgets



virtual ~FileInterface ()
 Destructor.
virtual QWidget * saveOptionsWidget (QString)=0
virtual QWidget * loadOptionsWidget (QString)=0
Supported types



virtual QString typeName ()=0
virtual DataType supportedType ()=0
virtual QString getLoadFilters ()=0
virtual QString getSaveFilters ()=0

Detailed Description

Interface class for file and object handling.

This interface class has to be fully implemented. When you want to support save and load for an object type you have to implement all functions in this class. The core manages the load and save interaction and gives the load and save actions to your plugin. The decision which plugin is called for saving an object depends on your supportedTypes() and the filters defined by your plugin.

Definition at line 70 of file FileInterface.hh.


Member Function Documentation

virtual int FileInterface::addEmpty (  )  [pure virtual, slot]

Create an empty object.

When this slot is called you have to create an object of your supported type.

Returns:
Id of the new Object
virtual QString FileInterface::getLoadFilters (  )  [pure virtual]

Return the Qt Filters for Filedialogs when loading files (e.g. "Off files ( *.off )" )

Referenced by Core::loadPlugin().

virtual QString FileInterface::getSaveFilters (  )  [pure virtual]

Get the Qt Filters for Filedialogs when saving files (e.g. "Off files ( *.off )" )

Referenced by Core::loadPlugin().

virtual int FileInterface::loadObject ( QString   )  [pure virtual, slot]

Load an object from the given file.

The Core will call this slot if you should load a file. The core will check if you support the given file type depending on the provided filters and dataTypes ( see supportedType and getLoadFilters )

virtual QWidget* FileInterface::loadOptionsWidget ( QString   )  [pure virtual]

You can provide a special widget showing options for loading your file types depending on the current filter

_currentFilter: one filter from loadFilters

Return 0 when you dont need one

virtual bool FileInterface::saveObject ( int  ,
QString   
) [pure virtual, slot]

Save an object from the given file.

The Core will call this slot if you should save an object to a file. The core will check if you support the given object depending on the provided dataTypes ( see supportedType ). Additionally to the filename you get the id of the object to save

virtual QWidget* FileInterface::saveOptionsWidget ( QString   )  [pure virtual]

You can provide a special widget showing options for saving your file types depending on the current filter

_currentFilter: one filter from saveFilters

Return 0 when you dont need one

virtual DataType FileInterface::supportedType (  )  [pure virtual]

Return your supported object type( e.g. DATA_TRIANGLE_MESH )

TODO : Support for adding new datatypes at runtime

Referenced by Core::loadPlugin().

virtual QString FileInterface::typeName (  )  [pure virtual]

Return the name of your supported type (e.g. "Triangle Mesh"


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

acg pic Project OpenFlipper, ©  Computer Graphics Group, RWTH Aachen. Documentation generated using doxygen .