1 /***************************************************************************
2 * Copyright (C) 2007 by Pino Toscano <pino@kde.org> *
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>
22 class FontInfoPrivate
;
25 * @short A small class that represents the information of a font.
27 class OKULAR_EXPORT FontInfo
30 typedef QList
<FontInfo
> List
;
33 * The possible kinds of fonts.
52 * The possible kinds of embed.
62 * Construct a new empty font info.
68 FontInfo( const FontInfo
&fi
);
75 * Returns the name of the font.
79 * Sets a new name for the font.
81 void setName( const QString
& name
);
84 * Returns the type of the font.
86 FontType
type() const;
88 * Change the type of the font.
90 void setType( FontType type
);
93 * Returns the type of font embedding.
95 EmbedType
embedType() const;
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
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;
149 friend class FontInfoPrivate
;
151 QSharedDataPointer
<FontInfoPrivate
> d
;
156 Q_DECLARE_METATYPE(Okular::FontInfo
)