[KLF Application][KLF Tools][KLF Backend][KLF Home]
KLatexFormula Project
Public Member Functions | Static Public Member Functions

KLFMimeExporter Class Reference

A helper class to export KLF output to other applications. More...

#include <klfmime.h>

Inheritance diagram for KLFMimeExporter:
Inheritance graph
[legend]
Collaboration diagram for KLFMimeExporter:
Collaboration graph
[legend]

List of all members.

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)

Static Public Member Functions

static KLFMimeExportermimeExporterLookup (const QString &key)
static KLFMimeExportermimeExporterLookupByName (const QString &exporter, const QString &key=QString())
static QList< KLFMimeExporter * > mimeExporterList ()
static void registerMimeExporter (KLFMimeExporter *exporter, bool overrides=true)
static void unregisterMimeExporter (KLFMimeExporter *exporter)

Detailed Description

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.

Note:
The mime-type "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.

Definition at line 55 of file klfmime.h.


Constructor & Destructor Documentation

KLFMimeExporter::KLFMimeExporter ( ) [inline]

Definition at line 58 of file klfmime.h.

virtual KLFMimeExporter::~KLFMimeExporter ( ) [inline, virtual]

Definition at line 59 of file klfmime.h.


Member Function Documentation

virtual QByteArray KLFMimeExporter::data ( const QString key,
const KLFBackend::klfOutput klfoutput 
) [pure virtual]
virtual QString KLFMimeExporter::exporterName ( ) const [pure virtual]
virtual QStringList KLFMimeExporter::keys ( ) const [pure virtual]
QList< KLFMimeExporter * > KLFMimeExporter::mimeExporterList ( ) [static]

Definition at line 100 of file klfmime.cpp.

References KLF_DEBUG_BLOCK, and KLF_FUNC_NAME.

KLFMimeExporter * KLFMimeExporter::mimeExporterLookup ( const QString key) [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().

KLFMimeExporter * KLFMimeExporter::mimeExporterLookupByName ( const QString exporter,
const QString key = QString() 
) [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().

void KLFMimeExporter::registerMimeExporter ( KLFMimeExporter exporter,
bool  overrides = true 
) [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().

bool KLFMimeExporter::supportsKey ( const QString key) const [virtual]

Shortcut function (do not reimplement in subclasses)

Returns:
true if key is in keys() list.

Definition at line 58 of file klfmime.cpp.

References QStringList::indexOf(), keys(), and klfDbg.

Referenced by mimeExporterLookup().

void KLFMimeExporter::unregisterMimeExporter ( KLFMimeExporter exporter) [static]

Definition at line 139 of file klfmime.cpp.

References KLF_DEBUG_BLOCK, KLF_FUNC_NAME, and QList::removeAll().

virtual QString KLFMimeExporter::windowsFormatName ( const QString key) const [inline, virtual]

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

Generated by doxygen 1.7.3