Warning, file /frameworks/khtml/src/rendering/SVGInlineTextBox.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /* 0002 * This file is part of the DOM implementation for KDE. 0003 * 0004 * Copyright (C) 2007 Rob Buis <buis@kde.org> 0005 * (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> 0006 * 0007 * This library is free software; you can redistribute it and/or 0008 * modify it under the terms of the GNU Library General Public 0009 * License as published by the Free Software Foundation; either 0010 * version 2 of the License, or (at your option) any later version. 0011 * 0012 * This library is distributed in the hope that it will be useful, 0013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0015 * Library General Public License for more details. 0016 * 0017 * You should have received a copy of the GNU Library General Public License 0018 * along with this library; see the file COPYING.LIB. If not, write to 0019 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 0020 * Boston, MA 02110-1301, USA. 0021 * 0022 */ 0023 0024 #ifndef SVGInlineTextBox_h 0025 #define SVGInlineTextBox_h 0026 0027 #if ENABLE(SVG) 0028 //#include "InlineTextBox.h" 0029 #include "rendering/render_text.h" 0030 #include "svg/graphics/SVGPaintServer.h" 0031 0032 namespace WebCore 0033 { 0034 using namespace khtml; 0035 0036 struct SVGChar; 0037 class SVGRootInlineBox; 0038 struct SVGTextDecorationInfo; 0039 0040 class SVGInlineTextBox : public InlineTextBox 0041 { 0042 public: 0043 SVGInlineTextBox(RenderObject *obj); 0044 0045 virtual int selectionTop(); 0046 virtual int selectionHeight(); 0047 0048 virtual int offsetForPosition(int x, bool includePartialGlyphs = true) const; 0049 virtual int positionForOffset(int offset) const; 0050 0051 /*virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty);*/ 0052 virtual IntRect selectionRect(int absx, int absy, int startPos, int endPos); 0053 0054 // SVGs custom paint text method 0055 void paintCharacters(RenderObject::PaintInfo &, int tx, int ty, const SVGChar &, const UChar *chars, int length, SVGPaintServer *); 0056 0057 // SVGs custom paint selection method 0058 void paintSelection(int boxStartOffset, const SVGChar &, const UChar *, int length, RenderObject::PaintInfo &, RenderStyle *, const Font *); 0059 0060 // SVGs custom paint decoration method 0061 void paintDecoration(ETextDecoration, RenderObject::PaintInfo &, int tx, int ty, int width, const SVGChar &, const SVGTextDecorationInfo &); 0062 0063 SVGRootInlineBox *svgRootInlineBox() const; 0064 0065 // Helper functions shared with SVGRootInlineBox 0066 float calculateGlyphWidth(RenderStyle *style, int offset, int extraCharsAvailable, int &charsConsumed, String &glyphName) const; 0067 float calculateGlyphHeight(RenderStyle *, int offset, int extraCharsAvailable) const; 0068 0069 FloatRect calculateGlyphBoundaries(RenderStyle *, int offset, const SVGChar &) const; 0070 SVGChar *closestCharacterToPosition(int x, int y, int &offset) const; 0071 0072 private: 0073 friend class RenderSVGInlineText; 0074 bool svgCharacterHitsPosition(int x, int y, int &offset) const; 0075 }; 0076 0077 } // namespace WebCore 0078 0079 #endif 0080 #endif // SVGInlineTextBox_h