• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdegraphics API Reference
  • KDE Home
  • Contact Us
 

okular

  • sources
  • kde-4.12
  • kdegraphics
  • okular
  • core
fontinfo.cpp
Go to the documentation of this file.
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  ***************************************************************************/
9 
10 // local includes
11 #include "fontinfo.h"
12 
13 #include <qvariant.h>
14 
15 using namespace Okular;
16 
17 class Okular::FontInfoPrivate
18  : public QSharedData
19 {
20  public:
21  FontInfoPrivate()
22  : type( FontInfo::Unknown ), embedType( FontInfo::NotEmbedded ),
23  canBeExtracted( false )
24  {
25  }
26 
27  bool operator==( const FontInfoPrivate &rhs ) const
28  {
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;
35  }
36 
37  QString name;
38  FontInfo::FontType type;
39  FontInfo::EmbedType embedType;
40  bool canBeExtracted;
41  QString file;
42  QVariant nativeId;
43 };
44 
45 
46 FontInfo::FontInfo()
47  : d( new FontInfoPrivate )
48 {
49 }
50 
51 FontInfo::FontInfo( const FontInfo &fi )
52  : d( fi.d )
53 {
54 }
55 
56 FontInfo::~FontInfo()
57 {
58 }
59 
60 QString FontInfo::name() const
61 {
62  return d->name;
63 }
64 
65 void FontInfo::setName( const QString& name )
66 {
67  d->name = name;
68 }
69 
70 FontInfo::FontType FontInfo::type() const
71 {
72  return d->type;
73 }
74 
75 void FontInfo::setType( FontInfo::FontType type )
76 {
77  d->type = type;
78 }
79 
80 FontInfo::EmbedType FontInfo::embedType() const
81 {
82  return d->embedType;
83 }
84 
85 void FontInfo::setEmbedType( FontInfo::EmbedType type )
86 {
87  d->embedType = type;
88 }
89 
90 QString FontInfo::file() const
91 {
92  return d->file;
93 }
94 
95 void FontInfo::setFile( const QString& file )
96 {
97  d->file = file;
98 }
99 
100 bool FontInfo::canBeExtracted() const
101 {
102  return d->canBeExtracted;
103 }
104 
105 void FontInfo::setCanBeExtracted(bool extractable)
106 {
107  d->canBeExtracted = extractable;
108 }
109 
110 void FontInfo::setNativeId( const QVariant &id )
111 {
112  d->nativeId = id;
113 }
114 
115 QVariant FontInfo::nativeId() const
116 {
117  return d->nativeId;
118 }
119 
120 bool FontInfo::operator==( const FontInfo &fi ) const
121 {
122  return *d == *fi.d;
123 }
124 
125 bool FontInfo::operator!=( const FontInfo &fi ) const
126 {
127  return !operator==( fi );
128 }
129 
130 FontInfo& FontInfo::operator=( const FontInfo &fi )
131 {
132  if ( this == &fi )
133  return *this;
134 
135  d = fi.d;
136  return *this;
137 }
138 
Okular::FontInfo::setFile
void setFile(const QString &file)
Definition: fontinfo.cpp:95
Okular::FontInfo::setEmbedType
void setEmbedType(EmbedType type)
Sets the type of font embedding.
Definition: fontinfo.cpp:85
Okular::FontInfo::~FontInfo
~FontInfo()
Destructor.
Definition: fontinfo.cpp:56
Okular::FontInfo::canBeExtracted
bool canBeExtracted() const
In case of embedded fonts, returns if the font can be extracted into a QByteArray.
Definition: fontinfo.cpp:100
Okular::FontInfo::setType
void setType(FontType type)
Change the type of the font.
Definition: fontinfo.cpp:75
Okular::FontInfo::type
FontType type() const
Returns the type of the font.
Definition: fontinfo.cpp:70
fontinfo.h
Okular::FontInfo::FontInfo
FontInfo()
Construct a new empty font info.
Definition: fontinfo.cpp:46
Okular::FontInfo::name
QString name() const
Returns the name of the font.
Definition: fontinfo.cpp:60
Okular::FontInfo::operator=
FontInfo & operator=(const FontInfo &fi)
Definition: fontinfo.cpp:130
Okular::FontInfo::operator==
bool operator==(const FontInfo &fi) const
Comparison operator.
Definition: fontinfo.cpp:120
Okular::FontInfo::setNativeId
void setNativeId(const QVariant &id)
Sets the "native" id of the font info.
Definition: fontinfo.cpp:110
Okular::FontInfo::file
QString file() const
In case of not embedded font, returns the path of the font that represents this font.
Definition: fontinfo.cpp:90
Okular::FontInfo
A small class that represents the information of a font.
Definition: fontinfo.h:27
Okular::FontInfo::setCanBeExtracted
void setCanBeExtracted(bool extractable)
Sets if a font can be extracted or not.
Definition: fontinfo.cpp:105
Okular::FontInfo::EmbedType
EmbedType
The possible kinds of embed.
Definition: fontinfo.h:58
Okular::FontInfo::nativeId
QVariant nativeId() const
Returns the "native" id of the font info.
Definition: fontinfo.cpp:115
Okular::FontInfo::FontType
FontType
The possible kinds of fonts.
Definition: fontinfo.h:35
Okular::FontInfo::embedType
EmbedType embedType() const
Returns the type of font embedding.
Definition: fontinfo.cpp:80
Okular::FontInfo::setName
void setName(const QString &name)
Sets a new name for the font.
Definition: fontinfo.cpp:65
Okular::FontInfo::operator!=
bool operator!=(const FontInfo &fi) const
Definition: fontinfo.cpp:125
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:45:02 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

okular

Skip menu "okular"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdegraphics API Reference

Skip menu "kdegraphics API Reference"
  •     libkdcraw
  •     libkexiv2
  •     libkipi
  •     libksane
  • okular

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal