Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qtextmarkdownwriter_p.h
Go to the documentation of this file.
1// Copyright (C) 2019 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 QTEXTMARKDOWNWRITER_P_H
5#define QTEXTMARKDOWNWRITER_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 <QtGui/private/qtguiglobal_p.h>
19#include <QtCore/QTextStream>
20
21#include "qtextdocument_p.h"
22#include "qtextdocumentwriter.h"
23
25
27
28class Q_GUI_EXPORT QTextMarkdownWriter
29{
30public:
31 QTextMarkdownWriter(QTextStream &stream, QTextDocument::MarkdownFeatures features);
32 bool writeAll(const QTextDocument *document);
33#if QT_CONFIG(itemmodel)
34 void writeTable(const QAbstractItemModel *table);
35#endif
36
37 int writeBlock(const QTextBlock &block, bool table, bool ignoreFormat, bool ignoreEmpty);
38 void writeFrame(const QTextFrame *frame);
39 void writeFrontMatter(const QString &fm);
40
41private:
42 struct ListInfo {
43 bool loose;
44 };
45
46 ListInfo listInfo(QTextList *list);
47 void setLinePrefixForBlockQuote(int level);
48
49private:
50 QTextStream &m_stream;
51 QTextDocument::MarkdownFeatures m_features;
52 QMap<QTextList *, ListInfo> m_listInfo;
53 QString m_linePrefix;
54 QString m_codeBlockFence;
55 int m_wrappedLineIndent = 0;
56 int m_lastListIndent = 1;
57 bool m_doubleNewlineWritten = false;
58 bool m_linePrefixWritten = false;
59 bool m_indentedCodeBlock = false;
60 bool m_fencedCodeBlock = false;
61};
62
64
65#endif // QTEXTMARKDOWNWRITER_P_H
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\reentrant
\reentrant \inmodule QtGui
\reentrant
Definition qtextobject.h:81
\reentrant
Definition qtextlist.h:18
\inmodule QtCore
Combined button and popup list for selecting options.
EGLStreamKHR stream
GLenum GLuint GLint level
GLenum GLenum GLsizei void * table
QList< int > list
[14]
QFrame frame
[0]