qprinter.sip 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. // qprinter.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtPrintSupport Python extension module.
  4. //
  5. // Copyright (c) 2026 Riverbank Computing Limited <info@riverbankcomputing.com>
  6. //
  7. // This file is part of PyQt6.
  8. //
  9. // This file may be used under the terms of the GNU General Public License
  10. // version 3.0 as published by the Free Software Foundation and appearing in
  11. // the file LICENSE included in the packaging of this file. Please review the
  12. // following information to ensure the GNU General Public License version 3.0
  13. // requirements will be met: http://www.gnu.org/copyleft/gpl.html.
  14. //
  15. // If you do not wish to use this file under the terms of the GPL version 3.0
  16. // then you may purchase a commercial license. For more information contact
  17. // info@riverbankcomputing.com.
  18. //
  19. // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
  20. // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  21. %If (PyQt_Printer)
  22. class QPrinter : public QPagedPaintDevice
  23. {
  24. %TypeHeaderCode
  25. #include <qprinter.h>
  26. %End
  27. public:
  28. enum PrinterMode
  29. {
  30. ScreenResolution,
  31. PrinterResolution,
  32. HighResolution,
  33. };
  34. explicit QPrinter(QPrinter::PrinterMode mode = QPrinter::ScreenResolution);
  35. QPrinter(const QPrinterInfo &printer, QPrinter::PrinterMode mode = QPrinter::ScreenResolution);
  36. virtual ~QPrinter();
  37. enum PageOrder
  38. {
  39. FirstPageFirst,
  40. LastPageFirst,
  41. };
  42. enum ColorMode
  43. {
  44. GrayScale,
  45. Color,
  46. };
  47. enum PaperSource
  48. {
  49. OnlyOne,
  50. Lower,
  51. Middle,
  52. Manual,
  53. Envelope,
  54. EnvelopeManual,
  55. Auto,
  56. Tractor,
  57. SmallFormat,
  58. LargeFormat,
  59. LargeCapacity,
  60. Cassette,
  61. FormSource,
  62. MaxPageSource,
  63. Upper,
  64. CustomSource,
  65. LastPaperSource,
  66. };
  67. enum PrinterState
  68. {
  69. Idle,
  70. Active,
  71. Aborted,
  72. Error,
  73. };
  74. enum OutputFormat
  75. {
  76. NativeFormat,
  77. PdfFormat,
  78. };
  79. enum PrintRange
  80. {
  81. AllPages,
  82. Selection,
  83. PageRange,
  84. CurrentPage,
  85. };
  86. enum Unit
  87. {
  88. Millimeter,
  89. Point,
  90. Inch,
  91. Pica,
  92. Didot,
  93. Cicero,
  94. DevicePixel,
  95. };
  96. enum DuplexMode
  97. {
  98. DuplexNone,
  99. DuplexAuto,
  100. DuplexLongSide,
  101. DuplexShortSide,
  102. };
  103. void setOutputFormat(QPrinter::OutputFormat format);
  104. QPrinter::OutputFormat outputFormat() const;
  105. void setPrinterName(const QString &);
  106. QString printerName() const;
  107. bool isValid() const;
  108. void setOutputFileName(const QString &);
  109. QString outputFileName() const;
  110. void setPrintProgram(const QString &);
  111. QString printProgram() const;
  112. void setDocName(const QString &);
  113. QString docName() const;
  114. void setCreator(const QString &);
  115. QString creator() const;
  116. void setPageOrder(QPrinter::PageOrder);
  117. QPrinter::PageOrder pageOrder() const;
  118. void setResolution(int);
  119. int resolution() const;
  120. void setColorMode(QPrinter::ColorMode);
  121. QPrinter::ColorMode colorMode() const;
  122. void setCollateCopies(bool collate);
  123. bool collateCopies() const;
  124. void setFullPage(bool);
  125. bool fullPage() const;
  126. void setCopyCount(int);
  127. int copyCount() const;
  128. bool supportsMultipleCopies() const;
  129. void setPaperSource(QPrinter::PaperSource);
  130. QPrinter::PaperSource paperSource() const;
  131. void setDuplex(QPrinter::DuplexMode duplex);
  132. QPrinter::DuplexMode duplex() const;
  133. QList<int> supportedResolutions() const;
  134. void setFontEmbeddingEnabled(bool enable);
  135. bool fontEmbeddingEnabled() const;
  136. QRectF paperRect(QPrinter::Unit) const;
  137. QRectF pageRect(QPrinter::Unit) const;
  138. %If (Android || Linux || iOS || macOS || WebAssembly)
  139. QString printerSelectionOption() const;
  140. %End
  141. %If (Android || Linux || iOS || macOS || WebAssembly)
  142. void setPrinterSelectionOption(const QString &);
  143. %End
  144. virtual bool newPage();
  145. bool abort();
  146. QPrinter::PrinterState printerState() const;
  147. virtual QPaintEngine *paintEngine() const;
  148. QPrintEngine *printEngine() const;
  149. void setFromTo(int fromPage, int toPage);
  150. int fromPage() const;
  151. int toPage() const;
  152. void setPrintRange(QPrinter::PrintRange range);
  153. QPrinter::PrintRange printRange() const;
  154. protected:
  155. virtual int metric(QPaintDevice::PaintDeviceMetric) const;
  156. void setEngines(QPrintEngine *printEngine, QPaintEngine *paintEngine);
  157. public:
  158. void setPdfVersion(QPagedPaintDevice::PdfVersion version);
  159. QPagedPaintDevice::PdfVersion pdfVersion() const;
  160. };
  161. %End