[KLF Application][KLF Tools][KLF Backend][KLF Home]
KLatexFormula Project

Appendix: KLF's Own Mime Formats for Library Entries

The application/x-klf-libentries data format

Is basically a Qt-QDataStream saved data of a KLFLibEntryList (ie. a QList<KLFLibEntry>), with some meta data.

The meta data is given in a QVariantMap, see below. The data is stored as a KLFLibEntryList. The application/x-klf-libentries data is exactly what QDataStream will produce when sent in, in this order, a QString("KLF_LIBENTRIES"), the properties meta data, and the library entries. The QDataStream must have its version set to "QDataStream::Qt_4_4" .

Fundamental example code:

  KLFLibEntryList entries = ...;
  QVariantMap metaData = ...;
  QByteArray data;
  QDataStream stream(&data, QIODevice::WriteOnly);
  stream.setVersion(QDataStream::Qt_4_4);
  stream << QString("KLF_LIBENTRIES") << metaData << entries;
  // now data contains the exact data for the application/x-klf-libentries mimetype.

The property map is meant for including arbitrary parameters to the list (eg. originating URL, etc.). These are stored in a QVariantMap, ie a QMap<QString,QVariant>. Standard known properties are, as of now:

The INTERNAL application/x-klf-internal-lib-move-entries

This format is internal only. Do not attempt to paste or drop this format in other places.


Generated by doxygen 1.7.3