importFilter Class Reference

[libkorigin Index] [libkorigin Heirarchy]


ImportFilter BaseClass More...

#include </home/mh/korigin/korigin/doc/tmp/import.h>

Public Members

Protected Members


Detailed Description

This class defines the interface of all import filters. The importfilter must return its name, its optionsslot, and the table opened from the disk.

There are also members to store and get the latest used directory as well as the default directory.

Very cool structure: only this file has to be included by the main program. All filters have to be compiled to an object file and this object file has then to be linked to the main executable. They dont need to be included at any positon!!! So leave their includefiles where they are. Dont copy them to the korigin include directory.

Write new import filters by inheriting the class importfilter and defining all virtual declared functions. Watch importASCII for an example.


Worksheet* importFromFile()

This is the main ImportFilter procedure. It is called by centre and worksheet.

static QPopupMenu* getImportFilterPopup()

return the popupmenu build from all found import filters.

static QPopupMenu* getImportOptionsPopup()

returns a options popup built from all found import filters. Already connected to the appropriate slots.

importFilter()

of course each class has to have one

virtual ~importFilter()

the same like for the constructor

virtual QString getDescription()

get Description of the filter. This is the text being displayed everywhere where the filter will be called in the main program, for example in the Popup and FileDialog.

virtual void getOptionsSlot()

a routine which should build a tabdialog and fill it with life. That means asking for the FileFilter, or specific import file format.

virtual const char* getFileFilter()

all import filters only display files the a specific file extension in the File dialogs. You have to return something like "*.html".

virtual Table* readTable(const char* filename)

This is the main function of import Filter. It will be called from the main program and reads a specific file from disk.

virtual QString getLatestDirectory()

return the latest used directory (the directory used on the last import command). This should be the default directory the first time this function is called in a session.

See Also:
setLatestDirectory

virtual void setLatestDirectory(const char* dir)

set the latest used directory.

virtual QString getDefaultDirectory()

return default directory. Needed by the options dialog which builds a dialog for setting the default directory. The default directory is the first directory used when importing a specific file in a session. All filters should have their own directory.

See Also:
setDefaultDirectory

virtual void setDefaultDirectory(const char* dir)

set the default directory.

See Also:
setLatestDirectory

  • Author: Martin Häfner (mh@ap-dec717c.physik.uni-karlsruhe.de)
  • Version: 0.1
  • Documentation generated by mh@jeff_clever on Thu Feb 5 14:15:25 MET 1998
Kdoc