1 | // Copyright (C) 2016 The Qt Company Ltd. |
---|---|
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | #ifndef QTEXTLIST_H |
5 | #define QTEXTLIST_H |
6 | |
7 | #include <QtGui/qtguiglobal.h> |
8 | #include <QtGui/qtextobject.h> |
9 | #include <QtCore/qobject.h> |
10 | |
11 | QT_BEGIN_NAMESPACE |
12 | |
13 | |
14 | class QTextListPrivate; |
15 | class QTextCursor; |
16 | |
17 | class Q_GUI_EXPORT QTextList : public QTextBlockGroup |
18 | { |
19 | Q_OBJECT |
20 | public: |
21 | explicit QTextList(QTextDocument *doc); |
22 | ~QTextList(); |
23 | |
24 | int count() const; |
25 | |
26 | QTextBlock item(int i) const; |
27 | |
28 | int itemNumber(const QTextBlock &) const; |
29 | QString itemText(const QTextBlock &) const; |
30 | |
31 | void removeItem(int i); |
32 | void remove(const QTextBlock &); |
33 | |
34 | void add(const QTextBlock &block); |
35 | |
36 | inline void setFormat(const QTextListFormat &format); |
37 | QTextListFormat format() const { return QTextObject::format().toListFormat(); } |
38 | |
39 | private: |
40 | Q_DISABLE_COPY(QTextList) |
41 | Q_DECLARE_PRIVATE(QTextList) |
42 | }; |
43 | |
44 | inline void QTextList::setFormat(const QTextListFormat &aformat) |
45 | { QTextObject::setFormat(aformat); } |
46 | |
47 | QT_END_NAMESPACE |
48 | |
49 | #endif // QTEXTLIST_H |
50 |