okular/generators/kimgio/generator_kimgio.h
Albert Astals Cid a2576dc746 Act on core/ TODOs that are not binary compatible
I'm going to need to break binary compatibility to add a new feature
so may as well cleanup all the TODOs regarding that

Changes:
 * Moving a few destructors to the header
 * Removing a few unnecessary & in params
 * Adding a few necessary & in params
 * Making print return an enum instead of a bool and then having another
   function that returns the enum
 * Make Generator::requestFontData be a virtual
 * Remove unused enum
 * Remove a few filePrinter unneeded functions
 * Remove unused TextDocumentGenerator::addMetaData signal
2021-12-29 09:35:25 +00:00

51 lines
1.6 KiB
C++

/*
SPDX-FileCopyrightText: 2005 Albert Astals Cid <aacid@kde.org>
Work sponsored by the LiMux project of the city of Munich:
SPDX-FileCopyrightText: 2017 Klarälvdalens Datakonsult AB a KDAB Group company <info@kdab.com>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef _OKULAR_GENERATOR_KIMGIO_H_
#define _OKULAR_GENERATOR_KIMGIO_H_
#include <core/document.h>
#include <core/generator.h>
#include <QImage>
class KIMGIOGenerator : public Okular::Generator
{
Q_OBJECT
Q_INTERFACES(Okular::Generator)
public:
KIMGIOGenerator(QObject *parent, const QVariantList &args);
~KIMGIOGenerator() override;
// [INHERITED] load a document and fill up the pagesVector
bool loadDocument(const QString &fileName, QVector<Okular::Page *> &pagesVector) override;
bool loadDocumentFromData(const QByteArray &fileData, QVector<Okular::Page *> &pagesVector) override;
SwapBackingFileResult swapBackingFile(QString const &newFileName, QVector<Okular::Page *> &newPagesVector) override;
// [INHERITED] print document using already configured kprinter
Okular::Document::PrintError print(QPrinter &printer) override;
// [INHERITED] document information
Okular::DocumentInfo generateDocumentInfo(const QSet<Okular::DocumentInfo::Key> &keys) const override;
protected:
bool doCloseDocument() override;
QImage image(Okular::PixmapRequest *request) override;
private:
bool loadDocumentInternal(const QByteArray &fileData, const QString &fileName, QVector<Okular::Page *> &pagesVector);
private:
QImage m_img;
Okular::DocumentInfo docInfo;
};
#endif