1 /***************************************************************************
2 * Copyright (C) 2006 by Luigi Toscano <luigi.toscano@tiscali.it> *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 ***************************************************************************/
10 #ifndef _DVI_GENERATOR_H_
11 #define _DVI_GENERATOR_H_
13 #include <okular/core/generator.h>
20 class DocumentViewport
;
24 class DviGenerator
: public Okular::Generator
28 DviGenerator( QObject
*parent
, const QVariantList
&args
);
29 bool loadDocument( const QString
& fileName
, QVector
< Okular::Page
* > & pagesVector
);
31 bool canGeneratePixmap() const;
32 void generatePixmap( Okular::PixmapRequest
* request
);
34 // document information
35 const Okular::DocumentInfo
*generateDocumentInfo();
38 const Okular::DocumentSynopsis
*generateDocumentSynopsis();
40 bool print( QPrinter
&printer
);
43 bool doCloseDocument();
44 Okular::TextPage
* textPage( Okular::Page
*page
);
49 Okular::DocumentInfo
*m_docInfo
;
50 Okular::DocumentSynopsis
*m_docSynopsis
;
53 dviRenderer
*m_dviRenderer
;
55 void loadPages( QVector
< Okular::Page
* > & pagesVector
);
56 Okular::TextPage
*extractTextFromPage( dviPageInfo
*pageInfo
);
57 void fillViewportFromAnchor( Okular::DocumentViewport
&vp
, const Anchor
&anch
,
59 QLinkedList
<Okular::ObjectRect
*> generateDviLinks( const dviPageInfo
*pageInfo
);