qpdfview.sip 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. // qpdfview.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtPdfWidgets 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. class QPdfView : public QAbstractScrollArea
  22. {
  23. %TypeHeaderCode
  24. #include <qpdfview.h>
  25. %End
  26. %ConvertToSubClassCode
  27. static struct class_graph {
  28. const char *name;
  29. sipTypeDef **type;
  30. int yes, no;
  31. } graph[] = {
  32. #if QT_VERSION >= 0x060600
  33. {sipName_QPdfPageSelector, &sipType_QPdfPageSelector, -1, 1},
  34. #else
  35. {0, 0, -1, 1},
  36. #endif
  37. {sipName_QPdfView, &sipType_QPdfView, -1, -1},
  38. };
  39. int i = 0;
  40. sipType = NULL;
  41. do
  42. {
  43. struct class_graph *cg = &graph[i];
  44. if (cg->name != NULL && sipCpp->inherits(cg->name))
  45. {
  46. sipType = *cg->type;
  47. i = cg->yes;
  48. }
  49. else
  50. i = cg->no;
  51. }
  52. while (i >= 0);
  53. %End
  54. public:
  55. enum class PageMode
  56. {
  57. SinglePage,
  58. MultiPage,
  59. };
  60. enum class ZoomMode
  61. {
  62. Custom,
  63. FitToWidth,
  64. FitInView,
  65. };
  66. explicit QPdfView(QWidget *parent /TransferThis/);
  67. virtual ~QPdfView();
  68. void setDocument(QPdfDocument *document);
  69. QPdfDocument *document() const;
  70. QPdfPageNavigator *pageNavigator() const;
  71. QPdfView::PageMode pageMode() const;
  72. QPdfView::ZoomMode zoomMode() const;
  73. qreal zoomFactor() const;
  74. int pageSpacing() const;
  75. void setPageSpacing(int spacing);
  76. QMargins documentMargins() const;
  77. void setDocumentMargins(QMargins margins);
  78. public slots:
  79. void setPageMode(QPdfView::PageMode mode);
  80. void setZoomMode(QPdfView::ZoomMode mode);
  81. void setZoomFactor(qreal factor);
  82. signals:
  83. void documentChanged(QPdfDocument *document);
  84. void pageModeChanged(QPdfView::PageMode pageMode);
  85. void zoomModeChanged(QPdfView::ZoomMode zoomMode);
  86. void zoomFactorChanged(qreal zoomFactor);
  87. void pageSpacingChanged(int pageSpacing);
  88. void documentMarginsChanged(QMargins documentMargins);
  89. protected:
  90. virtual void paintEvent(QPaintEvent *event);
  91. virtual void resizeEvent(QResizeEvent *event);
  92. virtual void scrollContentsBy(int dx, int dy);
  93. public:
  94. %If (Qt_6_6_0 -)
  95. QPdfSearchModel *searchModel() const;
  96. %End
  97. %If (Qt_6_6_0 -)
  98. void setSearchModel(QPdfSearchModel *searchModel /KeepReference/);
  99. %End
  100. %If (Qt_6_6_0 -)
  101. int currentSearchResultIndex() const;
  102. %End
  103. public slots:
  104. %If (Qt_6_6_0 -)
  105. void setCurrentSearchResultIndex(int currentResult);
  106. %End
  107. signals:
  108. %If (Qt_6_6_0 -)
  109. void searchModelChanged(QPdfSearchModel *searchModel);
  110. %End
  111. %If (Qt_6_6_0 -)
  112. void currentSearchResultIndexChanged(int currentResult);
  113. %End
  114. protected:
  115. %If (Qt_6_6_0 -)
  116. virtual void mousePressEvent(QMouseEvent *event);
  117. %End
  118. %If (Qt_6_6_0 -)
  119. virtual void mouseMoveEvent(QMouseEvent *event);
  120. %End
  121. %If (Qt_6_6_0 -)
  122. virtual void mouseReleaseEvent(QMouseEvent *event);
  123. %End
  124. };