2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2003, 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
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.
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.
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.
23 #ifndef RenderListMarker_h
24 #define RenderListMarker_h
26 #include "RenderBox.h"
32 String
listMarkerText(EListStyleType
, int value
);
34 // Used to render the list item's marker.
35 // The RenderListMarker always has to be a child of a RenderListItem.
36 class RenderListMarker
: public RenderBox
{
38 RenderListMarker(RenderListItem
*);
41 virtual const char* renderName() const { return "RenderListMarker"; }
43 virtual bool isListMarker() const { return true; }
45 virtual void paint(PaintInfo
&, int tx
, int ty
);
47 virtual void layout();
48 virtual void calcPrefWidths();
50 virtual void imageChanged(WrappedImagePtr
, const IntRect
* = 0);
52 virtual InlineBox
* createInlineBox(bool, bool, bool);
54 virtual int lineHeight(bool firstLine
, bool isRootLineBox
= false) const;
55 virtual int baselinePosition(bool firstLine
, bool isRootLineBox
= false) const;
58 bool isText() const { return !isImage(); }
59 const String
& text() const { return m_text
; }
61 bool isInside() const;
63 virtual SelectionState
selectionState() const { return m_selectionState
; }
64 virtual void setSelectionState(SelectionState
);
65 virtual IntRect
selectionRectForRepaint(RenderBox
* repaintContainer
, bool clipToVisibleContent
= true);
66 virtual bool canBeSelectionLeaf() const { return true; }
71 virtual void styleWillChange(StyleDifference
, const RenderStyle
* newStyle
);
72 virtual void styleDidChange(StyleDifference
, const RenderStyle
* oldStyle
);
75 IntRect
getRelativeMarkerRect();
78 RefPtr
<StyleImage
> m_image
;
79 RenderListItem
* m_listItem
;
80 SelectionState m_selectionState
;
83 } // namespace WebCore
85 #endif // RenderListMarker_h