kviewshell
DjVuRenderer Class Reference
Well-documented minimal implementation of a documentRenderer. More...
#include <djvurenderer.h>
Public Member Functions | |
bool | convertToPSFile (DjVuToPS &converter, QString filename, QValueList< int > &pageList) |
void | deletePages (Q_UINT16 from, Q_UINT16 to) |
DjVuRenderer (QWidget *parent) | |
virtual void | drawPage (double res, RenderedDocumentPage *page) |
virtual void | getText (RenderedDocumentPage *page) |
bool | save (const QString &filename) |
virtual bool | setFile (const QString &fname, const KURL &) |
virtual bool | supportsTextSearch () const |
~DjVuRenderer () |
Detailed Description
Well-documented minimal implementation of a documentRenderer.This class provides a well-documented reference implementation of a documentRenderer, suitable as a starting point for a real-world implementation. This class is responsible for document loading and rendering. Apart from the constructor and the descructor, it implements only the necessary methods setFile() and drawPage(). The method setFile() ignores the file content and simulates a document with 10 empty pages of A4 size and a few anchors and bookmarks.
Definition at line 51 of file djvurenderer.h.
Constructor & Destructor Documentation
DjVuRenderer::DjVuRenderer | ( | QWidget * | parent | ) |
Default constructor.
This constructor simply prints a message and calls the default constructor.
Definition at line 61 of file djvurenderer.cpp.
DjVuRenderer::~DjVuRenderer | ( | ) |
Destructor.
The destructor simply prints a message. It uses the mutex to ensure that this class is not destructed while another thread is currently using it.
Definition at line 73 of file djvurenderer.cpp.
Member Function Documentation
bool DjVuRenderer::convertToPSFile | ( | DjVuToPS & | converter, | |
QString | filename, | |||
QValueList< int > & | pageList | |||
) |
DJVU to PostScript conversion.
This method uses the converter to convert the document to a PostScript.
- Parameters:
-
converter a DjVuToPS converter, whose options should already be set to filename name of the PostScript file to generate pageList list of pages that are to be converted, with the usual convention that "1" means "first page"
- Returns:
- 'true' if the conversion was successful, 'false' if it wasn't. The conversion can fail, for example, when the user aborts the operation.
Definition at line 570 of file djvurenderer.cpp.
void DjVuRenderer::deletePages | ( | Q_UINT16 | from, | |
Q_UINT16 | to | |||
) |
void DjVuRenderer::drawPage | ( | double | res, | |
RenderedDocumentPage * | page | |||
) | [virtual] |
Rendering a page.
- Parameters:
-
res resolution at which drawing should take place page pointer to a page structur on which we should draw
Implements DocumentRenderer.
Definition at line 84 of file djvurenderer.cpp.
void DjVuRenderer::getText | ( | RenderedDocumentPage * | page | ) | [virtual] |
Extract the hidden text layer.
This function decodes the hidden text layer without actually decoding the full page. It is therefore much faster then drawPage if you only need the text information.
Reimplemented from DocumentRenderer.
Definition at line 546 of file djvurenderer.cpp.
bool DjVuRenderer::save | ( | const QString & | filename | ) |
bool DjVuRenderer::setFile | ( | const QString & | fname, | |
const KURL & | ||||
) | [virtual] |
Opening a file.
This implementation does the necessary consistency checks and complains, e.g. if the file does not exist, but otherwise completely disregards the file content. It simulates a document of 10 empty pages of A4 size, with a few sample bookmarks and anchors "p1", "p2", "p3" for page 1, 2 and 3, respectively.
- Parameters:
-
fname the name of the file that should be opened.
Implements DocumentRenderer.
Definition at line 252 of file djvurenderer.cpp.
virtual bool DjVuRenderer::supportsTextSearch | ( | ) | const [inline, virtual] |
Flag to indicate if full text is supported.
If your implementation of the drawPage() method supports full-text information and writes to the documentPage::textLinkList, this method should be re-implemented to return 'true'. The text-search and text-selection utilities will then be enabled in the GUI.
The default implementation returns 'false'.
Reimplemented from DocumentRenderer.
Definition at line 95 of file djvurenderer.h.
The documentation for this class was generated from the following files: