summaryrefslogtreecommitdiffstats
path: root/kviewshell/renderedDocumentPagePrinter.h
blob: 44bdc6d285c1aed5681775878cbc73584334c711 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// -*- C++ -*-
//
// Class: RenderedDocumentPagePrinter
//
// Widget for displaying TeX DVI files.
// Part of KDVI- A previewer for TeX DVI files.
//
// (C) 2005 Stefan Kebekus. Distributed under the GPL.


#ifndef _rendereddocumentpageprinter_h_
#define _rendereddocumentpageprinter_h_

#include "renderedDocumentPage.h"
#include <qpainter.h>

class KPrinter;


class RenderedDocumentPagePrinter: public RenderedDocumentPage
{
public:
  RenderedDocumentPagePrinter(KPrinter *kp);

  virtual ~RenderedDocumentPagePrinter() { delete printerPainter; }

  /** Returns a pointer to the paintDevice, in this implementation
      either a QPrinter. The pointer returned is valid as long as
      *this RenderedDocumentPage exists. This method is used by the
      renderer to draw on the page. */
  virtual QPainter *getPainter() { return printerPainter; }

  virtual QSize size();

  /** This method does nothing. In particular, it does NOT delete the
      QPainter. The QPainter is deleted automatically when this
      RenderedDocumentPagePrinter is destructed. */
  virtual void returnPainter(QPainter *) {;}

private:
  KPrinter *printer;
  QPainter *printerPainter;
};


#endif