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#ifndef QTEXTDOCUMENTWRITER_H
4#define QTEXTDOCUMENTWRITER_H
5
6#include <QtGui/qtguiglobal.h>
7#include <QtCore/qstring.h>
8
9QT_BEGIN_NAMESPACE
10
11
12class QTextDocumentWriterPrivate;
13class QIODevice;
14class QByteArray;
15class QTextDocument;
16class QTextDocumentFragment;
17
18class Q_GUI_EXPORT QTextDocumentWriter
19{
20public:
21 QTextDocumentWriter();
22 QTextDocumentWriter(QIODevice *device, const QByteArray &format);
23 explicit QTextDocumentWriter(const QString &fileName, const QByteArray &format = QByteArray());
24 ~QTextDocumentWriter();
25
26 void setFormat (const QByteArray &format);
27 QByteArray format () const;
28
29 void setDevice (QIODevice *device);
30 QIODevice *device () const;
31 void setFileName (const QString &fileName);
32 QString fileName () const;
33
34 bool write(const QTextDocument *document);
35 bool write(const QTextDocumentFragment &fragment);
36
37 static QList<QByteArray> supportedDocumentFormats();
38
39private:
40 Q_DISABLE_COPY(QTextDocumentWriter)
41 QTextDocumentWriterPrivate *d;
42};
43
44QT_END_NAMESPACE
45
46#endif
47

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