kviewshell
renderedDocumentPage.h
Go to the documentation of this file.00001 // -*- C++ -*- 00002 // 00003 // Class: documentPage 00004 // 00005 // Widget for displaying TeX DVI files. 00006 // Part of KDVI- A previewer for TeX DVI files. 00007 // 00008 // (C) 2004-2005 Stefan Kebekus. Distributed under the GPL. 00009 00010 00011 #ifndef _rendereddocumentpage_h_ 00012 #define _rendereddocumentpage_h_ 00013 00014 #include "pageNumber.h" 00015 00016 #include <qobject.h> 00017 #include <qstring.h> 00018 #include <qvaluevector.h> 00019 00020 class Hyperlink; 00021 class QPainter; 00022 class QRect; 00023 class QRegion; 00024 class TextBox; 00025 class TextSelection; 00026 00067 class RenderedDocumentPage : public QObject 00068 { 00069 Q_OBJECT 00070 00071 public: 00077 RenderedDocumentPage(); 00078 00079 virtual ~RenderedDocumentPage(); 00080 00087 void setPageNumber(const PageNumber& pagenr); 00088 00093 PageNumber getPageNumber() const {return pageNr;} 00094 00128 virtual QPainter *getPainter() = 0; 00129 00130 00143 virtual void returnPainter(QPainter *pt) = 0; 00144 00146 virtual QSize size() = 0; 00147 00161 virtual int width() {return size().width(); } 00162 00176 virtual int height() {return size().height(); } 00177 00186 QValueVector<TextBox> textBoxList; 00187 00189 TextSelection select(const QRect&); 00190 00192 TextSelection select(const QPoint&); 00193 00194 QRegion selectedRegion(const TextSelection& selection); 00195 00199 TextSelection find(const QString& str, int index = 0, bool caseSensitive = true); 00200 00205 TextSelection findRev(const QString& str, int index = 0, bool cs = true); 00206 00214 QValueVector<Hyperlink> hyperLinkList; 00215 00216 // set to 'false' in the constructor, set to 'true' by the renderer, 00217 // if something really has been rendered 00218 bool isEmpty; 00219 00227 virtual void clear(); 00228 00229 private: 00235 PageNumber pageNr; 00236 00237 QString pageText; 00238 }; 00239 00240 00241 #endif