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 QTEXTIMAGEHANDLER_P_H
5#define QTEXTIMAGEHANDLER_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/qobject.h"
20#include "QtGui/qabstracttextdocumentlayout.h"
21
22QT_BEGIN_NAMESPACE
23
24class QTextImageFormat;
25
26class Q_GUI_EXPORT QTextImageHandler : public QObject,
27 public QTextObjectInterface
28{
29 Q_OBJECT
30 Q_INTERFACES(QTextObjectInterface)
31public:
32 explicit QTextImageHandler(QObject *parent = nullptr);
33
34 virtual QSizeF intrinsicSize(QTextDocument *doc, int posInDocument, const QTextFormat &format) override;
35 virtual void drawObject(QPainter *p, const QRectF &rect, QTextDocument *doc, int posInDocument, const QTextFormat &format) override;
36 QImage image(QTextDocument *doc, const QTextImageFormat &imageFormat);
37};
38
39QT_END_NAMESPACE
40
41#endif // QTEXTIMAGEHANDLER_P_H
42

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