itom
Loading...
Searching...
No Matches
scriptEditorPrinter.h
1/* ********************************************************************
2 itom software
3 URL: http://www.uni-stuttgart.de/ito
4 Copyright (C) 2020, Institut für Technische Optik (ITO),
5 Universität 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
29QT_BEGIN_NAMESPACE
30class QRect;
31class QPainter;
32QT_END_NAMESPACE
33
34
35namespace ito
36{
37
38class CodeEditor;
39
40class ScriptEditorPrinter : public QPrinter
41{
42public:
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
69private:
70 int m_magnification;
71 int m_alphaLevel;
72
74 ScriptEditorPrinter &operator=(const ScriptEditorPrinter &);
75};
76
77} //end namespace ito
78
79#endif
Definition codeEditor.h:110
Definition scriptEditorPrinter.h:41
int magnification() const
Definition scriptEditorPrinter.h:52
virtual int printRange(CodeEditor *editor, int from=-1, int to=-1)
Definition scriptEditorPrinter.cpp:103
virtual void setMagnification(int magnification)
Definition scriptEditorPrinter.cpp:186
Definition apiFunctionsGraph.cpp:40