1// Copyright (C) 2021 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 QTEXTBLOCK_P_H
5#define QTEXTBLOCK_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtCore/qstring.h>
19
20namespace Utils {
21
22class TextDocument;
23class TextBlockUserData;
24
25class TextBlock
26{
27public:
28 bool isValid() const;
29
30 void setBlockNumber(int blockNumber);
31 int blockNumber() const;
32
33 void setPosition(int position);
34 int position() const;
35
36 void setLength(int length);
37 int length() const;
38
39 TextBlock next() const;
40 TextBlock previous() const;
41
42 int userState() const;
43 void setUserState(int state);
44
45 bool isVisible() const;
46 void setVisible(bool visible);
47
48 void setLineCount(int count);
49 int lineCount() const;
50
51 void setDocument(TextDocument *document);
52 TextDocument *document() const;
53
54 QString text() const;
55
56 int revision() const;
57 void setRevision(int rev);
58
59 friend bool operator==(const TextBlock &t1, const TextBlock &t2);
60 friend bool operator!=(const TextBlock &t1, const TextBlock &t2);
61
62private:
63 TextDocument *m_document = nullptr;
64 int m_revision = 0;
65
66 int m_position = 0;
67 int m_length = 0;
68 int m_blockNumber = -1;
69};
70
71} // namespace Utils
72
73#endif // TEXTBLOCK_P_H
74

source code of qtdeclarative/src/qmlls/qtextblock_p.h