qabstractprintdialog.sip 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. // qabstractprintdialog.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_PrintDialog)
  22. class QAbstractPrintDialog : public QDialog
  23. {
  24. %TypeHeaderCode
  25. #include <qabstractprintdialog.h>
  26. %End
  27. %ConvertToSubClassCode
  28. static struct class_graph {
  29. const char *name;
  30. sipTypeDef **type;
  31. int yes, no;
  32. } graph[] = {
  33. #if defined(SIP_FEATURE_PyQt_PrintDialog)
  34. {sipName_QPageSetupDialog, &sipType_QPageSetupDialog, -1, 1},
  35. #else
  36. {0, 0, -1, 1},
  37. #endif
  38. #if defined(SIP_FEATURE_PyQt_PrintPreviewWidget)
  39. {sipName_QPrintPreviewWidget, &sipType_QPrintPreviewWidget, -1, 2},
  40. #else
  41. {0, 0, -1, 2},
  42. #endif
  43. #if defined(SIP_FEATURE_PyQt_PrintPreviewDialog)
  44. {sipName_QPrintPreviewDialog, &sipType_QPrintPreviewDialog, -1, 3},
  45. #else
  46. {0, 0, -1, 3},
  47. #endif
  48. #if defined(SIP_FEATURE_PyQt_Printer)
  49. {sipName_QAbstractPrintDialog, &sipType_QAbstractPrintDialog, 4, -1},
  50. #else
  51. {0, 0, 4, -1},
  52. #endif
  53. #if defined(SIP_FEATURE_PyQt_PrintDialog)
  54. {sipName_QPrintDialog, &sipType_QPrintDialog, -1, -1},
  55. #else
  56. {0, 0, -1, -1},
  57. #endif
  58. };
  59. int i = 0;
  60. sipType = NULL;
  61. do
  62. {
  63. struct class_graph *cg = &graph[i];
  64. if (cg->name != NULL && sipCpp->inherits(cg->name))
  65. {
  66. sipType = *cg->type;
  67. i = cg->yes;
  68. }
  69. else
  70. i = cg->no;
  71. }
  72. while (i >= 0);
  73. %End
  74. public:
  75. enum PrintRange
  76. {
  77. AllPages,
  78. Selection,
  79. PageRange,
  80. CurrentPage,
  81. };
  82. enum PrintDialogOption /BaseType=Flag/
  83. {
  84. PrintToFile,
  85. PrintSelection,
  86. PrintPageRange,
  87. PrintCollateCopies,
  88. PrintShowPageSize,
  89. PrintCurrentPage,
  90. };
  91. typedef QFlags<QAbstractPrintDialog::PrintDialogOption> PrintDialogOptions;
  92. QAbstractPrintDialog(QPrinter *printer, QWidget *parent /TransferThis/ = 0);
  93. virtual ~QAbstractPrintDialog();
  94. void setPrintRange(QAbstractPrintDialog::PrintRange range);
  95. QAbstractPrintDialog::PrintRange printRange() const;
  96. void setMinMax(int min, int max);
  97. int minPage() const;
  98. int maxPage() const;
  99. void setFromTo(int fromPage, int toPage);
  100. int fromPage() const;
  101. int toPage() const;
  102. QPrinter *printer() const;
  103. void setOptionTabs(const QList<QWidget *> &tabs);
  104. };
  105. %End
  106. %ModuleHeaderCode
  107. // Imports from QtCore.
  108. typedef sipErrorState (*pyqt6_qtprintsupport_get_connection_parts_t)(PyObject *, QObject *, const char *, bool, QObject **, QByteArray &);
  109. extern pyqt6_qtprintsupport_get_connection_parts_t pyqt6_qtprintsupport_get_connection_parts;
  110. %End
  111. %ModuleCode
  112. // Imports from QtCore.
  113. pyqt6_qtprintsupport_get_connection_parts_t pyqt6_qtprintsupport_get_connection_parts;
  114. %End
  115. %PostInitialisationCode
  116. // Imports from QtCore.
  117. pyqt6_qtprintsupport_get_connection_parts = (pyqt6_qtprintsupport_get_connection_parts_t)sipImportSymbol("pyqt6_get_connection_parts");
  118. Q_ASSERT(pyqt6_qtprintsupport_get_connection_parts);
  119. %End