blob: 5e974a77fb9ecf2b42f27dffebd2b67a6e9b8431 [file] [log] [blame]
eseidel5fced7c2007-10-23 00:38:49 +00001/*
zimmermann@webkit.org711245f2010-08-03 19:39:01 +00002 * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
4 * Copyright (C) 2008 Apple Inc. All rights reserved.
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
15 *
16 * You should have received a copy of the GNU Library General Public License
17 * along with this library; see the file COPYING.LIB. If not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
20 */
eseidel5fced7c2007-10-23 00:38:49 +000021
22#ifndef SVGFontFaceElement_h
23#define SVGFontFaceElement_h
eseidel5fced7c2007-10-23 00:38:49 +000024
zimmermann@webkit.orgce57f042007-12-29 02:41:53 +000025#if ENABLE(SVG_FONTS)
eseidel5fced7c2007-10-23 00:38:49 +000026#include "SVGElement.h"
27
28namespace WebCore {
zimmermann@webkit.orgce57f042007-12-29 02:41:53 +000029
krit@webkit.org6a0cb5b2010-12-22 20:15:51 +000030class CSSFontFaceRule;
31class CSSMutableStyleDeclaration;
32class SVGFontElement;
zimmermann@webkit.orgce57f042007-12-29 02:41:53 +000033
krit@webkit.org6a0cb5b2010-12-22 20:15:51 +000034class SVGFontFaceElement : public SVGElement {
35public:
36 static PassRefPtr<SVGFontFaceElement> create(const QualifiedName&, Document*);
darin@apple.com3cbd5cb2010-08-30 06:51:56 +000037
krit@webkit.org6a0cb5b2010-12-22 20:15:51 +000038 unsigned unitsPerEm() const;
39 int xHeight() const;
40 float horizontalOriginX() const;
41 float horizontalOriginY() const;
42 float horizontalAdvanceX() const;
43 float verticalOriginX() const;
44 float verticalOriginY() const;
45 float verticalAdvanceY() const;
46 int ascent() const;
47 int descent() const;
48 String fontFamily() const;
zimmermann@webkit.orgce57f042007-12-29 02:41:53 +000049
krit@webkit.org6a0cb5b2010-12-22 20:15:51 +000050 SVGFontElement* associatedFontElement() const { return m_fontElement; }
51 void rebuildFontFace();
52 void removeFromMappedElementSheet();
zimmermann@webkit.orgce57f042007-12-29 02:41:53 +000053
krit@webkit.org6a0cb5b2010-12-22 20:15:51 +000054private:
55 SVGFontFaceElement(const QualifiedName&, Document*);
darin@apple.comc8b8f872010-08-30 18:44:06 +000056
krit@webkit.org6a0cb5b2010-12-22 20:15:51 +000057 virtual void parseMappedAttribute(Attribute*);
darin@apple.comc8b8f872010-08-30 18:44:06 +000058
krit@webkit.org6a0cb5b2010-12-22 20:15:51 +000059 virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
60 virtual void insertedIntoDocument();
61 virtual void removedFromDocument();
darin@apple.comc8b8f872010-08-30 18:44:06 +000062
krit@webkit.org6a0cb5b2010-12-22 20:15:51 +000063 RefPtr<CSSFontFaceRule> m_fontFaceRule;
64 RefPtr<CSSMutableStyleDeclaration> m_styleDeclaration;
zimmermann@webkit.orga81a0532008-01-21 22:56:53 +000065
krit@webkit.org6a0cb5b2010-12-22 20:15:51 +000066 SVGFontElement* m_fontElement;
67};
eseidel5fced7c2007-10-23 00:38:49 +000068
69} // namespace WebCore
70
zimmermann@webkit.orgce57f042007-12-29 02:41:53 +000071#endif // ENABLE(SVG_FONTS)
eseidel5fced7c2007-10-23 00:38:49 +000072#endif
73
74// vim:ts=4:noet