KHTML
SVGFontElement.h
Go to the documentation of this file.
00001 /* 00002 Copyright (C) 2007 Eric Seidel <eric@webkit.org> 00003 Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public License 00016 along with this library; see the file COPYING.LIB. If not, write to 00017 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00018 Boston, MA 02110-1301, USA. 00019 */ 00020 00021 #ifndef SVGFontElement_h 00022 #define SVGFontElement_h 00023 00024 #if ENABLE(SVG_FONTS) 00025 #include "SVGExternalResourcesRequired.h" 00026 #include "SVGGlyphElement.h" 00027 #include "SVGGlyphMap.h" 00028 #include "SVGHKernElement.h" 00029 #include "SVGStyledElement.h" 00030 00031 namespace WebCore { 00032 00033 class SVGMissingGlyphElement; 00034 class SVGFontElement : public SVGStyledElement 00035 , public SVGExternalResourcesRequired { 00036 public: 00037 SVGFontElement(const QualifiedName&, Document*); 00038 virtual ~SVGFontElement(); 00039 00040 virtual bool rendererIsNeeded(RenderStyle*) { return false; } 00041 virtual const SVGElement* contextElement() const { return this; } 00042 00043 void invalidateGlyphCache(); 00044 00045 void getGlyphIdentifiersForString(const String&, Vector<SVGGlyphIdentifier>&) const; 00046 00047 bool getHorizontalKerningPairForStringsAndGlyphs(const String& u1, const String& g1, const String& u2, const String& g2, SVGHorizontalKerningPair& kerningPair) const; 00048 00049 SVGMissingGlyphElement* firstMissingGlyphElement() const; 00050 00051 // KHTML ElementImpl pure virtual method 00052 virtual quint32 id() const { return SVGNames::textTag.id(); } 00053 private: 00054 void ensureGlyphCache() const; 00055 00056 typedef Vector<SVGHorizontalKerningPair> KerningPairVector; 00057 00058 mutable KerningPairVector m_kerningPairs; 00059 mutable SVGGlyphMap m_glyphMap; 00060 mutable bool m_isGlyphCacheValid; 00061 }; 00062 00063 } // namespace WebCore 00064 00065 #endif // ENABLE(SVG_FONTS) 00066 #endif 00067 00068 // vim:ts=4:noet
KDE 4.6 API Reference