Okular

fontinfo.cpp
1 /*
2  SPDX-FileCopyrightText: 2007 Pino Toscano <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 // local includes
8 #include "fontinfo.h"
9 
10 #include <QVariant>
11 
12 using namespace Okular;
13 
14 class Okular::FontInfoPrivate : public QSharedData
15 {
16 public:
17  FontInfoPrivate()
19  , embedType(FontInfo::NotEmbedded)
20  , canBeExtracted(false)
21  {
22  }
23 
24  bool operator==(const FontInfoPrivate &rhs) const
25  {
26  return name == rhs.name && substituteName == rhs.substituteName && type == rhs.type && embedType == rhs.embedType && file == rhs.file && canBeExtracted == rhs.canBeExtracted;
27  }
28 
29  QString name;
30  QString substituteName;
32  FontInfo::EmbedType embedType;
33  bool canBeExtracted;
34  QString file;
35  QVariant nativeId;
36 };
37 
39  : d(new FontInfoPrivate)
40 {
41 }
42 
44  : d(fi.d)
45 {
46 }
47 
49 {
50 }
51 
53 {
54  return d->name;
55 }
56 
58 {
59  d->name = name;
60 }
61 
63 {
64  return d->substituteName;
65 }
66 
68 {
69  d->substituteName = substituteName;
70 }
71 
73 {
74  return d->type;
75 }
76 
78 {
79  d->type = type;
80 }
81 
83 {
84  return d->embedType;
85 }
86 
88 {
89  d->embedType = type;
90 }
91 
93 {
94  return d->file;
95 }
96 
97 void FontInfo::setFile(const QString &file)
98 {
99  d->file = file;
100 }
101 
103 {
104  return d->canBeExtracted;
105 }
106 
107 void FontInfo::setCanBeExtracted(bool extractable)
108 {
109  d->canBeExtracted = extractable;
110 }
111 
113 {
114  d->nativeId = id;
115 }
116 
118 {
119  return d->nativeId;
120 }
121 
122 bool FontInfo::operator==(const FontInfo &fi) const
123 {
124  return *d == *fi.d;
125 }
126 
127 bool FontInfo::operator!=(const FontInfo &fi) const
128 {
129  return !operator==(fi);
130 }
131 
132 FontInfo &FontInfo::operator=(const FontInfo &fi)
133 {
134  if (this == &fi)
135  return *this;
136 
137  d = fi.d;
138  return *this;
139 }
void setEmbedType(EmbedType type)
Sets the type of font embedding.
Definition: fontinfo.cpp:87
~FontInfo()
Destructor.
Definition: fontinfo.cpp:48
bool canBeExtracted() const
In case of embedded fonts, returns if the font can be extracted into a QByteArray.
Definition: fontinfo.cpp:102
QString name(const QVariant &location)
void setType(FontType type)
Change the type of the font.
Definition: fontinfo.cpp:77
FontType type() const
Returns the type of the font.
Definition: fontinfo.cpp:72
FontInfo()
Construct a new empty font info.
Definition: fontinfo.cpp:38
void setSubstituteName(const QString &substituteName)
Sets a new substitute name for the font.
Definition: fontinfo.cpp:67
global.h
Definition: action.h:16
QString name() const
Returns the name of the font.
Definition: fontinfo.cpp:52
bool operator==(const FontInfo &fi) const
Comparison operator.
Definition: fontinfo.cpp:122
void setNativeId(const QVariant &id)
Sets the "native" id of the font info.
Definition: fontinfo.cpp:112
bool operator==(const Qt3DRender::QGraphicsApiFilter &reference, const Qt3DRender::QGraphicsApiFilter &sample)
QString file() const
In case of not embedded font, returns the path of the font that represents this font.
Definition: fontinfo.cpp:92
A small class that represents the information of a font.
Definition: fontinfo.h:24
Type type(const QSqlDatabase &db)
void setCanBeExtracted(bool extractable)
Sets if a font can be extracted or not.
Definition: fontinfo.cpp:107
EmbedType
The possible kinds of embed.
Definition: fontinfo.h:54
QVariant nativeId() const
Returns the "native" id of the font info.
Definition: fontinfo.cpp:117
FontType
The possible kinds of fonts.
Definition: fontinfo.h:32
QString substituteName() const
Returns the substitute name for the font.
Definition: fontinfo.cpp:62
EmbedType embedType() const
Returns the type of font embedding.
Definition: fontinfo.cpp:82
void setName(const QString &name)
Sets a new name for the font.
Definition: fontinfo.cpp:57
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sun Jun 20 2021 22:35:41 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.