compile
[kdegraphics.git] / okular / core / fontinfo.h
blob338ac4a957f418051925821bad214f442fd876da
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 #ifndef _OKULAR_FONTINFO_H_
11 #define _OKULAR_FONTINFO_H_
13 #include <QtCore/QList>
14 #include <QtCore/QMetaType>
15 #include <QtCore/QSharedDataPointer>
16 #include <QtCore/QString>
18 #include <okular/core/okular_export.h>
20 namespace Okular {
22 class FontInfoPrivate;
24 /**
25 * @short A small class that represents the information of a font.
27 class OKULAR_EXPORT FontInfo
29 public:
30 typedef QList<FontInfo> List;
32 /**
33 * The possible kinds of fonts.
35 enum FontType
37 Unknown,
38 Type1,
39 Type1C,
40 Type1COT,
41 Type3,
42 TrueType,
43 TrueTypeOT,
44 CIDType0,
45 CIDType0C,
46 CIDType0COT,
47 CIDTrueType,
48 CIDTrueTypeOT
51 /**
52 * The possible kinds of embed.
54 enum EmbedType
56 NotEmbedded,
57 EmbeddedSubset,
58 FullyEmbedded
61 /**
62 * Construct a new empty font info.
64 FontInfo();
65 /**
66 * Copy constructor.
68 FontInfo( const FontInfo &fi );
69 /**
70 * Destructor.
72 ~FontInfo();
74 /**
75 * Returns the name of the font.
77 QString name() const;
78 /**
79 * Sets a new name for the font.
81 void setName( const QString& name );
83 /**
84 * Returns the type of the font.
86 FontType type() const;
87 /**
88 * Change the type of the font.
90 void setType( FontType type );
92 /**
93 * Returns the type of font embedding.
95 EmbedType embedType() const;
96 /**
97 * Sets the type of font embedding.
99 void setEmbedType( EmbedType type );
102 * In case of not embedded font, returns the path of the font that
103 * represents this font.
105 QString file() const;
106 void setFile( const QString& file );
109 * In case of embedded fonts, returns if the font can be extracted into a QByteArray
111 * @since 0.8 (KDE 4.2)
113 bool canBeExtracted() const;
116 * Sets if a font can be extracted or not. False by default
118 void setCanBeExtracted( bool extractable );
121 * Sets the "native" @p id of the font info.
123 * This is for use of the Generator, that can optionally store an
124 * handle (a pointer, an identifier, etc) of the "native" font
125 * object, if any.
127 * @since 0.8 (KDE 4.2)
129 void setNativeId( const QVariant &id );
132 * Returns the "native" id of the font info.
134 * @since 0.8 (KDE 4.2)
136 QVariant nativeId() const;
138 FontInfo& operator=( const FontInfo &fi );
141 * Comparison operator.
143 bool operator==( const FontInfo &fi ) const;
145 bool operator!=( const FontInfo &fi ) const;
147 private:
148 /// @cond PRIVATE
149 friend class FontInfoPrivate;
150 /// @endcond
151 QSharedDataPointer<FontInfoPrivate> d;
156 Q_DECLARE_METATYPE(Okular::FontInfo)
158 #endif