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.textformat; 13 extern(C++): 14 15 import qt.config; 16 import qt.core.flags; 17 import qt.core.global; 18 import qt.core.list; 19 import qt.core.map; 20 import qt.core.metamacros; 21 import qt.core.namespace; 22 import qt.core.shareddata; 23 import qt.core.string; 24 import qt.core.stringlist; 25 import qt.core.typeinfo; 26 import qt.core.variant; 27 import qt.gui.brush; 28 import qt.gui.color; 29 import qt.gui.font; 30 import qt.gui.pen; 31 import qt.gui.textoption; 32 import qt.helpers; 33 34 35 extern(C++, class) struct QTextFormatPrivate; 36 37 /+ #ifndef QT_NO_DATASTREAM 38 Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QTextLength &); 39 Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QTextLength &); 40 #endif 41 42 #ifndef QT_NO_DEBUG_STREAM 43 Q_GUI_EXPORT QDebug operator<<(QDebug, const QTextLength &); 44 #endif +/ 45 46 /// Binding for C++ class [QTextLength](https://doc.qt.io/qt-6/qtextlength.html). 47 @Q_PRIMITIVE_TYPE extern(C++, class) struct /+ Q_GUI_EXPORT +/ QTextLength 48 { 49 public: 50 enum Type { VariableLength = 0, FixedLength, PercentageLength } 51 52 /+pragma(inline, true) this() 53 { 54 this.lengthType = Type.VariableLength; 55 this.fixedValueOrPercentage = 0; 56 }+/ 57 58 /+ explicit +/pragma(inline, true) this(Type atype, qreal avalue) 59 { 60 this.lengthType = atype; 61 this.fixedValueOrPercentage = avalue; 62 } 63 64 pragma(inline, true) Type type() const { return lengthType; } 65 pragma(inline, true) qreal value(qreal maximumLength) const 66 { 67 switch (lengthType) { 68 case Type.FixedLength: return fixedValueOrPercentage; 69 case Type.VariableLength: return maximumLength; 70 case Type.PercentageLength: return fixedValueOrPercentage * maximumLength / qreal(100);default: 71 72 } 73 return -1; 74 } 75 76 pragma(inline, true) qreal rawValue() const { return fixedValueOrPercentage; } 77 78 /+pragma(inline, true) bool operator ==(ref const(QTextLength) other) const 79 { return lengthType == other.lengthType 80 && qFuzzyCompare(fixedValueOrPercentage, other.fixedValueOrPercentage); }+/ 81 /+pragma(inline, true) bool operator !=(ref const(QTextLength) other) const 82 { return lengthType != other.lengthType 83 || !qFuzzyCompare(fixedValueOrPercentage, other.fixedValueOrPercentage); }+/ 84 /+auto opCast(T : QVariant)() const;+/ 85 86 private: 87 Type lengthType = Type.VariableLength; 88 qreal fixedValueOrPercentage = 0; 89 /+ friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QTextLength &); +/ 90 /+ friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QTextLength &); +/ 91 mixin(CREATE_CONVENIENCE_WRAPPERS); 92 } 93 /+ Q_DECLARE_TYPEINFO(QTextLength, Q_PRIMITIVE_TYPE); 94 95 #ifndef QT_NO_DATASTREAM 96 Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QTextFormat &); 97 Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QTextFormat &); 98 #endif 99 100 #ifndef QT_NO_DEBUG_STREAM 101 Q_GUI_EXPORT QDebug operator<<(QDebug, const QTextFormat &); 102 #endif +/ 103 104 /// Binding for C++ class [QTextFormat](https://doc.qt.io/qt-6/qtextformat.html). 105 @Q_RELOCATABLE_TYPE extern(C++, class) struct /+ Q_GUI_EXPORT +/ QTextFormat 106 { 107 mixin(Q_GADGET); 108 public: 109 enum FormatType { 110 InvalidFormat = -1, 111 BlockFormat = 1, 112 CharFormat = 2, 113 ListFormat = 3, 114 FrameFormat = 5, 115 116 UserFormat = 100 117 } 118 /+ Q_ENUM(FormatType) +/ 119 120 enum Property { 121 ObjectIndex = 0x0, 122 123 // paragraph and char 124 CssFloat = 0x0800, 125 LayoutDirection = 0x0801, 126 127 OutlinePen = 0x810, 128 BackgroundBrush = 0x820, 129 ForegroundBrush = 0x821, 130 // Internal to qtextlayout.cpp: ObjectSelectionBrush = 0x822 131 BackgroundImageUrl = 0x823, 132 133 // paragraph 134 BlockAlignment = 0x1010, 135 BlockTopMargin = 0x1030, 136 BlockBottomMargin = 0x1031, 137 BlockLeftMargin = 0x1032, 138 BlockRightMargin = 0x1033, 139 TextIndent = 0x1034, 140 TabPositions = 0x1035, 141 BlockIndent = 0x1040, 142 LineHeight = 0x1048, 143 LineHeightType = 0x1049, 144 BlockNonBreakableLines = 0x1050, 145 BlockTrailingHorizontalRulerWidth = 0x1060, 146 HeadingLevel = 0x1070, 147 BlockQuoteLevel = 0x1080, 148 BlockCodeLanguage = 0x1090, 149 BlockCodeFence = 0x1091, 150 BlockMarker = 0x10A0, 151 152 // character properties 153 FirstFontProperty = 0x1FE0, 154 FontCapitalization = Property.FirstFontProperty, 155 FontLetterSpacing = 0x1FE1, 156 FontWordSpacing = 0x1FE2, 157 FontStyleHint = 0x1FE3, 158 FontStyleStrategy = 0x1FE4, 159 FontKerning = 0x1FE5, 160 FontHintingPreference = 0x1FE6, 161 FontFamilies = 0x1FE7, 162 FontStyleName = 0x1FE8, 163 FontLetterSpacingType = 0x1FE9, 164 FontStretch = 0x1FEA, 165 /+ #if QT_DEPRECATED_SINCE(6, 0) +/ 166 FontFamily = 0x2000, 167 /+ #endif +/ 168 FontPointSize = 0x2001, 169 FontSizeAdjustment = 0x2002, 170 FontSizeIncrement = Property.FontSizeAdjustment, // old name, compat 171 FontWeight = 0x2003, 172 FontItalic = 0x2004, 173 FontUnderline = 0x2005, // deprecated, use TextUnderlineStyle instead 174 FontOverline = 0x2006, 175 FontStrikeOut = 0x2007, 176 FontFixedPitch = 0x2008, 177 FontPixelSize = 0x2009, 178 LastFontProperty = Property.FontPixelSize, 179 180 TextUnderlineColor = 0x2020, 181 TextVerticalAlignment = 0x2021, 182 TextOutline = 0x2022, 183 TextUnderlineStyle = 0x2023, 184 TextToolTip = 0x2024, 185 TextSuperScriptBaseline = 0x2025, 186 TextSubScriptBaseline = 0x2026, 187 TextBaselineOffset = 0x2027, 188 189 IsAnchor = 0x2030, 190 AnchorHref = 0x2031, 191 AnchorName = 0x2032, 192 193 // Included for backwards compatibility with old QDataStreams. 194 // Should not be referenced in user code. 195 OldFontLetterSpacingType = 0x2033, 196 OldFontStretch = 0x2034, 197 OldTextUnderlineColor = 0x2010, 198 199 ObjectType = 0x2f00, 200 201 // list properties 202 ListStyle = 0x3000, 203 ListIndent = 0x3001, 204 ListNumberPrefix = 0x3002, 205 ListNumberSuffix = 0x3003, 206 207 // table and frame properties 208 FrameBorder = 0x4000, 209 FrameMargin = 0x4001, 210 FramePadding = 0x4002, 211 FrameWidth = 0x4003, 212 FrameHeight = 0x4004, 213 FrameTopMargin = 0x4005, 214 FrameBottomMargin = 0x4006, 215 FrameLeftMargin = 0x4007, 216 FrameRightMargin = 0x4008, 217 FrameBorderBrush = 0x4009, 218 FrameBorderStyle = 0x4010, 219 220 TableColumns = 0x4100, 221 TableColumnWidthConstraints = 0x4101, 222 TableCellSpacing = 0x4102, 223 TableCellPadding = 0x4103, 224 TableHeaderRowCount = 0x4104, 225 TableBorderCollapse = 0x4105, 226 227 // table cell properties 228 TableCellRowSpan = 0x4810, 229 TableCellColumnSpan = 0x4811, 230 231 TableCellTopPadding = 0x4812, 232 TableCellBottomPadding = 0x4813, 233 TableCellLeftPadding = 0x4814, 234 TableCellRightPadding = 0x4815, 235 236 TableCellTopBorder = 0x4816, 237 TableCellBottomBorder = 0x4817, 238 TableCellLeftBorder = 0x4818, 239 TableCellRightBorder = 0x4819, 240 241 TableCellTopBorderStyle = 0x481a, 242 TableCellBottomBorderStyle = 0x481b, 243 TableCellLeftBorderStyle = 0x481c, 244 TableCellRightBorderStyle = 0x481d, 245 246 TableCellTopBorderBrush = 0x481e, 247 TableCellBottomBorderBrush = 0x481f, 248 TableCellLeftBorderBrush = 0x4820, 249 TableCellRightBorderBrush = 0x4821, 250 251 // image properties 252 ImageName = 0x5000, 253 ImageTitle = 0x5001, 254 ImageAltText = 0x5002, 255 ImageWidth = 0x5010, 256 ImageHeight = 0x5011, 257 ImageQuality = 0x5014, 258 259 // internal 260 /* 261 SuppressText = 0x5012, 262 SuppressBackground = 0x513 263 */ 264 265 // selection properties 266 FullWidthSelection = 0x06000, 267 268 // page break properties 269 PageBreakPolicy = 0x7000, 270 271 // -- 272 UserProperty = 0x100000 273 } 274 /+ Q_ENUM(Property) +/ 275 276 enum ObjectTypes { 277 NoObject, 278 ImageObject, 279 TableObject, 280 TableCellObject, 281 282 UserObject = 0x1000 283 } 284 /+ Q_ENUM(ObjectTypes) +/ 285 286 enum PageBreakFlag { 287 PageBreak_Auto = 0, 288 PageBreak_AlwaysBefore = 0x001, 289 PageBreak_AlwaysAfter = 0x010 290 // PageBreak_AlwaysInside = 0x100 291 } 292 /+ Q_DECLARE_FLAGS(PageBreakFlags, PageBreakFlag) +/ 293 alias PageBreakFlags = QFlags!(PageBreakFlag); 294 /+this();+/ 295 296 /+ explicit +/this(int type) 297 { 298 format_type = type; 299 } 300 301 //@disable this(this); 302 //this(ref const(QTextFormat) rhs); 303 /+ref QTextFormat operator =(ref const(QTextFormat) rhs);+/ 304 ~this(); 305 306 /+ void swap(QTextFormat &other) 307 { qSwap(d, other.d); qSwap(format_type, other.format_type); } +/ 308 309 void merge(ref const(QTextFormat) other); 310 311 pragma(inline, true) bool isValid() const { return type() != FormatType.InvalidFormat; } 312 pragma(inline, true) bool isEmpty() const { return propertyCount() == 0; } 313 314 int type() const; 315 316 int objectIndex() const; 317 void setObjectIndex(int object); 318 319 QVariant property(int propertyId) const; 320 void setProperty(int propertyId, ref const(QVariant) value); 321 void setProperty(T)(int propertyId, T value) 322 { 323 static if(is(T==enum)) 324 QVariant v = QVariant(cast(int)value); 325 else 326 QVariant v = QVariant.fromValue(value); 327 setProperty(propertyId, v); 328 } 329 void clearProperty(int propertyId); 330 bool hasProperty(int propertyId) const; 331 332 bool boolProperty(int propertyId) const; 333 int intProperty(int propertyId) const; 334 qreal doubleProperty(int propertyId) const; 335 QString stringProperty(int propertyId) const; 336 QColor colorProperty(int propertyId) const; 337 QPen penProperty(int propertyId) const; 338 QBrush brushProperty(int propertyId) const; 339 QTextLength lengthProperty(int propertyId) const; 340 QList!(QTextLength) lengthVectorProperty(int propertyId) const; 341 342 void setProperty(int propertyId, ref const(QList!(QTextLength)) lengths); 343 344 // QMap!(int, QVariant) properties() const; 345 int propertyCount() const; 346 347 pragma(inline, true) void setObjectType(int atype) 348 { setProperty(Property.ObjectType, atype); } 349 pragma(inline, true) int objectType() const 350 { return intProperty(Property.ObjectType); } 351 352 pragma(inline, true) bool isCharFormat() const { return type() == FormatType.CharFormat; } 353 pragma(inline, true) bool isBlockFormat() const { return type() == FormatType.BlockFormat; } 354 pragma(inline, true) bool isListFormat() const { return type() == FormatType.ListFormat; } 355 pragma(inline, true) bool isFrameFormat() const { return type() == FormatType.FrameFormat; } 356 pragma(inline, true) bool isImageFormat() const { return type() == FormatType.CharFormat && objectType() == ObjectTypes.ImageObject; } 357 pragma(inline, true) bool isTableFormat() const { return type() == FormatType.FrameFormat && objectType() == ObjectTypes.TableObject; } 358 pragma(inline, true) bool isTableCellFormat() const { return type() == FormatType.CharFormat && objectType() == ObjectTypes.TableCellObject; } 359 360 QTextBlockFormat toBlockFormat() const; 361 QTextCharFormat toCharFormat() const; 362 QTextListFormat toListFormat() const; 363 QTextTableFormat toTableFormat() const; 364 QTextFrameFormat toFrameFormat() const; 365 QTextImageFormat toImageFormat() const; 366 QTextTableCellFormat toTableCellFormat() const; 367 368 /+bool operator ==(ref const(QTextFormat) rhs) const;+/ 369 /+pragma(inline, true) bool operator !=(ref const(QTextFormat) rhs) const { return !operator==(rhs); }+/ 370 /+auto opCast(T : QVariant)() const;+/ 371 372 pragma(inline, true) void setLayoutDirection(/+ Qt:: +/qt.core.namespace.LayoutDirection direction) 373 { setProperty(QTextFormat.Property.LayoutDirection, direction); } 374 pragma(inline, true) /+ Qt:: +/qt.core.namespace.LayoutDirection layoutDirection() const 375 { return cast(/+ Qt:: +/qt.core.namespace.LayoutDirection)(intProperty(QTextFormat.Property.LayoutDirection)); } 376 377 /* pragma(inline, true) void setBackground(ref const(QBrush) brush) 378 { setProperty(Property.BackgroundBrush, brush); }*/ 379 pragma(inline, true) QBrush background() const 380 { return brushProperty(Property.BackgroundBrush); } 381 pragma(inline, true) void clearBackground() 382 { clearProperty(Property.BackgroundBrush); } 383 384 /+ pragma(inline, true) void setForeground(ref const(QBrush) brush) 385 { setProperty(Property.ForegroundBrush, brush); }+/ 386 pragma(inline, true) QBrush foreground() const 387 { return brushProperty(Property.ForegroundBrush); } 388 pragma(inline, true) void clearForeground() 389 { clearProperty(Property.ForegroundBrush); } 390 391 private: 392 QSharedDataPointer!(QTextFormatPrivate) d; 393 qint32 format_type = FormatType.InvalidFormat; 394 395 /+ friend class QTextFormatCollection; +/ 396 /+ friend class QTextCharFormat; +/ 397 /+ friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QTextFormat &); +/ 398 /+ friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QTextFormat &); +/ 399 mixin(CREATE_CONVENIENCE_WRAPPERS); 400 } 401 402 /+ Q_DECLARE_SHARED(QTextFormat) +/ 403 /+pragma(inline, true) QFlags!(QTextFormat.PageBreakFlags.enum_type) operator |(QTextFormat.PageBreakFlags.enum_type f1, QTextFormat.PageBreakFlags.enum_type f2)/+noexcept+/{return QFlags!(QTextFormat.PageBreakFlags.enum_type)(f1)|f2;}+/ 404 /+pragma(inline, true) QFlags!(QTextFormat.PageBreakFlags.enum_type) operator |(QTextFormat.PageBreakFlags.enum_type f1, QFlags!(QTextFormat.PageBreakFlags.enum_type) f2)/+noexcept+/{return f2|f1;}+/ 405 /+pragma(inline, true) QFlags!(QTextFormat.PageBreakFlags.enum_type) operator &(QTextFormat.PageBreakFlags.enum_type f1, QTextFormat.PageBreakFlags.enum_type f2)/+noexcept+/{return QFlags!(QTextFormat.PageBreakFlags.enum_type)(f1)&f2;}+/ 406 /+pragma(inline, true) QFlags!(QTextFormat.PageBreakFlags.enum_type) operator &(QTextFormat.PageBreakFlags.enum_type f1, QFlags!(QTextFormat.PageBreakFlags.enum_type) f2)/+noexcept+/{return f2&f1;}+/ 407 /+pragma(inline, true) void operator +(QTextFormat.PageBreakFlags.enum_type f1, QTextFormat.PageBreakFlags.enum_type f2)/+noexcept+/;+/ 408 /+pragma(inline, true) void operator +(QTextFormat.PageBreakFlags.enum_type f1, QFlags!(QTextFormat.PageBreakFlags.enum_type) f2)/+noexcept+/;+/ 409 /+pragma(inline, true) void operator +(int f1, QFlags!(QTextFormat.PageBreakFlags.enum_type) f2)/+noexcept+/;+/ 410 /+pragma(inline, true) void operator -(QTextFormat.PageBreakFlags.enum_type f1, QTextFormat.PageBreakFlags.enum_type f2)/+noexcept+/;+/ 411 /+pragma(inline, true) void operator -(QTextFormat.PageBreakFlags.enum_type f1, QFlags!(QTextFormat.PageBreakFlags.enum_type) f2)/+noexcept+/;+/ 412 /+pragma(inline, true) void operator -(int f1, QFlags!(QTextFormat.PageBreakFlags.enum_type) f2)/+noexcept+/;+/ 413 /+pragma(inline, true) QIncompatibleFlag operator |(QTextFormat.PageBreakFlags.enum_type f1, int f2)/+noexcept+/{return QIncompatibleFlag(int(f1)|f2);}+/ 414 /+pragma(inline, true) void operator +(int f1, QTextFormat.PageBreakFlags.enum_type f2)/+noexcept+/;+/ 415 /+pragma(inline, true) void operator +(QTextFormat.PageBreakFlags.enum_type f1, int f2)/+noexcept+/;+/ 416 /+pragma(inline, true) void operator -(int f1, QTextFormat.PageBreakFlags.enum_type f2)/+noexcept+/;+/ 417 /+pragma(inline, true) void operator -(QTextFormat.PageBreakFlags.enum_type f1, int f2)/+noexcept+/;+/ 418 419 /+ Q_DECLARE_OPERATORS_FOR_FLAGS(QTextFormat::PageBreakFlags) +/ 420 /// Binding for C++ class [QTextCharFormat](https://doc.qt.io/qt-6/qtextcharformat.html). 421 @Q_RELOCATABLE_TYPE extern(C++, class) struct /+ Q_GUI_EXPORT +/ QTextCharFormat 422 { 423 public QTextFormat base0 = QTextFormat(QTextFormat.FormatType.CharFormat); 424 alias base0 this; 425 public: 426 enum VerticalAlignment { 427 AlignNormal = 0, 428 AlignSuperScript, 429 AlignSubScript, 430 AlignMiddle, 431 AlignTop, 432 AlignBottom, 433 AlignBaseline 434 } 435 enum UnderlineStyle { // keep in sync with Qt::PenStyle! 436 NoUnderline, 437 SingleUnderline, 438 DashUnderline, 439 DotLine, 440 DashDotLine, 441 DashDotDotLine, 442 WaveUnderline, 443 SpellCheckUnderline 444 } 445 446 /+this();+/ 447 448 bool isValid() const { return isCharFormat(); } 449 450 enum FontPropertiesInheritanceBehavior { 451 FontPropertiesSpecifiedOnly, 452 FontPropertiesAll 453 } 454 void setFont(ref const(QFont) font, FontPropertiesInheritanceBehavior behavior = FontPropertiesInheritanceBehavior.FontPropertiesAll); 455 QFont font() const; 456 457 /+ #if QT_DEPRECATED_SINCE(6, 1) +/ 458 /+ /+ QT_DEPRECATED_VERSION_X_6_1("Use setFontFamilies instead") +/ pragma(inline, true) void setFontFamily(ref const(QString) family) 459 { auto tmp = QVariant(QStringList(family)); setProperty(Property.FontFamilies, tmp); } 460 /+ QT_DEPRECATED_VERSION_X_6_1("Use fontFamilies instead") +/ pragma(inline, true) QString fontFamily() const 461 { return property(Property.FontFamilies).toStringList().first(); } +/ 462 /+ #endif +/ 463 464 pragma(inline, true) void setFontFamilies(ref const(QStringList) families) 465 { auto tmp = QVariant(families); setProperty(Property.FontFamilies, tmp); } 466 pragma(inline, true) QVariant fontFamilies() const 467 { return property(Property.FontFamilies); } 468 469 pragma(inline, true) void setFontStyleName(ref const(QString) styleName) 470 { setProperty(Property.FontStyleName, styleName); } 471 pragma(inline, true) QVariant fontStyleName() const 472 { return property(Property.FontStyleName); } 473 474 pragma(inline, true) void setFontPointSize(qreal size) 475 { setProperty(Property.FontPointSize, size); } 476 pragma(inline, true) qreal fontPointSize() const 477 { return doubleProperty(Property.FontPointSize); } 478 479 pragma(inline, true) void setFontWeight(int weight) 480 { setProperty(Property.FontWeight, weight); } 481 pragma(inline, true) int fontWeight() const 482 { return hasProperty(Property.FontWeight) ? intProperty(Property.FontWeight) : QFont.Weight.Normal; } 483 pragma(inline, true) void setFontItalic(bool italic) 484 { setProperty(Property.FontItalic, italic); } 485 pragma(inline, true) bool fontItalic() const 486 { return boolProperty(Property.FontItalic); } 487 pragma(inline, true) void setFontCapitalization(QFont.Capitalization capitalization) 488 { setProperty(Property.FontCapitalization, capitalization); } 489 pragma(inline, true) QFont.Capitalization fontCapitalization() const 490 { return static_cast!(QFont.Capitalization)(intProperty(Property.FontCapitalization)); } 491 pragma(inline, true) void setFontLetterSpacingType(QFont.SpacingType letterSpacingType) 492 { setProperty(Property.FontLetterSpacingType, letterSpacingType); } 493 pragma(inline, true) QFont.SpacingType fontLetterSpacingType() const 494 { return static_cast!(QFont.SpacingType)(intProperty(Property.FontLetterSpacingType)); } 495 pragma(inline, true) void setFontLetterSpacing(qreal spacing) 496 { setProperty(Property.FontLetterSpacing, spacing); } 497 pragma(inline, true) qreal fontLetterSpacing() const 498 { return doubleProperty(Property.FontLetterSpacing); } 499 pragma(inline, true) void setFontWordSpacing(qreal spacing) 500 { setProperty(Property.FontWordSpacing, spacing); } 501 pragma(inline, true) qreal fontWordSpacing() const 502 { return doubleProperty(Property.FontWordSpacing); } 503 504 pragma(inline, true) void setFontUnderline(bool underline) 505 { setProperty(Property.TextUnderlineStyle, underline ? UnderlineStyle.SingleUnderline : UnderlineStyle.NoUnderline); } 506 bool fontUnderline() const; 507 508 pragma(inline, true) void setFontOverline(bool overline) 509 { setProperty(Property.FontOverline, overline); } 510 pragma(inline, true) bool fontOverline() const 511 { return boolProperty(Property.FontOverline); } 512 513 pragma(inline, true) void setFontStrikeOut(bool strikeOut) 514 { setProperty(Property.FontStrikeOut, strikeOut); } 515 pragma(inline, true) bool fontStrikeOut() const 516 { return boolProperty(Property.FontStrikeOut); } 517 518 pragma(inline, true) void setUnderlineColor(ref const(QColor) color) 519 { setProperty(Property.TextUnderlineColor, color); } 520 pragma(inline, true) QColor underlineColor() const 521 { return colorProperty(Property.TextUnderlineColor); } 522 523 pragma(inline, true) void setFontFixedPitch(bool fixedPitch) 524 { setProperty(Property.FontFixedPitch, fixedPitch); } 525 pragma(inline, true) bool fontFixedPitch() const 526 { return boolProperty(Property.FontFixedPitch); } 527 528 pragma(inline, true) void setFontStretch(int factor) 529 { setProperty(Property.FontStretch, factor); } 530 pragma(inline, true) int fontStretch() const 531 { return intProperty(Property.FontStretch); } 532 533 pragma(inline, true) void setFontStyleHint(QFont.StyleHint hint, QFont.StyleStrategy strategy = QFont.StyleStrategy.PreferDefault) 534 { setProperty(Property.FontStyleHint, hint); setProperty(Property.FontStyleStrategy, strategy); } 535 pragma(inline, true) void setFontStyleStrategy(QFont.StyleStrategy strategy) 536 { setProperty(Property.FontStyleStrategy, strategy); } 537 QFont.StyleHint fontStyleHint() const 538 { return static_cast!(QFont.StyleHint)(intProperty(Property.FontStyleHint)); } 539 QFont.StyleStrategy fontStyleStrategy() const 540 { return static_cast!(QFont.StyleStrategy)(intProperty(Property.FontStyleStrategy)); } 541 542 pragma(inline, true) void setFontHintingPreference(QFont.HintingPreference hintingPreference) 543 { 544 setProperty(Property.FontHintingPreference, hintingPreference); 545 } 546 547 pragma(inline, true) QFont.HintingPreference fontHintingPreference() const 548 { 549 return static_cast!(QFont.HintingPreference)(intProperty(Property.FontHintingPreference)); 550 } 551 552 pragma(inline, true) void setFontKerning(bool enable) 553 { setProperty(Property.FontKerning, enable); } 554 pragma(inline, true) bool fontKerning() const 555 { return boolProperty(Property.FontKerning); } 556 557 void setUnderlineStyle(UnderlineStyle style); 558 pragma(inline, true) UnderlineStyle underlineStyle() const 559 { return static_cast!(UnderlineStyle)(intProperty(Property.TextUnderlineStyle)); } 560 561 pragma(inline, true) void setVerticalAlignment(VerticalAlignment alignment) 562 { setProperty(Property.TextVerticalAlignment, alignment); } 563 pragma(inline, true) VerticalAlignment verticalAlignment() const 564 { return static_cast!(VerticalAlignment)(intProperty(Property.TextVerticalAlignment)); } 565 566 /* pragma(inline, true) void setTextOutline(ref const(QPen) pen) 567 { setProperty(Property.TextOutline, pen); } 568 pragma(inline, true) QPen textOutline() const 569 { return penProperty(Property.TextOutline); }*/ 570 571 pragma(inline, true) void setToolTip(ref const(QString) tip) 572 { setProperty(Property.TextToolTip, tip); } 573 pragma(inline, true) QString toolTip() const 574 { return stringProperty(Property.TextToolTip); } 575 576 pragma(inline, true) void setSuperScriptBaseline(qreal baseline) 577 { setProperty(Property.TextSuperScriptBaseline, baseline); } 578 pragma(inline, true) qreal superScriptBaseline() const 579 { return hasProperty(Property.TextSuperScriptBaseline) ? doubleProperty(Property.TextSuperScriptBaseline) : 50.0; } 580 581 pragma(inline, true) void setSubScriptBaseline(qreal baseline) 582 { setProperty(Property.TextSubScriptBaseline, baseline); } 583 pragma(inline, true) qreal subScriptBaseline() const 584 { return hasProperty(Property.TextSubScriptBaseline) ? doubleProperty(Property.TextSubScriptBaseline) : 100.0 / 6.0; } 585 586 pragma(inline, true) void setBaselineOffset(qreal baseline) 587 { setProperty(Property.TextBaselineOffset, baseline); } 588 pragma(inline, true) qreal baselineOffset() const 589 { return hasProperty(Property.TextBaselineOffset) ? doubleProperty(Property.TextBaselineOffset) : 0.0; } 590 591 pragma(inline, true) void setAnchor(bool anchor) 592 { setProperty(Property.IsAnchor, anchor); } 593 pragma(inline, true) bool isAnchor() const 594 { return boolProperty(Property.IsAnchor); } 595 596 pragma(inline, true) void setAnchorHref(ref const(QString) value) 597 { setProperty(Property.AnchorHref, value); } 598 pragma(inline, true) QString anchorHref() const 599 { return stringProperty(Property.AnchorHref); } 600 601 /+ pragma(inline, true) void setAnchorNames(ref const(QStringList) names) 602 { base0.setProperty!(const(QStringList))(Property.AnchorName, names); } 603 QStringList anchorNames() const;+/ 604 605 pragma(inline, true) void setTableCellRowSpan(int _tableCellRowSpan) 606 { 607 if (_tableCellRowSpan <= 1) 608 clearProperty(Property.TableCellRowSpan); // the getter will return 1 here. 609 else 610 setProperty(Property.TableCellRowSpan, _tableCellRowSpan); 611 } 612 pragma(inline, true) int tableCellRowSpan() const 613 { int s = intProperty(Property.TableCellRowSpan); if (s == 0) s = 1; return s; } 614 pragma(inline, true) void setTableCellColumnSpan(int _tableCellColumnSpan) 615 { 616 if (_tableCellColumnSpan <= 1) 617 clearProperty(Property.TableCellColumnSpan); // the getter will return 1 here. 618 else 619 setProperty(Property.TableCellColumnSpan, _tableCellColumnSpan); 620 } 621 pragma(inline, true) int tableCellColumnSpan() const 622 { int s = intProperty(Property.TableCellColumnSpan); if (s == 0) s = 1; return s; } 623 624 protected: 625 /+ explicit +/this(ref const(QTextFormat) fmt); 626 /+ friend class QTextFormat; +/ 627 mixin(CREATE_CONVENIENCE_WRAPPERS); 628 } 629 630 /+ Q_DECLARE_SHARED(QTextCharFormat) +/ 631 632 /// Binding for C++ class [QTextBlockFormat](https://doc.qt.io/qt-6/qtextblockformat.html). 633 @Q_RELOCATABLE_TYPE extern(C++, class) struct /+ Q_GUI_EXPORT +/ QTextBlockFormat 634 { 635 public QTextFormat base0 = QTextFormat(QTextFormat.FormatType.BlockFormat); 636 alias base0 this; 637 alias PageBreakFlags = QTextFormat.PageBreakFlags; 638 public: 639 enum LineHeightTypes { 640 SingleHeight = 0, 641 ProportionalHeight = 1, 642 FixedHeight = 2, 643 MinimumHeight = 3, 644 LineDistanceHeight = 4 645 } 646 647 enum /+ class +/ MarkerType { 648 NoMarker = 0, 649 Unchecked = 1, 650 Checked = 2 651 } 652 653 @disable this(); 654 /+this();+/ 655 656 bool isValid() const { return isBlockFormat(); } 657 658 pragma(inline, true) void setAlignment(/+ Qt:: +/qt.core.namespace.Alignment aalignment) 659 { auto tmp = cast(int)(aalignment); setProperty(Property.BlockAlignment, tmp); } 660 pragma(inline, true) /+ Qt:: +/qt.core.namespace.Alignment alignment() const 661 { int a = intProperty(Property.BlockAlignment); if (a == 0) a = /+ Qt:: +/qt.core.namespace.AlignmentFlag.AlignLeft; return qt.core.namespace.Alignment(QFlag(a)); } 662 663 pragma(inline, true) void setTopMargin(qreal margin) 664 { setProperty(Property.BlockTopMargin, margin); } 665 pragma(inline, true) qreal topMargin() const 666 { return doubleProperty(Property.BlockTopMargin); } 667 668 pragma(inline, true) void setBottomMargin(qreal margin) 669 { setProperty(Property.BlockBottomMargin, margin); } 670 pragma(inline, true) qreal bottomMargin() const 671 { return doubleProperty(Property.BlockBottomMargin); } 672 673 pragma(inline, true) void setLeftMargin(qreal margin) 674 { setProperty(Property.BlockLeftMargin, margin); } 675 pragma(inline, true) qreal leftMargin() const 676 { return doubleProperty(Property.BlockLeftMargin); } 677 678 pragma(inline, true) void setRightMargin(qreal margin) 679 { setProperty(Property.BlockRightMargin, margin); } 680 pragma(inline, true) qreal rightMargin() const 681 { return doubleProperty(Property.BlockRightMargin); } 682 683 pragma(inline, true) void setTextIndent(qreal aindent) 684 { setProperty(Property.TextIndent, aindent); } 685 pragma(inline, true) qreal textIndent() const 686 { return doubleProperty(Property.TextIndent); } 687 688 pragma(inline, true) void setIndent(int aindent) 689 { setProperty(Property.BlockIndent, aindent); } 690 pragma(inline, true) int indent() const 691 { return intProperty(Property.BlockIndent); } 692 693 pragma(inline, true) void setHeadingLevel(int alevel) 694 { setProperty(Property.HeadingLevel, alevel); } 695 pragma(inline, true) int headingLevel() const 696 { return intProperty(Property.HeadingLevel); } 697 698 pragma(inline, true) void setLineHeight(qreal height, int heightType) 699 { setProperty(Property.LineHeight, height); setProperty(Property.LineHeightType, heightType); } 700 pragma(inline, true) qreal lineHeight(qreal scriptLineHeight, qreal scaling) const 701 /+pragma(inline, true) qreal lineHeight(qreal scriptLineHeight, qreal scaling = 1.0) const+/ 702 { 703 switch(intProperty(Property.LineHeightType)) { 704 case LineHeightTypes.SingleHeight: 705 return(scriptLineHeight); 706 case LineHeightTypes.ProportionalHeight: 707 return(scriptLineHeight * doubleProperty(Property.LineHeight) / 100.0); 708 case LineHeightTypes.FixedHeight: 709 return(doubleProperty(Property.LineHeight) * scaling); 710 case LineHeightTypes.MinimumHeight: 711 return(qMax(scriptLineHeight, doubleProperty(Property.LineHeight) * scaling)); 712 case LineHeightTypes.LineDistanceHeight: 713 return(scriptLineHeight + doubleProperty(Property.LineHeight) * scaling);default: 714 715 } 716 return(0); 717 } 718 719 pragma(inline, true) qreal lineHeight() const 720 { return doubleProperty(Property.LineHeight); } 721 pragma(inline, true) int lineHeightType() const 722 { return intProperty(Property.LineHeightType); } 723 724 pragma(inline, true) void setNonBreakableLines(bool b) 725 { setProperty(Property.BlockNonBreakableLines, b); } 726 pragma(inline, true) bool nonBreakableLines() const 727 { return boolProperty(Property.BlockNonBreakableLines); } 728 729 pragma(inline, true) void setPageBreakPolicy(PageBreakFlags flags) 730 { auto tmp = cast(int)(flags); setProperty(Property.PageBreakPolicy, tmp); } 731 pragma(inline, true) PageBreakFlags pageBreakPolicy() const 732 { return PageBreakFlags(cast(QFlag)(intProperty(Property.PageBreakPolicy))); } 733 734 void setTabPositions(ref const(QList!(QTextOption.Tab)) tabs); 735 QList!(QTextOption.Tab) tabPositions() const; 736 737 pragma(inline, true) void setMarker(MarkerType marker) 738 { auto tmp = int(marker); setProperty(Property.BlockMarker, tmp); } 739 pragma(inline, true) MarkerType marker() const 740 { return cast(MarkerType)(intProperty(Property.BlockMarker)); } 741 742 protected: 743 /+ explicit +/this(ref const(QTextFormat) fmt); 744 /+ friend class QTextFormat; +/ 745 mixin(CREATE_CONVENIENCE_WRAPPERS); 746 } 747 748 /+ Q_DECLARE_SHARED(QTextBlockFormat) +/ 749 750 /// Binding for C++ class [QTextListFormat](https://doc.qt.io/qt-6/qtextlistformat.html). 751 @Q_RELOCATABLE_TYPE extern(C++, class) struct /+ Q_GUI_EXPORT +/ QTextListFormat 752 { 753 public QTextFormat base0 = QTextFormat(QTextFormat.FormatType.ListFormat); 754 alias base0 this; 755 public: 756 /+this();+/ 757 758 bool isValid() const { return isListFormat(); } 759 760 enum Style { 761 ListDisc = -1, 762 ListCircle = -2, 763 ListSquare = -3, 764 ListDecimal = -4, 765 ListLowerAlpha = -5, 766 ListUpperAlpha = -6, 767 ListLowerRoman = -7, 768 ListUpperRoman = -8, 769 ListStyleUndefined = 0 770 } 771 772 pragma(inline, true) void setStyle(Style astyle) 773 { setProperty(Property.ListStyle, astyle); } 774 pragma(inline, true) Style style() const 775 { return static_cast!(Style)(intProperty(Property.ListStyle)); } 776 777 pragma(inline, true) void setIndent(int aindent) 778 { setProperty(Property.ListIndent, aindent); } 779 pragma(inline, true) int indent() const 780 { return intProperty(Property.ListIndent); } 781 782 pragma(inline, true) void setNumberPrefix(ref const(QString) np) 783 { setProperty(Property.ListNumberPrefix, np); } 784 pragma(inline, true) QString numberPrefix() const 785 { return stringProperty(Property.ListNumberPrefix); } 786 787 pragma(inline, true) void setNumberSuffix(ref const(QString) ns) 788 { setProperty(Property.ListNumberSuffix, ns); } 789 pragma(inline, true) QString numberSuffix() const 790 { return stringProperty(Property.ListNumberSuffix); } 791 792 protected: 793 /+ explicit +/this(ref const(QTextFormat) fmt); 794 /+ friend class QTextFormat; +/ 795 mixin(CREATE_CONVENIENCE_WRAPPERS); 796 } 797 798 /+ Q_DECLARE_SHARED(QTextListFormat) +/ 799 800 /// Binding for C++ class [QTextImageFormat](https://doc.qt.io/qt-6/qtextimageformat.html). 801 @Q_RELOCATABLE_TYPE extern(C++, class) struct /+ Q_GUI_EXPORT +/ QTextImageFormat 802 { 803 public QTextCharFormat base0; 804 alias base0 this; 805 public: 806 @disable this(); 807 pragma(mangle, defaultConstructorMangling(__traits(identifier, typeof(this)))) 808 ref typeof(this) rawConstructor(); 809 static typeof(this) create() 810 { 811 typeof(this) r = typeof(this).init; 812 r.rawConstructor(); 813 return r; 814 } 815 816 817 bool isValid() const { return isImageFormat(); } 818 819 pragma(inline, true) void setName(ref const(QString) aname) 820 { setProperty(Property.ImageName, aname); } 821 pragma(inline, true) QString name() const 822 { return stringProperty(Property.ImageName); } 823 824 pragma(inline, true) void setWidth(qreal awidth) 825 { setProperty(Property.ImageWidth, awidth); } 826 pragma(inline, true) qreal width() const 827 { return doubleProperty(Property.ImageWidth); } 828 829 pragma(inline, true) void setHeight(qreal aheight) 830 { setProperty(Property.ImageHeight, aheight); } 831 pragma(inline, true) qreal height() const 832 { return doubleProperty(Property.ImageHeight); } 833 834 pragma(inline, true) void setQuality(int aquality = 100) 835 { setProperty(Property.ImageQuality, aquality); } 836 pragma(inline, true) int quality() const 837 { return intProperty(Property.ImageQuality); } 838 839 protected: 840 /+ explicit +/this(ref const(QTextFormat) format); 841 /+ friend class QTextFormat; +/ 842 mixin(CREATE_CONVENIENCE_WRAPPERS); 843 } 844 845 /+ Q_DECLARE_SHARED(QTextImageFormat) +/ 846 847 /// Binding for C++ class [QTextFrameFormat](https://doc.qt.io/qt-6/qtextframeformat.html). 848 @Q_RELOCATABLE_TYPE extern(C++, class) struct /+ Q_GUI_EXPORT +/ QTextFrameFormat 849 { 850 public QTextFormat base0 = QTextFormat(QTextFormat.FormatType.FrameFormat); 851 alias base0 this; 852 alias PageBreakFlags = QTextFormat.PageBreakFlags; 853 public: 854 @disable this(); 855 /+this();+/ 856 857 bool isValid() const { return isFrameFormat(); } 858 859 enum Position { 860 InFlow, 861 FloatLeft, 862 FloatRight 863 // ###### 864 // Absolute 865 } 866 867 enum BorderStyle { 868 BorderStyle_None, 869 BorderStyle_Dotted, 870 BorderStyle_Dashed, 871 BorderStyle_Solid, 872 BorderStyle_Double, 873 BorderStyle_DotDash, 874 BorderStyle_DotDotDash, 875 BorderStyle_Groove, 876 BorderStyle_Ridge, 877 BorderStyle_Inset, 878 BorderStyle_Outset 879 } 880 881 pragma(inline, true) void setPosition(Position f) 882 { setProperty(Property.CssFloat, f); } 883 pragma(inline, true) Position position() const 884 { return static_cast!(Position)(intProperty(Property.CssFloat)); } 885 886 pragma(inline, true) void setBorder(qreal aborder) 887 { setProperty(Property.FrameBorder, aborder); } 888 pragma(inline, true) qreal border() const 889 { return doubleProperty(Property.FrameBorder); } 890 891 pragma(inline, true) void setBorderBrush(ref const(QBrush) brush) 892 { setProperty(Property.FrameBorderBrush, brush); } 893 pragma(inline, true) QBrush borderBrush() const 894 { return brushProperty(Property.FrameBorderBrush); } 895 896 pragma(inline, true) void setBorderStyle(BorderStyle style) 897 { setProperty(Property.FrameBorderStyle, style); } 898 pragma(inline, true) BorderStyle borderStyle() const 899 { return static_cast!(BorderStyle)(intProperty(Property.FrameBorderStyle)); } 900 901 void setMargin(qreal margin); 902 pragma(inline, true) qreal margin() const 903 { return doubleProperty(Property.FrameMargin); } 904 905 pragma(inline, true) void setTopMargin(qreal amargin) 906 { setProperty(Property.FrameTopMargin, amargin); } 907 qreal topMargin() const; 908 909 pragma(inline, true) void setBottomMargin(qreal amargin) 910 { setProperty(Property.FrameBottomMargin, amargin); } 911 qreal bottomMargin() const; 912 913 pragma(inline, true) void setLeftMargin(qreal amargin) 914 { setProperty(Property.FrameLeftMargin, amargin); } 915 qreal leftMargin() const; 916 917 pragma(inline, true) void setRightMargin(qreal amargin) 918 { setProperty(Property.FrameRightMargin, amargin); } 919 qreal rightMargin() const; 920 921 pragma(inline, true) void setPadding(qreal apadding) 922 { setProperty(Property.FramePadding, apadding); } 923 pragma(inline, true) qreal padding() const 924 { return doubleProperty(Property.FramePadding); } 925 926 pragma(inline, true) void setWidth(qreal awidth) 927 { setProperty(Property.FrameWidth, QTextLength(QTextLength.Type.FixedLength, awidth)); } 928 pragma(inline, true) void setWidth(ref const(QTextLength) length) 929 { setProperty(Property.FrameWidth, length); } 930 pragma(inline, true) QTextLength width() const 931 { return lengthProperty(Property.FrameWidth); } 932 933 pragma(inline, true) void setHeight(qreal aheight) 934 { setProperty(Property.FrameHeight, QTextLength(QTextLength.Type.FixedLength, aheight)); } 935 pragma(inline, true) void setHeight(ref const(QTextLength) aheight) 936 { setProperty(Property.FrameHeight, aheight); } 937 pragma(inline, true) QTextLength height() const 938 { return lengthProperty(Property.FrameHeight); } 939 940 pragma(inline, true) void setPageBreakPolicy(PageBreakFlags flags) 941 { auto tmp = cast(int)(flags); setProperty(Property.PageBreakPolicy, tmp); } 942 pragma(inline, true) PageBreakFlags pageBreakPolicy() const 943 { return PageBreakFlags(cast(QFlag)(intProperty(Property.PageBreakPolicy))); } 944 945 protected: 946 /+ explicit +/this(ref const(QTextFormat) fmt); 947 /+ friend class QTextFormat; +/ 948 mixin(CREATE_CONVENIENCE_WRAPPERS); 949 } 950 951 /+ Q_DECLARE_SHARED(QTextFrameFormat) +/ 952 953 /// Binding for C++ class [QTextTableFormat](https://doc.qt.io/qt-6/qtexttableformat.html). 954 @Q_RELOCATABLE_TYPE extern(C++, class) struct /+ Q_GUI_EXPORT +/ QTextTableFormat 955 { 956 public QTextFrameFormat base0; 957 alias base0 this; 958 public: 959 @disable this(); 960 pragma(mangle, defaultConstructorMangling(__traits(identifier, typeof(this)))) 961 ref typeof(this) rawConstructor(); 962 static typeof(this) create() 963 { 964 typeof(this) r = typeof(this).init; 965 r.rawConstructor(); 966 return r; 967 } 968 969 970 pragma(inline, true) bool isValid() const { return isTableFormat(); } 971 972 pragma(inline, true) int columns() const 973 { int cols = intProperty(Property.TableColumns); if (cols == 0) cols = 1; return cols; } 974 pragma(inline, true) void setColumns(int acolumns) 975 { 976 if (acolumns == 1) 977 acolumns = 0; 978 setProperty(Property.TableColumns, acolumns); 979 } 980 981 pragma(inline, true) void setColumnWidthConstraints(ref const(QList!(QTextLength)) constraints) 982 { setProperty(Property.TableColumnWidthConstraints, constraints); } 983 984 pragma(inline, true) QList!(QTextLength) columnWidthConstraints() const 985 { return lengthVectorProperty(Property.TableColumnWidthConstraints); } 986 987 pragma(inline, true) void clearColumnWidthConstraints() 988 { clearProperty(Property.TableColumnWidthConstraints); } 989 990 pragma(inline, true) qreal cellSpacing() const 991 { return doubleProperty(Property.TableCellSpacing); } 992 pragma(inline, true) void setCellSpacing(qreal spacing) 993 { setProperty(Property.TableCellSpacing, spacing); } 994 995 pragma(inline, true) qreal cellPadding() const 996 { return doubleProperty(Property.TableCellPadding); } 997 pragma(inline, true) void setCellPadding(qreal apadding) 998 { setProperty(Property.TableCellPadding, apadding); } 999 1000 pragma(inline, true) void setAlignment(/+ Qt:: +/qt.core.namespace.Alignment aalignment) 1001 { auto tmp = cast(int)(aalignment); setProperty(Property.BlockAlignment, tmp); } 1002 pragma(inline, true) /+ Qt:: +/qt.core.namespace.Alignment alignment() const 1003 { return qt.core.namespace.Alignment(QFlag(intProperty(Property.BlockAlignment))); } 1004 1005 pragma(inline, true) void setHeaderRowCount(int count) 1006 { setProperty(Property.TableHeaderRowCount, count); } 1007 pragma(inline, true) int headerRowCount() const 1008 { return intProperty(Property.TableHeaderRowCount); } 1009 1010 pragma(inline, true) void setBorderCollapse(bool borderCollapse) 1011 { setProperty(Property.TableBorderCollapse, borderCollapse); } 1012 pragma(inline, true) bool borderCollapse() const 1013 { return boolProperty(Property.TableBorderCollapse); } 1014 1015 protected: 1016 /+ explicit +/this(ref const(QTextFormat) fmt); 1017 /+ friend class QTextFormat; +/ 1018 mixin(CREATE_CONVENIENCE_WRAPPERS); 1019 } 1020 1021 /+ Q_DECLARE_SHARED(QTextTableFormat) +/ 1022 1023 /// Binding for C++ class [QTextTableCellFormat](https://doc.qt.io/qt-6/qtexttablecellformat.html). 1024 @Q_RELOCATABLE_TYPE extern(C++, class) struct /+ Q_GUI_EXPORT +/ QTextTableCellFormat 1025 { 1026 public QTextCharFormat base0; 1027 alias base0 this; 1028 public: 1029 @disable this(); 1030 pragma(mangle, defaultConstructorMangling(__traits(identifier, typeof(this)))) 1031 ref typeof(this) rawConstructor(); 1032 static typeof(this) create() 1033 { 1034 typeof(this) r = typeof(this).init; 1035 r.rawConstructor(); 1036 return r; 1037 } 1038 1039 1040 pragma(inline, true) bool isValid() const { return isTableCellFormat(); } 1041 1042 pragma(inline, true) void setTopPadding(qreal padding) 1043 { 1044 setProperty(Property.TableCellTopPadding, padding); 1045 } 1046 pragma(inline, true) qreal topPadding() const 1047 { 1048 return doubleProperty(Property.TableCellTopPadding); 1049 } 1050 1051 pragma(inline, true) void setBottomPadding(qreal padding) 1052 { 1053 setProperty(Property.TableCellBottomPadding, padding); 1054 } 1055 pragma(inline, true) qreal bottomPadding() const 1056 { 1057 return doubleProperty(Property.TableCellBottomPadding); 1058 } 1059 1060 pragma(inline, true) void setLeftPadding(qreal padding) 1061 { 1062 setProperty(Property.TableCellLeftPadding, padding); 1063 } 1064 pragma(inline, true) qreal leftPadding() const 1065 { 1066 return doubleProperty(Property.TableCellLeftPadding); 1067 } 1068 1069 pragma(inline, true) void setRightPadding(qreal padding) 1070 { 1071 setProperty(Property.TableCellRightPadding, padding); 1072 } 1073 pragma(inline, true) qreal rightPadding() const 1074 { 1075 return doubleProperty(Property.TableCellRightPadding); 1076 } 1077 1078 pragma(inline, true) void setPadding(qreal padding) 1079 { 1080 setTopPadding(padding); 1081 setBottomPadding(padding); 1082 setLeftPadding(padding); 1083 setRightPadding(padding); 1084 } 1085 1086 pragma(inline, true) void setTopBorder(qreal width) 1087 { setProperty(Property.TableCellTopBorder, width); } 1088 pragma(inline, true) qreal topBorder() const 1089 { return doubleProperty(Property.TableCellTopBorder); } 1090 1091 pragma(inline, true) void setBottomBorder(qreal width) 1092 { setProperty(Property.TableCellBottomBorder, width); } 1093 pragma(inline, true) qreal bottomBorder() const 1094 { return doubleProperty(Property.TableCellBottomBorder); } 1095 1096 pragma(inline, true) void setLeftBorder(qreal width) 1097 { setProperty(Property.TableCellLeftBorder, width); } 1098 pragma(inline, true) qreal leftBorder() const 1099 { return doubleProperty(Property.TableCellLeftBorder); } 1100 1101 pragma(inline, true) void setRightBorder(qreal width) 1102 { setProperty(Property.TableCellRightBorder, width); } 1103 pragma(inline, true) qreal rightBorder() const 1104 { return doubleProperty(Property.TableCellRightBorder); } 1105 1106 pragma(inline, true) void setBorder(qreal width) 1107 { 1108 setTopBorder(width); 1109 setBottomBorder(width); 1110 setLeftBorder(width); 1111 setRightBorder(width); 1112 } 1113 1114 pragma(inline, true) void setTopBorderStyle(QTextFrameFormat.BorderStyle style) 1115 { setProperty(Property.TableCellTopBorderStyle, style); } 1116 pragma(inline, true) QTextFrameFormat.BorderStyle topBorderStyle() const 1117 { return static_cast!(QTextFrameFormat.BorderStyle)(intProperty(Property.TableCellTopBorderStyle)); } 1118 1119 pragma(inline, true) void setBottomBorderStyle(QTextFrameFormat.BorderStyle style) 1120 { setProperty(Property.TableCellBottomBorderStyle, style); } 1121 pragma(inline, true) QTextFrameFormat.BorderStyle bottomBorderStyle() const 1122 { return static_cast!(QTextFrameFormat.BorderStyle)(intProperty(Property.TableCellBottomBorderStyle)); } 1123 1124 pragma(inline, true) void setLeftBorderStyle(QTextFrameFormat.BorderStyle style) 1125 { setProperty(Property.TableCellLeftBorderStyle, style); } 1126 pragma(inline, true) QTextFrameFormat.BorderStyle leftBorderStyle() const 1127 { return static_cast!(QTextFrameFormat.BorderStyle)(intProperty(Property.TableCellLeftBorderStyle)); } 1128 1129 pragma(inline, true) void setRightBorderStyle(QTextFrameFormat.BorderStyle style) 1130 { setProperty(Property.TableCellRightBorderStyle, style); } 1131 pragma(inline, true) QTextFrameFormat.BorderStyle rightBorderStyle() const 1132 { return static_cast!(QTextFrameFormat.BorderStyle)(intProperty(Property.TableCellRightBorderStyle)); } 1133 1134 pragma(inline, true) void setBorderStyle(QTextFrameFormat.BorderStyle style) 1135 { 1136 setTopBorderStyle(style); 1137 setBottomBorderStyle(style); 1138 setLeftBorderStyle(style); 1139 setRightBorderStyle(style); 1140 } 1141 1142 pragma(inline, true) void setTopBorderBrush(ref const(QBrush) brush) 1143 { setProperty(Property.TableCellTopBorderBrush, brush); } 1144 pragma(inline, true) QBrush topBorderBrush() const 1145 { return brushProperty(Property.TableCellTopBorderBrush); } 1146 1147 pragma(inline, true) void setBottomBorderBrush(ref const(QBrush) brush) 1148 { setProperty(Property.TableCellBottomBorderBrush, brush); } 1149 pragma(inline, true) QBrush bottomBorderBrush() const 1150 { return brushProperty(Property.TableCellBottomBorderBrush); } 1151 1152 pragma(inline, true) void setLeftBorderBrush(ref const(QBrush) brush) 1153 { setProperty(Property.TableCellLeftBorderBrush, brush); } 1154 pragma(inline, true) QBrush leftBorderBrush() const 1155 { return brushProperty(Property.TableCellLeftBorderBrush); } 1156 1157 pragma(inline, true) void setRightBorderBrush(ref const(QBrush) brush) 1158 { setProperty(Property.TableCellRightBorderBrush, brush); } 1159 pragma(inline, true) QBrush rightBorderBrush() const 1160 { return brushProperty(Property.TableCellRightBorderBrush); } 1161 1162 pragma(inline, true) void setBorderBrush(ref const(QBrush) brush) 1163 { 1164 setTopBorderBrush(brush); 1165 setBottomBorderBrush(brush); 1166 setLeftBorderBrush(brush); 1167 setRightBorderBrush(brush); 1168 } 1169 1170 protected: 1171 /+ explicit +/this(ref const(QTextFormat) fmt); 1172 /+ friend class QTextFormat; +/ 1173 mixin(CREATE_CONVENIENCE_WRAPPERS); 1174 } 1175 1176 /+ Q_DECLARE_SHARED(QTextTableCellFormat) +/ 1177