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 QTEXTOBJECT_P_H
5#define QTEXTOBJECT_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 for the convenience
12// of other Qt classes. 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 <QtGui/private/qtguiglobal_p.h>
19#include "QtGui/qtextobject.h"
20#include "private/qobject_p.h"
21#include "QtGui/qtextdocument.h"
22
23QT_BEGIN_NAMESPACE
24
25class QTextDocumentPrivate;
26
27class QTextObjectPrivate : public QObjectPrivate
28{
29 Q_DECLARE_PUBLIC(QTextObject)
30public:
31 QTextObjectPrivate(QTextDocument *doc)
32 : pieceTable(doc->d_func()), objectIndex(-1)
33 {
34 }
35 QTextDocumentPrivate *pieceTable;
36 int objectIndex;
37};
38
39class QTextBlockGroupPrivate : public QTextObjectPrivate
40{
41 Q_DECLARE_PUBLIC(QTextBlockGroup)
42public:
43 QTextBlockGroupPrivate(QTextDocument *doc)
44 : QTextObjectPrivate(doc)
45 {
46 }
47 typedef QList<QTextBlock> BlockList;
48 BlockList blocks;
49 void markBlocksDirty();
50};
51
52class QTextFrameLayoutData;
53
54class QTextFramePrivate : public QTextObjectPrivate
55{
56 friend class QTextDocumentPrivate;
57 Q_DECLARE_PUBLIC(QTextFrame)
58public:
59 QTextFramePrivate(QTextDocument *doc)
60 : QTextObjectPrivate(doc), fragment_start(0), fragment_end(0), parentFrame(nullptr), layoutData(nullptr)
61 {
62 }
63 virtual void fragmentAdded(QChar type, uint fragment);
64 virtual void fragmentRemoved(QChar type, uint fragment);
65 void remove_me();
66
67 uint fragment_start;
68 uint fragment_end;
69
70 QTextFrame *parentFrame;
71 QList<QTextFrame *> childFrames;
72 QTextFrameLayoutData *layoutData;
73};
74
75QT_END_NAMESPACE
76
77#endif // QTEXTOBJECT_P_H
78

source code of qtbase/src/gui/text/qtextobject_p.h