2022-03-02 21:15:53 +02:00
|
|
|
/***************************************************************************
|
|
|
|
* Copyright (C) 2022 by Ivailo Monev <xakepa10@gmail.com> *
|
|
|
|
* *
|
|
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
|
|
* (at your option) any later version. *
|
|
|
|
***************************************************************************/
|
|
|
|
|
2022-03-02 21:18:33 +02:00
|
|
|
#ifndef MD_DOCUMENT_H
|
|
|
|
#define MD_DOCUMENT_H
|
2022-03-02 21:15:53 +02:00
|
|
|
|
|
|
|
#include <QtGui/QTextDocument>
|
2022-04-18 03:55:38 +03:00
|
|
|
#include <kio/job.h>
|
|
|
|
|
2022-03-02 21:15:53 +02:00
|
|
|
class MDDocument : public QTextDocument
|
|
|
|
{
|
2022-04-18 03:55:38 +03:00
|
|
|
Q_OBJECT
|
2022-03-02 21:15:53 +02:00
|
|
|
public:
|
2022-03-03 01:38:39 +02:00
|
|
|
MDDocument(const QString &fileName);
|
2022-03-02 21:15:53 +02:00
|
|
|
|
|
|
|
void slotMdCallback(const char* data, qlonglong datasize);
|
|
|
|
|
2022-04-18 03:55:38 +03:00
|
|
|
protected:
|
|
|
|
QVariant loadResource(int type, const QUrl &url) final;
|
|
|
|
|
|
|
|
private Q_SLOTS:
|
|
|
|
void slotKIOData(KIO::Job *kiojob, const QByteArray &data);
|
|
|
|
void slotKIOResult(KJob *kiojob);
|
|
|
|
|
2022-03-02 21:15:53 +02:00
|
|
|
private:
|
|
|
|
QByteArray m_mddata;
|
2022-04-18 07:31:01 +03:00
|
|
|
QByteArray m_resourcedata;
|
|
|
|
QMap<QUrl, QVariant> m_resources;
|
2022-03-02 21:15:53 +02:00
|
|
|
};
|
2022-03-02 21:18:33 +02:00
|
|
|
|
|
|
|
#endif // MD_DOCUMENT_H
|