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; } |
42 | 43 |
43 virtual void addChild(RenderObject* newChild, RenderObject *beforeChild = 0)
; | 44 virtual void addChild(RenderObject* newChild, RenderObject *beforeChild = 0)
; |
44 virtual void removeChild(RenderObject*); | 45 virtual void removeChild(RenderObject*); |
45 virtual void removeLeftoverAnonymousBlock(RenderBlock*) { } | 46 virtual void removeLeftoverAnonymousBlock(RenderBlock*) { } |
46 virtual bool createsAnonymousWrapper() const { return true; } | 47 virtual bool createsAnonymousWrapper() const { return true; } |
47 | 48 |
48 void setupInnerStyle(RenderStyle*); | 49 void setupInnerStyle(RenderStyle*); |
49 virtual void updateFromElement(); | 50 virtual void updateFromElement(); |
50 | 51 |
51 virtual void updateBeforeAfterContent(PseudoId); | 52 virtual void updateBeforeAfterContent(PseudoId); |
(...skipping 13 matching lines...) Expand all Loading... |
65 | 66 |
66 void timerFired(Timer<RenderButton>*); | 67 void timerFired(Timer<RenderButton>*); |
67 | 68 |
68 RenderTextFragment* m_buttonText; | 69 RenderTextFragment* m_buttonText; |
69 RenderBlock* m_inner; | 70 RenderBlock* m_inner; |
70 | 71 |
71 OwnPtr<Timer<RenderButton> > m_timer; | 72 OwnPtr<Timer<RenderButton> > m_timer; |
72 bool m_default; | 73 bool m_default; |
73 }; | 74 }; |
74 | 75 |
| 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 |
75 } // namespace WebCore | 91 } // namespace WebCore |
76 | 92 |
77 #endif // RenderButton_h | 93 #endif // RenderButton_h |
OLD | NEW |