initial epub support
This commit is contained in:
1 parent
53d6d541a7
commit
f328e7dab0
9 files changed
+878
-5
No files matched your search
@@ -0,0 +1,35 @@
|
||||
#ifndef EPUBREADER_H
|
||||
#define EPUBREADER_H
|
||||
|
||||
#include "backend/FormatReader.h"
|
||||
#include <QByteArray>
|
||||
#include <QHash>
|
||||
#include <QList>
|
||||
#include <QStringList>
|
||||
|
||||
class EpubReader : public FormatReader {
|
||||
public:
|
||||
bool open(const QString &filePath) override;
|
||||
QString lastError() override;
|
||||
int chapterCount() override;
|
||||
Chapter loadChapter(int index) override;
|
||||
QList<TocEntry> tableOfContents() override;
|
||||
QString title() override;
|
||||
QString author() override;
|
||||
|
||||
private:
|
||||
QString m_title;
|
||||
QString m_author;
|
||||
QString m_error;
|
||||
QString m_opfDir;
|
||||
QStringList m_spineHrefs;
|
||||
QList<QByteArray> m_spineRawContent;
|
||||
QList<TocEntry> m_toc;
|
||||
|
||||
bool parseContainer(const QByteArray &data, QString &opfPath);
|
||||
bool parseOpf(const QByteArray &data, QString &ncxHref);
|
||||
void parseNcx(const QByteArray &data);
|
||||
static QStringList chunkXhtml(const QByteArray &data);
|
||||
};
|
||||
|
||||
#endif // EPUBREADER_H
|
||||
Reference in new issue
Block a user