![]() |
LeechCraft Monocle 0.6.70-17609-g3dde4097dd
Modular document viewer for LeechCraft
|
Basic interface for documents. More...
#include "idocument.h"
Public Member Functions | |
virtual | ~IDocument ()=default |
Virtual destructor. | |
virtual QObject * | GetBackendPlugin () const =0 |
Returns the parent backend plugin. | |
virtual QObject * | GetQObject ()=0 |
Returns this object as a QObject. | |
virtual bool | IsValid () const =0 |
Returns whether this document is valid. | |
virtual DocumentInfo | GetDocumentInfo () const =0 |
Returns the document metadata. | |
virtual int | GetNumPages () const =0 |
Returns the number of pages in this document. | |
virtual QSize | GetPageSize (int page) const =0 |
Returns the size in points of the given page. | |
virtual QFuture< QImage > | RenderPage (int page, double xScale, double yScale)=0 |
Renders the given page at the given scale. | |
virtual QList< ILink_ptr > | GetPageLinks (int page)=0 |
Returns the links found at the given page. | |
virtual QUrl | GetDocURL () const =0 |
Returns the URL of the document. | |
virtual const DocumentSignals * | GetDocumentSignals () const =0 |
Returns the type-safe connector for various document signals. | |
Basic interface for documents.
This interface is the basic interface for documents returned from format backends.
Pages actions (like rendering) are also performed via this interface. Pages indexes are zero-based.
This class has some signals, and one can use the GetQObject() method to get an object of this class as a QObject and connect to those signals.
There are also other interfaces for extended functionality like documents that can be changed and saved, the documents containing annotations and so on. See the See also section for the details.
Definition at line 80 of file idocument.h.
|
virtualdefault |
Virtual destructor.
|
pure virtual |
Returns the parent backend plugin.
This function should return the instance object of the backend plugin that created this document.
The returned value should obviously implement IBackendPlugin.
|
pure virtual |
Returns the document metadata.
|
pure virtual |
Returns the type-safe connector for various document signals.
The returned pointer might be nullptr
if this document never emits anything.
IDocument
signals, or nullptr
.
|
pure virtual |
Returns the URL of the document.
This method should return the URL of this document. URLs on the local filesystem should obviously have the file scheme.
|
pure virtual |
Returns the number of pages in this document.
|
pure virtual |
Returns the links found at the given page.
If the format doesn't support links, an empty list should be returned.
The ownership of the returned links objects is passed to the caller.
[in] | page | The page index to query. |
|
pure virtual |
Returns the size in points of the given page.
This function returns the physical dimensions of the given page in points.
Some formats support different pages having different sizes in the same document, thus the size should be queried for each page.
[in] | page | The index of the page to query. |
|
pure virtual |
Returns this object as a QObject.
This function can be used to connect to the signals of this class.
|
pure virtual |
Returns whether this document is valid.
An invalid document is basically equivalent to a null pointer, all operations on it lead to undefined behavior.
|
pure virtual |
Renders the given page at the given scale.
This function should return an image with the given page rendered at the given xScale and yScale for x and y axises correspondingly. That is, the image's size should be equal to the following:
[in] | page | The index of the page to render. |
[in] | xScale | The scale of the x axis. |
[in] | yScale | The scale of the y axis. |