summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qpagedpaintdevice.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2011-08-17 11:26:51 +0200
committerLars Knoll <lars.knoll@nokia.com>2011-08-19 09:16:12 +0200
commit9ebdc333a6a6485fd60a50a742a1d6edec211f53 (patch)
tree29f47352fac722f29bf3e394214b375977cdcea7 /src/gui/painting/qpagedpaintdevice.h
parent64f94fa373900aca357f5f94c5ef16f481dc11b7 (diff)
Introduce a paged paintdevice and use it
Introduce a QPagedPaintDevice class that has a newPage() method and page dimensions. QPdfWriter and QPrinter inherit from it. Add a bit of API to QPdfWriter. Change-Id: Ibf23e7fe741f3a5ed854faf5d249a272acc75f35 Reviewed-on: http://codereview.qt.nokia.com/3206 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Diffstat (limited to 'src/gui/painting/qpagedpaintdevice.h')
-rw-r--r--src/gui/painting/qpagedpaintdevice.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/gui/painting/qpagedpaintdevice.h b/src/gui/painting/qpagedpaintdevice.h
new file mode 100644
index 0000000000..faba555adf
--- /dev/null
+++ b/src/gui/painting/qpagedpaintdevice.h
@@ -0,0 +1,42 @@
+
+#ifndef QPAGEDPAINTDEVICE_H
+#define QPAGEDPAINTDEVICE_H
+
+#include <QtGui/qpaintdevice.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Gui)
+
+class QPagedPaintDevicePrivate;
+
+class Q_GUI_EXPORT QPagedPaintDevice : public QPaintDevice
+{
+public:
+ QPagedPaintDevice();
+ ~QPagedPaintDevice();
+
+ virtual bool newPage() = 0;
+
+ enum PageSize { A4, B5, Letter, Legal, Executive,
+ A0, A1, A2, A3, A5, A6, A7, A8, A9, B0, B1,
+ B10, B2, B3, B4, B6, B7, B8, B9, C5E, Comm10E,
+ DLE, Folio, Ledger, Tabloid, Custom, NPageSize = Custom };
+
+ virtual void setPageSize(PageSize size);
+ PageSize pageSize() const;
+
+ virtual void setPageSizeMM(const QSizeF &size);
+ QSizeF pageSizeMM() const;
+
+private:
+ QPagedPaintDevicePrivate *d;
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif