Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QPdfDocumentPrivate Class Reference

#include <qpdfdocument_p.h>

+ Inheritance diagram for QPdfDocumentPrivate:
+ Collaboration diagram for QPdfDocumentPrivate:

Classes

struct  TextPosition
 

Public Types

enum  QFPDFRotation { Normal = 0 , ClockWise90 = 1 , ClockWise180 = 2 , CounterClockWise90 = 3 }
 

Public Member Functions

 QPdfDocumentPrivate ()
 
 ~QPdfDocumentPrivate ()
 
void clear ()
 
void load (QIODevice *device, bool ownDevice)
 
void loadAsync (QIODevice *device)
 
void _q_tryLoadingWithSizeFromContentHeader ()
 
void initiateAsyncLoadWithTotalSizeKnown (quint64 totalSize)
 
void _q_copyFromSequentialSourceDevice ()
 
void tryLoadDocument ()
 
void checkComplete ()
 
bool checkPageComplete (int page)
 
void setStatus (QPdfDocument::Status status)
 
void updateLastError ()
 
QString getText (FPDF_TEXTPAGE textPage, int startIndex, int count)
 
QPointF getCharPosition (FPDF_TEXTPAGE textPage, double pageHeight, int charIndex)
 
QRectF getCharBox (FPDF_TEXTPAGE textPage, double pageHeight, int charIndex)
 
TextPosition hitTest (int page, QPointF position)
 

Static Public Member Functions

static FPDF_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)
 
static constexpr QFPDFRotation toFPDFRotation (QPdfDocumentRenderOptions::Rotation rotation)
 

Public Attributes

QPdfDocumentq
 
QPdfPageModelpageModel = nullptr
 
FPDF_AVAIL avail
 
FPDF_DOCUMENT doc
 
bool loadComplete
 
QPointer< QIODevicedevice
 
QScopedPointer< QIODeviceownDevice
 
QBuffer asyncBuffer
 
QPointer< QIODevicesequentialSourceDevice
 
QByteArray password
 
QPdfDocument::Status status
 
QPdfDocument::Error lastError
 
int pageCount
 

Detailed Description

Definition at line 40 of file qpdfdocument_p.h.

Member Enumeration Documentation

◆ QFPDFRotation

Enumerator
Normal 
ClockWise90 
ClockWise180 
CounterClockWise90 

Definition at line 87 of file qpdfdocument_p.h.

Constructor & Destructor Documentation

◆ QPdfDocumentPrivate()

QPdfDocumentPrivate::QPdfDocumentPrivate ( )

Definition at line 106 of file qpdfdocument.cpp.

References asyncBuffer, fpdf_AddSegment(), fpdf_GetBlock(), fpdf_IsDataAvail(), libraryRefCount, lock, QBuffer::open(), qCDebug, QIODeviceBase::ReadWrite, QBuffer::setData(), QTimer::start(), and timer.

+ Here is the call graph for this function:

◆ ~QPdfDocumentPrivate()

QPdfDocumentPrivate::~QPdfDocumentPrivate ( )

Definition at line 140 of file qpdfdocument.cpp.

References libraryRefCount, lock, and qCDebug.

Member Function Documentation

◆ _q_copyFromSequentialSourceDevice()

void QPdfDocumentPrivate::_q_copyFromSequentialSourceDevice ( )

Definition at line 311 of file qpdfdocument.cpp.

References asyncBuffer, QIODevice::bytesAvailable(), checkComplete(), loadComplete, QIODevice::read(), QBuffer::seek(), sequentialSourceDevice, QBuffer::size(), and QIODevice::write().

Referenced by _q_tryLoadingWithSizeFromContentHeader().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _q_tryLoadingWithSizeFromContentHeader()

void QPdfDocumentPrivate::_q_tryLoadingWithSizeFromContentHeader ( )

Definition at line 276 of file qpdfdocument.cpp.

References _q_copyFromSequentialSourceDevice(), avail, QIODevice::bytesAvailable(), QObject::connect(), QNetworkRequest::ContentLengthHeader, QPdfDocument::Error, QNetworkReply::header(), initiateAsyncLoadWithTotalSizeKnown(), QVariant::isValid(), sequentialSourceDevice, setStatus(), SIGNAL, SLOT, and QVariant::toULongLong().

Referenced by load().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkComplete()

void QPdfDocumentPrivate::checkComplete ( )

Definition at line 360 of file qpdfdocument.cpp.

References avail, doc, emit, i, loadComplete, lock, pageCount, QPdfDocument::Ready, setStatus(), and tryLoadDocument().

Referenced by _q_copyFromSequentialSourceDevice().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkPageComplete()

bool QPdfDocumentPrivate::checkPageComplete ( int  page)

Definition at line 399 of file qpdfdocument.cpp.

References avail, loadComplete, lock, page, pageCount, and updateLastError().

Referenced by load(), QPdfDocument::pagePointSize(), and QPdfDocument::render().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ clear()

void QPdfDocumentPrivate::clear ( )

Definition at line 152 of file qpdfdocument.cpp.

References asyncBuffer, avail, QBuffer::close(), QObject::disconnect(), doc, emit, loadComplete, lock, QBuffer::open(), pageCount, QIODeviceBase::ReadWrite, sequentialSourceDevice, and QBuffer::setData().

Referenced by QPdfDocument::close().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fpdf_AddSegment()

void QPdfDocumentPrivate::fpdf_AddSegment ( struct _FX_DOWNLOADHINTS *  pThis,
size_t  offset,
size_t  size 
)
static

Definition at line 442 of file qpdfdocument.cpp.

References Q_UNUSED.

Referenced by QPdfDocumentPrivate().

+ Here is the caller graph for this function:

◆ fpdf_GetBlock()

int QPdfDocumentPrivate::fpdf_GetBlock ( void param,
unsigned long  position,
unsigned char *  pBuf,
unsigned long  size 
)
static

Definition at line 434 of file qpdfdocument.cpp.

References d, position(), and qMax().

Referenced by QPdfDocumentPrivate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fpdf_IsDataAvail()

FPDF_BOOL QPdfDocumentPrivate::fpdf_IsDataAvail ( struct _FX_FILEAVAIL *  pThis,
size_t  offset,
size_t  size 
)
static

Definition at line 428 of file qpdfdocument.cpp.

References d.

Referenced by QPdfDocumentPrivate().

+ Here is the caller graph for this function:

◆ getCharBox()

QRectF QPdfDocumentPrivate::getCharBox ( FPDF_TEXTPAGE  textPage,
double  pageHeight,
int  charIndex 
)

Definition at line 468 of file qpdfdocument.cpp.

References ok.

Referenced by QPdfDocument::getSelection(), and hitTest().

+ Here is the caller graph for this function:

◆ getCharPosition()

QPointF QPdfDocumentPrivate::getCharPosition ( FPDF_TEXTPAGE  textPage,
double  pageHeight,
int  charIndex 
)

Definition at line 458 of file qpdfdocument.cpp.

References ok, and qMin().

Referenced by QPdfDocument::getSelectionAtIndex(), and hitTest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getText()

QString QPdfDocumentPrivate::getText ( FPDF_TEXTPAGE  textPage,
int  startIndex,
int  count 
)

Definition at line 449 of file qpdfdocument.cpp.

References QString::fromUtf16(), and Q_ASSERT.

Referenced by QPdfDocument::getAllText(), QPdfDocument::getSelection(), and QPdfDocument::getSelectionAtIndex().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hitTest()

QPdfDocumentPrivate::TextPosition QPdfDocumentPrivate::hitTest ( int  page,
QPointF  position 
)

Definition at line 477 of file qpdfdocument.cpp.

References CharacterHitTolerance, doc, getCharBox(), getCharPosition(), QRectF::height(), QPointF::isNull(), lock, page, position(), qAbs(), qCDebug, QRectF::right(), QPointF::setX(), and QPointF::x().

+ Here is the call graph for this function:

◆ initiateAsyncLoadWithTotalSizeKnown()

void QPdfDocumentPrivate::initiateAsyncLoadWithTotalSizeKnown ( quint64  totalSize)

Definition at line 301 of file qpdfdocument.cpp.

References avail, and lock.

Referenced by _q_tryLoadingWithSizeFromContentHeader(), and load().

+ Here is the caller graph for this function:

◆ load()

void QPdfDocumentPrivate::load ( QIODevice device,
bool  ownDevice 
)

◆ loadAsync()

void QPdfDocumentPrivate::loadAsync ( QIODevice device)

◆ setStatus()

void QPdfDocumentPrivate::setStatus ( QPdfDocument::Status  status)

Definition at line 419 of file qpdfdocument.cpp.

References emit, and status.

Referenced by _q_tryLoadingWithSizeFromContentHeader(), checkComplete(), QPdfDocument::close(), QPdfDocument::load(), QPdfDocument::load(), load(), and tryLoadDocument().

+ Here is the caller graph for this function:

◆ toFPDFRotation()

static constexpr QFPDFRotation QPdfDocumentPrivate::toFPDFRotation ( QPdfDocumentRenderOptions::Rotation  rotation)
inlinestaticconstexpr

Definition at line 94 of file qpdfdocument_p.h.

References QPdfDocumentRenderOptions::Clockwise180, QPdfDocumentRenderOptions::Clockwise270, QPdfDocumentRenderOptions::Clockwise90, and QPdfDocumentRenderOptions::None.

Referenced by QPdfDocument::render().

+ Here is the caller graph for this function:

◆ tryLoadDocument()

void QPdfDocumentPrivate::tryLoadDocument ( )

Definition at line 326 of file qpdfdocument.cpp.

References avail, QPdfDocument::DataNotYetAvailable, doc, emit, QPdfDocument::Error, QPdfDocument::IncorrectPassword, lastError, lock, QPdfDocument::None, password, Q_ASSERT, qCDebug, setStatus(), and updateLastError().

Referenced by checkComplete(), and load().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateLastError()

void QPdfDocumentPrivate::updateLastError ( )

Definition at line 181 of file qpdfdocument.cpp.

References doc, error, QPdfDocument::FileNotFound, QPdfDocument::IncorrectPassword, QPdfDocument::InvalidFileFormat, lastError, lock, QPdfDocument::None, qCDebug, QPdfDocument::Unknown, and QPdfDocument::UnsupportedSecurityScheme.

Referenced by checkPageComplete(), load(), and tryLoadDocument().

+ Here is the caller graph for this function:

Member Data Documentation

◆ asyncBuffer

QBuffer QPdfDocumentPrivate::asyncBuffer

◆ avail

◆ device

QPointer<QIODevice> QPdfDocumentPrivate::device

Definition at line 53 of file qpdfdocument_p.h.

Referenced by load().

◆ doc

◆ lastError

QPdfDocument::Error QPdfDocumentPrivate::lastError

◆ loadComplete

bool QPdfDocumentPrivate::loadComplete

◆ ownDevice

QScopedPointer<QIODevice> QPdfDocumentPrivate::ownDevice

Definition at line 54 of file qpdfdocument_p.h.

Referenced by load().

◆ pageCount

int QPdfDocumentPrivate::pageCount

◆ pageModel

QPdfPageModel* QPdfDocumentPrivate::pageModel = nullptr

Definition at line 47 of file qpdfdocument_p.h.

◆ password

QByteArray QPdfDocumentPrivate::password

◆ q

QPdfDocument* QPdfDocumentPrivate::q

Definition at line 46 of file qpdfdocument_p.h.

Referenced by QPdfDocument::QPdfDocument().

◆ sequentialSourceDevice

QPointer<QIODevice> QPdfDocumentPrivate::sequentialSourceDevice

◆ status

QPdfDocument::Status QPdfDocumentPrivate::status

Definition at line 59 of file qpdfdocument_p.h.

Referenced by setStatus(), and QPdfDocument::status().


The documentation for this class was generated from the following files: