1// qtextoption.sip generated by MetaSIP
2//
3// This file is part of the QtGui Python extension module.
4//
5// Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com>
6//
7// This file is part of PyQt5.
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
22
23class QTextOption
24{
25%TypeHeaderCode
26#include <qtextoption.h>
27%End
28
29public:
30    QTextOption();
31    QTextOption(Qt::Alignment alignment);
32    ~QTextOption();
33    QTextOption(const QTextOption &o);
34    Qt::Alignment alignment() const;
35    void setTextDirection(Qt::LayoutDirection aDirection);
36    Qt::LayoutDirection textDirection() const;
37
38    enum WrapMode
39    {
40        NoWrap,
41        WordWrap,
42        ManualWrap,
43        WrapAnywhere,
44        WrapAtWordBoundaryOrAnywhere,
45    };
46
47    void setWrapMode(QTextOption::WrapMode wrap);
48    QTextOption::WrapMode wrapMode() const;
49
50    enum Flag
51    {
52        IncludeTrailingSpaces,
53        ShowTabsAndSpaces,
54        ShowLineAndParagraphSeparators,
55        AddSpaceForLineAndParagraphSeparators,
56        SuppressColors,
57%If (Qt_5_7_0 -)
58        ShowDocumentTerminator,
59%End
60    };
61
62    typedef QFlags<QTextOption::Flag> Flags;
63    QTextOption::Flags flags() const;
64    qreal tabStop() const;
65    void setTabArray(const QList<qreal> &tabStops);
66    QList<qreal> tabArray() const;
67    void setUseDesignMetrics(bool b);
68    bool useDesignMetrics() const;
69    void setAlignment(Qt::Alignment aalignment);
70    void setFlags(QTextOption::Flags flags);
71    void setTabStop(qreal atabStop);
72
73    enum TabType
74    {
75        LeftTab,
76        RightTab,
77        CenterTab,
78        DelimiterTab,
79    };
80
81    struct Tab
82    {
83%TypeHeaderCode
84#include <qtextoption.h>
85%End
86
87        Tab();
88        Tab(qreal pos, QTextOption::TabType tabType, QChar delim = QChar());
89        bool operator==(const QTextOption::Tab &other) const;
90        bool operator!=(const QTextOption::Tab &other) const;
91        qreal position;
92        QTextOption::TabType type;
93        QChar delimiter;
94    };
95
96    void setTabs(const QList<QTextOption::Tab> &tabStops);
97    QList<QTextOption::Tab> tabs() const;
98%If (Qt_5_10_0 -)
99    void setTabStopDistance(qreal tabStopDistance);
100%End
101%If (Qt_5_10_0 -)
102    qreal tabStopDistance() const;
103%End
104};
105
106QFlags<QTextOption::Flag> operator|(QTextOption::Flag f1, QFlags<QTextOption::Flag> f2);
107