#include <klfmainwin.h>
Public Member Functions | |
KLFAbstractDataOpener (KLFMainWin *mainwin) | |
virtual | ~KLFAbstractDataOpener () |
virtual QStringList | supportedMimeTypes ()=0 |
virtual bool | canOpenFile (const QString &file)=0 |
virtual bool | canOpenData (const QByteArray &data)=0 |
virtual bool | openFile (const QString &file)=0 |
virtual bool | openData (const QByteArray &data, const QString &mimetype)=0 |
Protected Member Functions | |
KLFMainWin * | mainWin () |
A helper interface class to open old PNG files, library files or abstract data, to fill in the main window controls (latex and style), or possibly open a resource into library.
Instances of subclasses will be invoked when:
Definition at line 123 of file klfmainwin.h.
|
inline |
Definition at line 126 of file klfmainwin.h.
|
inlinevirtual |
Definition at line 127 of file klfmainwin.h.
|
pure virtual |
Is supposed to peek into data
to try to recognize if its format is one which we can open. No indication is given as to which format data
is in. If the data
is recognized as a format this opener can open, return TRUE, otherwise, return FALSE.
Implemented in KLFAddOnDataOpener, and KLFBasicDataOpener.
|
pure virtual |
Is supposed to peek into file
to try to recognize if its format is one which we can open. The implementation of this function may also rely on the file name's extension.
If the file is recognized as one this opener can open, then return TRUE, otherwise return FALSE.
Implemented in KLFAddOnDataOpener, and KLFBasicDataOpener.
|
inlineprotected |
Get a pointer to the main window passed to the constructor.
Definition at line 170 of file klfmainwin.h.
Referenced by KLFBasicDataOpener::openData(), KLFBasicDataOpener::openFile(), and KLFAddOnDataOpener::openFile().
|
pure virtual |
Actually open the data. You may use the mainWin() to perform something useful.
mimetype
is the mime-type of the data.
Note: the mimetype
can be empty, in which case the opener should make no assumption whatsoever as to the data's format, and try to parse data, and return FALSE if it is not capable of loading the given data. In particular, it should not be assumed that canOpenData() has already been called and returned true on this data.
This function should return FALSE if it is not capable of loading the given data
.
Implemented in KLFAddOnDataOpener, and KLFBasicDataOpener.
|
pure virtual |
Actually open the file. You may use the mainWin() to perform something useful.
Note: this function will be called for every file the main window tries to open. Do NOT assume that the file given here is a file that passed the canOpenFile() function test. (Reason: calling both canOpenFile() and openFile() may result into resources being loaded twice, which is not optimal).
This function should return FALSE if it is not capable of loading the given file
.
Implemented in KLFAddOnDataOpener, and KLFBasicDataOpener.
|
pure virtual |
Returns a list of mime-types we can handle
Implemented in KLFAddOnDataOpener, and KLFBasicDataOpener.