itom  4.1.0
scriptEditorPrinter.h
1 /* ********************************************************************
2  itom software
3  URL: http://www.uni-stuttgart.de/ito
4  Copyright (C) 2020, Institut fuer Technische Optik (ITO),
5  Universitaet Stuttgart, Germany
6 
7  This file is part of itom.
8 
9  itom is free software; you can redistribute it and/or modify it
10  under the terms of the GNU Library General Public Licence as published by
11  the Free Software Foundation; either version 2 of the Licence, or (at
12  your option) any later version.
13 
14  itom is distributed in the hope that it will be useful, but
15  WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
17  General Public Licence for more details.
18 
19  You should have received a copy of the GNU Library General Public License
20  along with itom. If not, see <http://www.gnu.org/licenses/>.
21 *********************************************************************** */
22 
23 #ifndef SCRIPTEDITORPRINTER_H
24 #define SCRIPTEDITORPRINTER_H
25 
26 #include <qprinter.h>
27 #include <qtextdocument.h>
28 
29 QT_BEGIN_NAMESPACE
30 class QRect;
31 class QPainter;
32 QT_END_NAMESPACE
33 
34 
35 namespace ito
36 {
37 
38 class CodeEditor;
39 
40 class ScriptEditorPrinter : public QPrinter
41 {
42 public:
43  ScriptEditorPrinter(QPrinter::PrinterMode mode = QPrinter::ScreenResolution);
44 
45  virtual ~ScriptEditorPrinter();
46 
47  virtual QRect formatPage( QPainter &painter, bool drawing, const QRect &area, int pageNumber, int pageCount);
48 
52  int magnification() const {return m_magnification;}
53 
58  virtual void setMagnification(int magnification);
59 
65  virtual int printRange(CodeEditor *editor, int from = -1, int to = -1);
66 
67  virtual void paintPage(int pageNumber, int pageCount, QPainter* painter, QTextDocument* doc, const QRectF& textRect, float scale);
68 
69 private:
70  int m_magnification;
71  int m_alphaLevel;
72 
74  ScriptEditorPrinter &operator=(const ScriptEditorPrinter &);
75 };
76 
77 } //end namespace ito
78 
79 #endif
virtual int printRange(CodeEditor *editor, int from=-1, int to=-1)
Definition: scriptEditorPrinter.cpp:85
Definition: codeEditor.h:110
virtual void setMagnification(int magnification)
Definition: scriptEditorPrinter.cpp:168
Definition: scriptEditorPrinter.h:40
Definition: apiFunctionsGraph.cpp:39
int magnification() const
Definition: scriptEditorPrinter.h:52