2021-05-24 07:25:56 +00:00
|
|
|
/*
|
|
|
|
SPDX-FileCopyrightText: 2007 Pino Toscano <pino@kde.org>
|
|
|
|
|
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
2007-07-07 20:35:01 +00:00
|
|
|
|
|
|
|
// local includes
|
|
|
|
#include "fontinfo.h"
|
|
|
|
|
2020-07-08 11:54:37 +00:00
|
|
|
#include <QVariant>
|
2008-08-01 20:26:22 +00:00
|
|
|
|
2007-07-07 20:35:01 +00:00
|
|
|
using namespace Okular;
|
|
|
|
|
|
|
|
class Okular::FontInfoPrivate : public QSharedData
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
FontInfoPrivate()
|
2008-08-01 20:26:22 +00:00
|
|
|
: type(FontInfo::Unknown)
|
|
|
|
, embedType(FontInfo::NotEmbedded)
|
|
|
|
, canBeExtracted(false)
|
2007-07-07 20:35:01 +00:00
|
|
|
{
|
|
|
|
}
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2007-07-07 20:35:01 +00:00
|
|
|
bool operator==(const FontInfoPrivate &rhs) const
|
|
|
|
{
|
2019-08-09 23:54:25 +00:00
|
|
|
return name == rhs.name && substituteName == rhs.substituteName && type == rhs.type && embedType == rhs.embedType && file == rhs.file && canBeExtracted == rhs.canBeExtracted;
|
2007-07-07 20:35:01 +00:00
|
|
|
}
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2007-07-07 20:35:01 +00:00
|
|
|
QString name;
|
2019-08-09 23:54:25 +00:00
|
|
|
QString substituteName;
|
2007-07-07 20:35:01 +00:00
|
|
|
FontInfo::FontType type;
|
2007-07-08 16:07:37 +00:00
|
|
|
FontInfo::EmbedType embedType;
|
2008-08-01 20:26:22 +00:00
|
|
|
bool canBeExtracted;
|
2007-07-07 20:35:01 +00:00
|
|
|
QString file;
|
2008-08-01 20:26:22 +00:00
|
|
|
QVariant nativeId;
|
2007-07-07 20:35:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
FontInfo::FontInfo()
|
|
|
|
: d(new FontInfoPrivate)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
FontInfo::FontInfo(const FontInfo &fi)
|
|
|
|
: d(fi.d)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
FontInfo::~FontInfo()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
QString FontInfo::name() const
|
|
|
|
{
|
|
|
|
return d->name;
|
|
|
|
}
|
|
|
|
|
|
|
|
void FontInfo::setName(const QString &name)
|
|
|
|
{
|
|
|
|
d->name = name;
|
|
|
|
}
|
|
|
|
|
2019-08-09 23:54:25 +00:00
|
|
|
QString FontInfo::substituteName() const
|
|
|
|
{
|
|
|
|
return d->substituteName;
|
|
|
|
}
|
|
|
|
|
|
|
|
void FontInfo::setSubstituteName(const QString &substituteName)
|
|
|
|
{
|
|
|
|
d->substituteName = substituteName;
|
|
|
|
}
|
|
|
|
|
2007-07-07 20:35:01 +00:00
|
|
|
FontInfo::FontType FontInfo::type() const
|
|
|
|
{
|
|
|
|
return d->type;
|
|
|
|
}
|
|
|
|
|
|
|
|
void FontInfo::setType(FontInfo::FontType type)
|
|
|
|
{
|
|
|
|
d->type = type;
|
|
|
|
}
|
|
|
|
|
2007-07-08 16:07:37 +00:00
|
|
|
FontInfo::EmbedType FontInfo::embedType() const
|
2007-07-07 20:35:01 +00:00
|
|
|
{
|
2007-07-08 16:07:37 +00:00
|
|
|
return d->embedType;
|
2007-07-07 20:35:01 +00:00
|
|
|
}
|
|
|
|
|
2007-07-08 16:07:37 +00:00
|
|
|
void FontInfo::setEmbedType(FontInfo::EmbedType type)
|
2007-07-07 20:35:01 +00:00
|
|
|
{
|
2007-07-08 16:07:37 +00:00
|
|
|
d->embedType = type;
|
2007-07-07 20:35:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QString FontInfo::file() const
|
|
|
|
{
|
|
|
|
return d->file;
|
|
|
|
}
|
|
|
|
|
|
|
|
void FontInfo::setFile(const QString &file)
|
|
|
|
{
|
|
|
|
d->file = file;
|
|
|
|
}
|
|
|
|
|
2008-08-01 20:26:22 +00:00
|
|
|
bool FontInfo::canBeExtracted() const
|
|
|
|
{
|
|
|
|
return d->canBeExtracted;
|
|
|
|
}
|
|
|
|
|
|
|
|
void FontInfo::setCanBeExtracted(bool extractable)
|
|
|
|
{
|
|
|
|
d->canBeExtracted = extractable;
|
|
|
|
}
|
|
|
|
|
|
|
|
void FontInfo::setNativeId(const QVariant &id)
|
|
|
|
{
|
|
|
|
d->nativeId = id;
|
|
|
|
}
|
|
|
|
|
|
|
|
QVariant FontInfo::nativeId() const
|
|
|
|
{
|
|
|
|
return d->nativeId;
|
|
|
|
}
|
|
|
|
|
2007-07-07 20:35:01 +00:00
|
|
|
bool FontInfo::operator==(const FontInfo &fi) const
|
|
|
|
{
|
|
|
|
return *d == *fi.d;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool FontInfo::operator!=(const FontInfo &fi) const
|
|
|
|
{
|
|
|
|
return !operator==(fi);
|
|
|
|
}
|
|
|
|
|
|
|
|
FontInfo &FontInfo::operator=(const FontInfo &fi)
|
|
|
|
{
|
|
|
|
if (this == &fi) {
|
|
|
|
return *this;
|
2022-03-08 10:10:43 +00:00
|
|
|
}
|
2007-07-07 20:35:01 +00:00
|
|
|
|
|
|
|
d = fi.d;
|
|
|
|
return *this;
|
|
|
|
}
|