mirror of
https://invent.kde.org/graphics/okular
synced 2024-11-05 18:34:53 +00:00
6068c76df6
svn path=/trunk/playground/graphics/okular/; revision=628853
61 lines
2.1 KiB
C++
61 lines
2.1 KiB
C++
/***************************************************************************
|
|
* Copyright (C) 2006 by Luigi Toscano <luigi.toscano@tiscali.it> *
|
|
* *
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
* it under the terms of the GNU General Public License as published by *
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
* (at your option) any later version. *
|
|
***************************************************************************/
|
|
|
|
#ifndef _DVI_GENERATOR_H_
|
|
#define _DVI_GENERATOR_H_
|
|
|
|
#include <okular/core/generator.h>
|
|
|
|
class dviRenderer;
|
|
class dviPageInfo;
|
|
class Anchor;
|
|
|
|
namespace Okular {
|
|
class DocumentViewport;
|
|
class ObjectRect;
|
|
}
|
|
|
|
class DviGenerator : public Okular::Generator
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
DviGenerator();
|
|
bool loadDocument( const QString & fileName, QVector< Okular::Page * > & pagesVector );
|
|
bool closeDocument();
|
|
|
|
bool canGeneratePixmap() const;
|
|
void generatePixmap( Okular::PixmapRequest * request );
|
|
|
|
// document information
|
|
const Okular::DocumentInfo *generateDocumentInfo();
|
|
|
|
// table of contents
|
|
const Okular::DocumentSynopsis *generateDocumentSynopsis();
|
|
|
|
protected:
|
|
Okular::TextPage* textPage( Okular::Page *page );
|
|
|
|
private:
|
|
double m_resolution;
|
|
|
|
Okular::DocumentInfo *m_docInfo;
|
|
Okular::DocumentSynopsis *m_docSynopsis;
|
|
|
|
bool ready;
|
|
dviRenderer *m_dviRenderer;
|
|
|
|
void loadPages( QVector< Okular::Page * > & pagesVector, int orientation );
|
|
Okular::TextPage *extractTextFromPage( dviPageInfo *pageInfo, int orientation );
|
|
void fillViewportFromAnchor( Okular::DocumentViewport &vp, const Anchor &anch,
|
|
int pW, int pH, int orientation );
|
|
QLinkedList<Okular::ObjectRect*> generateDviLinks( const dviPageInfo *pageInfo,
|
|
int orientation );
|
|
};
|
|
|
|
#endif
|