A helper class to export KLF output to other applications. More...
#include <klfmime.h>
Public Member Functions | |
KLFMimeExporter () | |
virtual | ~KLFMimeExporter () |
virtual QString | exporterName () const =0 |
virtual QStringList | keys () const =0 |
virtual QByteArray | data (const QString &key, const KLFBackend::klfOutput &klfoutput)=0 |
virtual QString | windowsFormatName (const QString &key) const |
virtual bool | supportsKey (const QString &key) const |
Shortcut function (do not reimplement in subclasses) More... | |
Static Public Member Functions | |
static KLFMimeExporter * | mimeExporterLookup (const QString &key) |
static KLFMimeExporter * | mimeExporterLookupByName (const QString &exporter, const QString &key=QString()) |
static QList< KLFMimeExporter * > | mimeExporterList () |
static void | registerMimeExporter (KLFMimeExporter *exporter, bool overrides=true) |
static void | unregisterMimeExporter (KLFMimeExporter *exporter) |
A helper class to export KLF output to other applications.
This helper class can be subclassed to implement exporting klatexformula output in a given data format.
Under Windows, mime types are translated to a windows format name returned by windowsFormatName()
. Under Mac OS X, mime types are translated using KLFMacPasteboardMime, a QMacPasteboardMime subclass.
"application/x-qt-image"
has a special meaning. This key may be returned by keys() to indicate that a generic image data is to be exported in the native Qt-supported formats. When the data for that mime-type is requested, the image data should be returned in raw PNG, JPEG or BMP as a QByteArray, and then when this data is added to a QMimeData, QMimeData::setImageData() with the returned data will be used.
|
inlinevirtual |
|
pure virtual |
Implemented in KLFMimeExporterGlowImage, KLFMimeExporterLibFmts, KLFMimeExporterHTML, KLFMimeExporterUrilist, and KLFMimeExporterImage.
Referenced by KLFMimeData::retrieveData(), and KLFMainWin::slotCopy().
|
pure virtual |
Implemented in KLFMimeExporterGlowImage, KLFMimeExporterLibFmts, KLFMimeExporterHTML, KLFMimeExporterUrilist, and KLFMimeExporterImage.
Referenced by mimeExporterLookup(), mimeExporterLookupByName(), and registerMimeExporter().
|
pure virtual |
Implemented in KLFMimeExporterGlowImage, KLFMimeExporterLibFmts, KLFMimeExporterHTML, KLFMimeExporterUrilist, and KLFMimeExporterImage.
Referenced by supportsKey().
|
static |
Definition at line 100 of file klfmime.cpp.
References KLF_DEBUG_BLOCK, and KLF_FUNC_NAME.
|
static |
Looks up an exporter supporting type key
. The first exporter in the list is returned. If no exporter is found, NULL is returned.
Definition at line 66 of file klfmime.cpp.
References exporterName(), KLF_DEBUG_BLOCK, KLF_FUNC_NAME, klfDbg, QList::size(), and supportsKey().
Referenced by KLFMimeExportProfile::exporterLookupFor(), and KLFMainWin::slotCopy().
|
static |
Looks up exporter exporter
and returns the exporter, or NULL if it was not found.
If key
is non-empty, a check to ensure that the exporter supports the given key
is performed with supportsKey(). If the exporter does not support the given key
, NULL is returned instead.
Definition at line 83 of file klfmime.cpp.
References exporterName(), QString::isEmpty(), KLF_DEBUG_BLOCK, KLF_FUNC_NAME, and QList::size().
Referenced by KLFMimeExportProfile::exporterLookupFor().
|
static |
Adds the instance exporter
to the internal list of exporters.
If overrides
is TRUE, then prepends the exporter to the list (will be looked up first), otherwise appends it to list.
Definition at line 108 of file klfmime.cpp.
References exporterName(), KLF_ASSERT_CONDITION, KLF_ASSERT_NOT_NULL, KLF_DEBUG_BLOCK, KLF_FUNC_NAME, klfDbg, QList::push_back(), QList::push_front(), and QList::size().
|
virtual |
Shortcut function (do not reimplement in subclasses)
Definition at line 58 of file klfmime.cpp.
References QStringList::indexOf(), keys(), and klfDbg.
Referenced by mimeExporterLookup().
|
static |
Definition at line 139 of file klfmime.cpp.
References KLF_DEBUG_BLOCK, KLF_FUNC_NAME, and QList::removeAll().
Reimplemented in KLFMimeExporterHTML, KLFMimeExporterUrilist, and KLFMimeExporterImage.
Definition at line 71 of file klfmime.h.
Referenced by KLFMimeExportProfile::respectiveWinType().