1 /* 2 * DQt - D bindings for the Qt Toolkit 3 * 4 * GNU Lesser General Public License Usage 5 * This file may be used under the terms of the GNU Lesser 6 * General Public License version 3 as published by the Free Software 7 * Foundation and appearing in the file LICENSE.LGPL3 included in the 8 * packaging of this file. Please review the following information to 9 * ensure the GNU Lesser General Public License version 3 requirements 10 * will be met: https://www.gnu.org/licenses/lgpl-3.0.html. 11 */ 12 module qt.gui.pagedpaintdevice; 13 extern(C++): 14 15 import qt.config; 16 import qt.core.margins; 17 import qt.gui.pagelayout; 18 import qt.gui.pageranges; 19 import qt.gui.pagesize; 20 import qt.gui.paintdevice; 21 import qt.helpers; 22 23 /+ #if defined(B0) 24 #undef B0 // Terminal hang-up. We assume that you do not want that. 25 #endif +/ 26 27 extern(C++, class) struct QPagedPaintDevicePrivate; 28 29 interface QPagedPaintDeviceInterface : QPaintDeviceInterface 30 { 31 alias PdfVersion = QPagedPaintDevice.PdfVersion; 32 33 /+ virtual +/ abstract bool newPage(); 34 /+ virtual +/ bool setPageLayout(ref const(QPageLayout) pageLayout); 35 /+ virtual +/ bool setPageSize(ref const(QPageSize) pageSize); 36 /+ virtual +/ bool setPageOrientation(QPageLayout.Orientation orientation); 37 /+ virtual +/ bool setPageMargins(ref const(QMarginsF) margins, QPageLayout.Unit units = QPageLayout.Unit.Millimeter); 38 } 39 40 /// Binding for C++ class [QPagedPaintDevice](https://doc.qt.io/qt-6/qpagedpaintdevice.html). 41 abstract class /+ Q_GUI_EXPORT +/ QPagedPaintDevice : QPaintDevice 42 { 43 public: 44 ~this(); 45 46 /+ virtual +/ abstract bool newPage(); 47 48 // keep in sync with QPdfEngine::PdfVersion! 49 enum PdfVersion { PdfVersion_1_4, PdfVersion_A1b, PdfVersion_1_6 } 50 51 /+ virtual +/ bool setPageLayout(ref const(QPageLayout) pageLayout); 52 /+ virtual +/ bool setPageSize(ref const(QPageSize) pageSize); 53 /+ virtual +/ bool setPageOrientation(QPageLayout.Orientation orientation); 54 /+ virtual +/ bool setPageMargins(ref const(QMarginsF) margins, QPageLayout.Unit units = QPageLayout.Unit.Millimeter); 55 final QPageLayout pageLayout() const; 56 57 /+ virtual +/ void setPageRanges(ref const(QPageRanges) ranges); 58 final QPageRanges pageRanges() const; 59 60 protected: 61 mixin(changeItaniumMangling(q{mangleConstructorBaseObject}, q{ 62 this(QPagedPaintDevicePrivate* dd); 63 })); 64 final QPagedPaintDevicePrivate* dd(); 65 /+ friend class QPagedPaintDevicePrivate; +/ 66 QPagedPaintDevicePrivate* d; 67 mixin(CREATE_CONVENIENCE_WRAPPERS); 68 } 69 70 static assert(__traits(classInstanceSize, QPagedPaintDevice) == (void*).sizeof * 3); 71 struct QPagedPaintDeviceFakeInheritance 72 { 73 static assert(__traits(classInstanceSize, QPagedPaintDevice) % (void*).sizeof == 0); 74 void*[__traits(classInstanceSize, QPagedPaintDevice) / (void*).sizeof - 1] data; 75 } 76