summaryrefslogtreecommitdiffstats
path: root/src/pdf/qpdfdocument_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/pdf/qpdfdocument_p.h')
-rw-r--r--src/pdf/qpdfdocument_p.h23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/pdf/qpdfdocument_p.h b/src/pdf/qpdfdocument_p.h
index 7f9b10220..ec9e2e3ae 100644
--- a/src/pdf/qpdfdocument_p.h
+++ b/src/pdf/qpdfdocument_p.h
@@ -5,24 +5,41 @@
#include "fpdf_dataavail.h"
#include "qpdfdocument.h"
-#include <qiodevice.h>
+#include <qbuffer.h>
+#include <qnetworkreply.h>
-class QPdfDocumentPrivate: public FPDF_FILEACCESS
+class QPdfDocumentPrivate: public FPDF_FILEACCESS, public FX_FILEAVAIL, public FX_DOWNLOADHINTS
{
public:
QPdfDocumentPrivate();
~QPdfDocumentPrivate();
+ QPdfDocument *q;
+
+ FPDF_AVAIL avail;
FPDF_DOCUMENT doc;
- QIODevice *device;
+ QPointer<QIODevice> device;
QScopedPointer<QIODevice> ownDevice;
+ QBuffer asyncBuffer;
+ QPointer<QNetworkReply> remoteDevice;
QByteArray password;
+ QPdfDocument::Error lastError;
+
+ void clear();
+
QPdfDocument::Error load(QIODevice *device, bool ownDevice, const QString &documentPassword);
+ void loadAsync(QIODevice *device);
+
+ void _q_initiateAsyncLoad();
+ void _q_readFromDevice();
+ void tryLoadDocument();
static bool fpdf_IsDataAvail(struct _FX_FILEAVAIL* pThis, size_t offset, size_t size);
static int fpdf_GetBlock(void* param, unsigned long position, unsigned char* pBuf, unsigned long size);
+ static void fpdf_AddSegment(struct _FX_DOWNLOADHINTS* pThis, size_t offset, size_t size);
+ void setErrorCode();
};
#endif // QPDFDOCUMENT_P_H