compile
[kdegraphics.git] / okular / core / fontinfo.cpp
blob59ea79f799d8e5cac8e7d36ed92e283e780effcd
1 /***************************************************************************
2 * Copyright (C) 2007 by Pino Toscano <pino@kde.org> *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 ***************************************************************************/
10 // local includes
11 #include "fontinfo.h"
13 #include <qvariant.h>
15 using namespace Okular;
17 class Okular::FontInfoPrivate
18 : public QSharedData
20 public:
21 FontInfoPrivate()
22 : type( FontInfo::Unknown ), embedType( FontInfo::NotEmbedded ),
23 canBeExtracted( false )
27 bool operator==( const FontInfoPrivate &rhs ) const
29 return name == rhs.name &&
30 type == rhs.type &&
31 embedType == rhs.embedType &&
32 file == rhs.file &&
33 canBeExtracted == rhs.canBeExtracted &&
34 nativeId == rhs.nativeId;
37 QString name;
38 FontInfo::FontType type;
39 FontInfo::EmbedType embedType;
40 bool canBeExtracted;
41 QString file;
42 QVariant nativeId;
46 FontInfo::FontInfo()
47 : d( new FontInfoPrivate )
51 FontInfo::FontInfo( const FontInfo &fi )
52 : d( fi.d )
56 FontInfo::~FontInfo()
60 QString FontInfo::name() const
62 return d->name;
65 void FontInfo::setName( const QString& name )
67 d->name = name;
70 FontInfo::FontType FontInfo::type() const
72 return d->type;
75 void FontInfo::setType( FontInfo::FontType type )
77 d->type = type;
80 FontInfo::EmbedType FontInfo::embedType() const
82 return d->embedType;
85 void FontInfo::setEmbedType( FontInfo::EmbedType type )
87 d->embedType = type;
90 QString FontInfo::file() const
92 return d->file;
95 void FontInfo::setFile( const QString& file )
97 d->file = file;
100 bool FontInfo::canBeExtracted() const
102 return d->canBeExtracted;
105 void FontInfo::setCanBeExtracted(bool extractable)
107 d->canBeExtracted = extractable;
110 void FontInfo::setNativeId( const QVariant &id )
112 d->nativeId = id;
115 QVariant FontInfo::nativeId() const
117 return d->nativeId;
120 bool FontInfo::operator==( const FontInfo &fi ) const
122 return *d == *fi.d;
125 bool FontInfo::operator!=( const FontInfo &fi ) const
127 return !operator==( fi );
130 FontInfo& FontInfo::operator=( const FontInfo &fi )
132 if ( this == &fi )
133 return *this;
135 d = fi.d;
136 return *this;