1 /* 2 * This file is part of the render object implementation for KHTML. 3 * 4 * Copyright (C) 1999-2003 Lars Knoll (knoll@kde.org) 5 * (C) 1999-2003 Antti Koivisto (koivisto@kde.org) 6 * (C) 2002-2003 Dirk Mueller (mueller@kde.org) 7 * (C) 2003 Apple Computer, Inc. 8 * 9 * This library is free software; you can redistribute it and/or 10 * modify it under the terms of the GNU Library General Public 11 * License as published by the Free Software Foundation; either 12 * version 2 of the License, or (at your option) any later version. 13 * 14 * This library is distributed in the hope that it will be useful, 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 * Library General Public License for more details. 18 * 19 * You should have received a copy of the GNU Library General Public License 20 * along with this library; see the file COPYING.LIB. If not, write to 21 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22 * Boston, MA 02110-1301, USA. 23 * 24 */ 25 26 #ifndef RENDER_INLINE_H 27 #define RENDER_INLINE_H 28 29 #include "render_flow.h" 30 31 namespace khtml 32 { 33 34 class RenderInline : public RenderFlow 35 { 36 public: RenderInline(DOM::NodeImpl * node)37 RenderInline(DOM::NodeImpl *node) : RenderFlow(node), m_isContinuation(false) {} 38 39 const char *renderName() const override; 40 isRenderInline()41 bool isRenderInline() const override 42 { 43 return true; 44 } isInlineFlow()45 bool isInlineFlow() const override 46 { 47 return true; 48 } childrenInline()49 bool childrenInline() const override 50 { 51 return true; 52 } 53 54 bool isInlineContinuation() const override; 55 56 void addChildToFlow(RenderObject *newChild, RenderObject *beforeChild) override; 57 58 void splitInlines(RenderBlock *fromBlock, RenderBlock *toBlock, RenderBlock *middleBlock, 59 RenderObject *beforeChild, RenderFlow *oldCont); 60 61 void splitFlow(RenderObject *beforeChild, RenderBlock *newBlockBox, 62 RenderObject *newChild, RenderFlow *oldCont); 63 64 void setStyle(RenderStyle *_style) override; 65 void attach() override; 66 layout()67 void layout() override 68 { 69 setNeedsLayout(false); // Do nothing for layout() 70 } 71 72 void paint(PaintInfo &, int tx, int ty) override; 73 74 bool nodeAtPoint(NodeInfo &info, int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction, bool inside) override; 75 76 void calcMinMaxWidth() override; 77 78 // overrides RenderObject requiresLayer()79 bool requiresLayer() const override 80 { 81 return isRelPositioned(); 82 } 83 84 short width() const override; 85 int height() const override; 86 87 int inlineXPos() const override; 88 int inlineYPos() const override; 89 90 // used to calculate offsetWidth/Height. Overridden by inlines (render_flow) to return 91 // the remaining width on a given line (and the height of a single line). 92 int offsetLeft() const override; 93 int offsetTop() const override; 94 95 RenderPosition positionForCoordinates(int x, int y) override; 96 97 void caretPos(int offset, int flags, int &_x, int &_y, int &width, int &height) const override; 98 void paintOutlines(QPainter *p, int tx, int ty); 99 100 protected: 101 static RenderInline *cloneInline(RenderFlow *src); 102 void paintOutlinePath(QPainter *p, int tx, int ty, const QPoint *begin, const QPoint *end, BorderSide startingBS, int initialDirection, BorderSide endingBS); 103 104 private: 105 bool m_isContinuation : 1; // Whether or not we're a continuation of an inline. 106 107 }; 108 109 } // namespace 110 111 #endif // RENDER_BLOCK_H 112 113