Warning, file /office/calligra/libs/odf/KoFontFace.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /* This file is part of the KDE project 0002 Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 0003 0004 Contact: Suresh Chande suresh.chande@nokia.com 0005 0006 This library is free software; you can redistribute it and/or 0007 modify it under the terms of the GNU Library General Public 0008 License as published by the Free Software Foundation; either 0009 version 2 of the License, or (at your option) any later version. 0010 0011 This library is distributed in the hope that it will be useful, 0012 but WITHOUT ANY WARRANTY; without even the implied warranty of 0013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0014 Library General Public License for more details. 0015 0016 You should have received a copy of the GNU Library General Public License 0017 along with this library; see the file COPYING.LIB. If not, write to 0018 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 0019 * Boston, MA 02110-1301, USA. 0020 */ 0021 0022 #ifndef KOFONTFACE_H 0023 #define KOFONTFACE_H 0024 0025 #include <QString> 0026 #include <QSharedData> 0027 #include "koodf_export.h" 0028 0029 class KoXmlWriter; 0030 class KoFontFacePrivate; 0031 0032 /** 0033 * @brief Represents font style. 0034 * Font style is defined by the style:font-face element. 0035 * @todo add more parameters. 0036 * @todo add class KoFontFaceDeclarations instead of adding methods to KoGenStyle? 0037 */ 0038 class KOODF_EXPORT KoFontFace 0039 { 0040 public: 0041 /** 0042 * Constructor. Creates font face definition with empty parameters. 0043 * 0044 * @param name the font name. 0045 * 0046 * The other are empty. If you don't pass the name, the font face will be considered null. 0047 * @see isEmpty() 0048 */ 0049 explicit KoFontFace(const QString &name = QString()); 0050 0051 /** 0052 * Copy constructor. 0053 */ 0054 KoFontFace(const KoFontFace &other); 0055 0056 /** 0057 * Destructor. 0058 */ 0059 ~KoFontFace(); 0060 0061 /** 0062 * @return true if the font face object is null, i.e. has no name assigned. 0063 */ 0064 bool isNull() const; 0065 0066 KoFontFace& operator=(const KoFontFace &other); 0067 0068 bool operator==(const KoFontFace &other) const; 0069 0070 enum Pitch { 0071 FixedPitch, 0072 VariablePitch 0073 }; 0074 //! @todo add enum FamilyGeneric? 0075 0076 QString name() const; 0077 void setName(const QString &name); 0078 QString family() const; 0079 void setFamily(const QString &family); 0080 QString familyGeneric() const; 0081 void setFamilyGeneric(const QString &familyGeneric); 0082 QString style() const; 0083 void setStyle(const QString &style); 0084 KoFontFace::Pitch pitch() const; 0085 void setPitch(KoFontFace::Pitch pitch); 0086 0087 /** Saves font face definition into @a xmlWriter as a style:font-face element. 0088 */ 0089 void saveOdf(KoXmlWriter *xmlWriter) const; 0090 0091 private: 0092 QSharedDataPointer<KoFontFacePrivate> d; 0093 }; 0094 0095 #endif /* KOFONTFACE_H */