]>
git.saurik.com Git - iphone-api.git/blob - WebCore/RenderButton.h
2 * This file is part of the html renderer for KDE.
4 * Copyright (C) 2005 Apple Computer
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 RenderButton_h
24 #define RenderButton_h
26 #include "RenderFlexibleBox.h"
28 #include <wtf/OwnPtr.h>
32 class RenderTextFragment
;
34 // RenderButtons are just like normal flexboxes except that they will generate an anonymous block child.
35 // For inputs, they will also generate an anonymous RenderText and keep its style and content up
36 // to date as the button changes.
37 class RenderButton
: public RenderFlexibleBox
{
41 virtual const char* renderName() const { return "RenderButton"; }
43 virtual void addChild(RenderObject
* newChild
, RenderObject
*beforeChild
= 0);
44 virtual void removeChild(RenderObject
*);
45 virtual void removeLeftoverAnonymousBlock(RenderBlock
*) { }
46 virtual bool createsAnonymousWrapper() const { return true; }
48 void setupInnerStyle(RenderStyle
*);
49 virtual void updateFromElement();
51 virtual void updateBeforeAfterContent(RenderStyle::PseudoId
);
53 virtual bool hasControlClip() const { return true; }
54 virtual IntRect
controlClipRect(int /*tx*/, int /*ty*/) const;
56 void setText(const String
&);
58 virtual bool canHaveChildren() const;
60 virtual void layout();
63 virtual void styleWillChange(StyleDifference
, const RenderStyle
* newStyle
);
64 virtual void styleDidChange(StyleDifference
, const RenderStyle
* oldStyle
);
66 virtual bool hasLineIfEmpty() const { return true; }
68 void timerFired(Timer
<RenderButton
>*);
70 RenderTextFragment
* m_buttonText
;
73 OwnPtr
<Timer
<RenderButton
> > m_timer
;
77 } // namespace WebCore
79 #endif // RenderButton_h