Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qpdfdocumentrenderoptions.h
Go to the documentation of this file.
1
// Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias König <tobias.koenig@kdab.com>
2
// Copyright (C) 2020 The Qt Company Ltd.
3
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
5
#
ifndef
QPDFDOCUMENTRENDEROPTIONS_H
6
#
define
QPDFDOCUMENTRENDEROPTIONS_H
7
8
#
include
<
QtPdf
/
qtpdfglobal
.
h
>
9
#
include
<
QtCore
/
qobject
.
h
>
10
#
include
<
QtCore
/
qrect
.
h
>
11
12
QT_BEGIN_NAMESPACE
13
14
class
QPdfDocumentRenderOptions
15
{
16
public
:
17
enum
class
Rotation {
18
None,
19
Clockwise90,
20
Clockwise180,
21
Clockwise270
22
};
23
24
enum
class
RenderFlag {
25
None = 0x000,
26
Annotations = 0x001,
27
OptimizedForLcd = 0x002,
28
Grayscale = 0x004,
29
ForceHalftone = 0x008,
30
TextAliased = 0x010,
31
ImageAliased = 0x020,
32
PathAliased = 0x040
33
};
34
Q_DECLARE_FLAGS(RenderFlags, RenderFlag)
35
36
constexpr
QPdfDocumentRenderOptions()
noexcept
: m_renderFlags(0), m_rotation(0), m_reserved(0) {}
37
38
constexpr
Rotation rotation()
const
noexcept
{
return
static_cast
<Rotation>(m_rotation); }
39
constexpr
void
setRotation(Rotation r)
noexcept
{ m_rotation = quint32(r); }
40
41
constexpr
RenderFlags renderFlags()
const
noexcept
{
return
static_cast
<RenderFlags>(m_renderFlags); }
42
constexpr
void
setRenderFlags(RenderFlags r)
noexcept
{ m_renderFlags = quint32(r.toInt()); }
43
44
constexpr
QRect scaledClipRect()
const
noexcept
{
return
m_clipRect; }
45
constexpr
void
setScaledClipRect(
const
QRect &r)
noexcept
{ m_clipRect = r; }
46
47
constexpr
QSize scaledSize()
const
noexcept
{
return
m_scaledSize; }
48
constexpr
void
setScaledSize(
const
QSize &s)
noexcept
{ m_scaledSize = s; }
49
50
private
:
51
friend
constexpr
inline
bool
operator==(
const
QPdfDocumentRenderOptions &lhs,
const
QPdfDocumentRenderOptions &rhs)
noexcept
;
52
53
QRect m_clipRect;
54
QSize m_scaledSize;
55
56
quint32 m_renderFlags : 8;
57
quint32 m_rotation : 3;
58
quint32 m_reserved : 21;
59
quint32 m_reserved2 = 0;
60
};
61
62
Q_DECLARE_TYPEINFO
(QPdfDocumentRenderOptions,
Q_PRIMITIVE_TYPE
);
63
Q_DECLARE_OPERATORS_FOR_FLAGS(QPdfDocumentRenderOptions::RenderFlags)
64
65
constexpr
inline
bool
operator
==(
const
QPdfDocumentRenderOptions &lhs,
const
QPdfDocumentRenderOptions &rhs)
noexcept
66
{
67
return
lhs.m_clipRect == rhs.m_clipRect && lhs.m_scaledSize == rhs.m_scaledSize &&
68
lhs.m_renderFlags == rhs.m_renderFlags && lhs.m_rotation == rhs.m_rotation &&
69
lhs.m_reserved == rhs.m_reserved && lhs.m_reserved2 == rhs.m_reserved2;
// fix -Wunused-private-field
70
}
71
72
constexpr
inline
bool
operator
!=(
const
QPdfDocumentRenderOptions &lhs,
const
QPdfDocumentRenderOptions &rhs)
noexcept
73
{
74
return
!
operator
==
(
lhs
,
rhs
)
;
75
}
76
77
QT_END_NAMESPACE
78
79
Q_DECLARE_METATYPE(QPdfDocumentRenderOptions)
80
81
#
endif
// QPDFDOCUMENTRENDEROPTIONS_H
Q_DECLARE_TYPEINFO
Q_DECLARE_TYPEINFO(QPdfDocumentRenderOptions, Q_PRIMITIVE_TYPE)
operator!=
constexpr bool operator!=(const QPdfDocumentRenderOptions &lhs, const QPdfDocumentRenderOptions &rhs) noexcept
Definition
qpdfdocumentrenderoptions.h:72
operator==
constexpr bool operator==(const QPdfDocumentRenderOptions &lhs, const QPdfDocumentRenderOptions &rhs) noexcept
Definition
qpdfdocumentrenderoptions.h:65
qtwebengine
src
pdf
qpdfdocumentrenderoptions.h
Generated on
for Qt by
1.18.0