OLD | NEW |
1 /* | 1 /* |
2 * This file is part of the html renderer for KDE. | 2 * This file is part of the html renderer for KDE. |
3 * | 3 * |
4 * Copyright (C) 2005 Apple Computer | 4 * Copyright (C) 2005 Apple Computer |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 21 matching lines...) Expand all Loading... |
32 class RenderTextFragment; | 32 class RenderTextFragment; |
33 | 33 |
34 // RenderButtons are just like normal flexboxes except that they will generate a
n anonymous block child. | 34 // RenderButtons are just like normal flexboxes except that they will generate a
n anonymous block child. |
35 // For inputs, they will also generate an anonymous RenderText and keep its styl
e and content up | 35 // For inputs, they will also generate an anonymous RenderText and keep its styl
e and content up |
36 // to date as the button changes. | 36 // to date as the button changes. |
37 class RenderButton : public RenderFlexibleBox { | 37 class RenderButton : public RenderFlexibleBox { |
38 public: | 38 public: |
39 RenderButton(Node*); | 39 RenderButton(Node*); |
40 | 40 |
41 virtual const char* renderName() const { return "RenderButton"; } | 41 virtual const char* renderName() const { return "RenderButton"; } |
42 virtual bool isRenderButton() const { return true; } | |
43 | 42 |
44 virtual void addChild(RenderObject* newChild, RenderObject *beforeChild = 0)
; | 43 virtual void addChild(RenderObject* newChild, RenderObject *beforeChild = 0)
; |
45 virtual void removeChild(RenderObject*); | 44 virtual void removeChild(RenderObject*); |
46 virtual void removeLeftoverAnonymousBlock(RenderBlock*) { } | 45 virtual void removeLeftoverAnonymousBlock(RenderBlock*) { } |
47 virtual bool createsAnonymousWrapper() const { return true; } | 46 virtual bool createsAnonymousWrapper() const { return true; } |
48 | 47 |
49 void setupInnerStyle(RenderStyle*); | 48 void setupInnerStyle(RenderStyle*); |
50 virtual void updateFromElement(); | 49 virtual void updateFromElement(); |
51 | 50 |
52 virtual void updateBeforeAfterContent(PseudoId); | 51 virtual void updateBeforeAfterContent(PseudoId); |
(...skipping 13 matching lines...) Expand all Loading... |
66 | 65 |
67 void timerFired(Timer<RenderButton>*); | 66 void timerFired(Timer<RenderButton>*); |
68 | 67 |
69 RenderTextFragment* m_buttonText; | 68 RenderTextFragment* m_buttonText; |
70 RenderBlock* m_inner; | 69 RenderBlock* m_inner; |
71 | 70 |
72 OwnPtr<Timer<RenderButton> > m_timer; | 71 OwnPtr<Timer<RenderButton> > m_timer; |
73 bool m_default; | 72 bool m_default; |
74 }; | 73 }; |
75 | 74 |
76 inline RenderButton* toRenderButton(RenderObject* o) | |
77 { | |
78 ASSERT(!o || o->isRenderButton()); | |
79 return static_cast<RenderButton*>(o); | |
80 } | |
81 | |
82 inline const RenderButton* toRenderButton(const RenderObject* o) | |
83 { | |
84 ASSERT(!o || o->isRenderButton()); | |
85 return static_cast<const RenderButton*>(o); | |
86 } | |
87 | |
88 // This will catch anyone doing an unnecessary cast. | |
89 void toRenderButton(const RenderButton*); | |
90 | |
91 } // namespace WebCore | 75 } // namespace WebCore |
92 | 76 |
93 #endif // RenderButton_h | 77 #endif // RenderButton_h |
OLD | NEW |