aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/desktop-utils/lumina-pdf/Renderer.h
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2018-02-27 10:24:37 -0500
committerKen Moore <ken@ixsystems.com>2018-02-27 10:24:37 -0500
commit6f7bfe5269912021229e570675ac0fbd9ad4f082 (patch)
tree83e4f30b9ec64c71ec89c723cca5a59fa4dbc2a4 /src-qt5/desktop-utils/lumina-pdf/Renderer.h
parentAdded highlighting for search results (diff)
downloadlumina-6f7bfe5269912021229e570675ac0fbd9ad4f082.tar.gz
lumina-6f7bfe5269912021229e570675ac0fbd9ad4f082.tar.bz2
lumina-6f7bfe5269912021229e570675ac0fbd9ad4f082.zip
Get lumina-pdf all up and running again.
1. Abstract out the backend renderer into a new class 2. The Renderer can be selected at build time by setting the "USE_MUPDF" build flag to use mupdf instead of poppler (default).
Diffstat (limited to 'src-qt5/desktop-utils/lumina-pdf/Renderer.h')
-rw-r--r--src-qt5/desktop-utils/lumina-pdf/Renderer.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/src-qt5/desktop-utils/lumina-pdf/Renderer.h b/src-qt5/desktop-utils/lumina-pdf/Renderer.h
new file mode 100644
index 00000000..09e9c425
--- /dev/null
+++ b/src-qt5/desktop-utils/lumina-pdf/Renderer.h
@@ -0,0 +1,39 @@
+// ================================
+// Simple abstraction class between backend renderers
+// ================================
+// Written by Ken Moore: Feb 26, 2018
+// Available under the 3-Clause BSD License
+// ================================
+#ifndef _LUMINA_PDF_BACKEND_RENDERER_H
+#define _LUMINA_PDF_BACKEND_RENDERER_H
+
+#include <QString>
+#include <QImage>
+#include <QDebug>
+#include <QJsonObject>
+#include "textData.h"
+
+class Renderer{
+private:
+ int pnum; //number of pages - set on loading document
+ bool needpass;
+ QString docpath; //save the path for the currently-loaded document
+ QString doctitle;
+public:
+ Renderer();
+ ~Renderer();
+ bool loadMultiThread();
+
+ //Information functions (usually needs to be loaded first)
+ int numPages(){ return pnum; }
+ bool needPassword(){ return needpass; }
+ QString title(){ return doctitle; }
+ QJsonObject properties();
+
+ //Main access functions
+ bool loadDocument(QString path, QString password);
+ QImage renderPage(int pagenum, QSize DPI);
+ QList<TextData*> searchDocument(QString text, bool matchCase);
+};
+
+#endif
bgstack15