qtextoption.sip 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. // qtextoption.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtGui 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 QTextOption
  22. {
  23. %TypeHeaderCode
  24. #include <qtextoption.h>
  25. %End
  26. public:
  27. QTextOption();
  28. QTextOption(Qt::Alignment alignment);
  29. ~QTextOption();
  30. QTextOption(const QTextOption &o);
  31. Qt::Alignment alignment() const;
  32. void setTextDirection(Qt::LayoutDirection aDirection);
  33. Qt::LayoutDirection textDirection() const;
  34. enum WrapMode
  35. {
  36. NoWrap,
  37. WordWrap,
  38. ManualWrap,
  39. WrapAnywhere,
  40. WrapAtWordBoundaryOrAnywhere,
  41. };
  42. void setWrapMode(QTextOption::WrapMode wrap);
  43. QTextOption::WrapMode wrapMode() const;
  44. enum Flag /BaseType=Flag/
  45. {
  46. IncludeTrailingSpaces,
  47. ShowTabsAndSpaces,
  48. ShowLineAndParagraphSeparators,
  49. AddSpaceForLineAndParagraphSeparators,
  50. SuppressColors,
  51. ShowDocumentTerminator,
  52. %If (Qt_6_9_0 -)
  53. ShowDefaultIgnorables,
  54. %End
  55. %If (Qt_6_9_0 -)
  56. DisableEmojiParsing,
  57. %End
  58. };
  59. typedef QFlags<QTextOption::Flag> Flags;
  60. QTextOption::Flags flags() const;
  61. void setTabArray(const QList<qreal> &tabStops);
  62. QList<qreal> tabArray() const;
  63. void setUseDesignMetrics(bool b);
  64. bool useDesignMetrics() const;
  65. void setAlignment(Qt::Alignment aalignment);
  66. void setFlags(QTextOption::Flags flags);
  67. enum TabType
  68. {
  69. LeftTab,
  70. RightTab,
  71. CenterTab,
  72. DelimiterTab,
  73. };
  74. struct Tab
  75. {
  76. %TypeHeaderCode
  77. #include <qtextoption.h>
  78. %End
  79. Tab();
  80. Tab(qreal pos, QTextOption::TabType tabType, QChar delim = QChar());
  81. bool operator==(const QTextOption::Tab &other) const;
  82. bool operator!=(const QTextOption::Tab &other) const;
  83. qreal position;
  84. QTextOption::TabType type;
  85. QChar delimiter;
  86. };
  87. void setTabs(const QList<QTextOption::Tab> &tabStops);
  88. QList<QTextOption::Tab> tabs() const;
  89. void setTabStopDistance(qreal tabStopDistance);
  90. qreal tabStopDistance() const;
  91. };