hyatt | 82bdd23 | 2005-10-21 21:27:51 +0000 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the html renderer for KDE. |
| 3 | * |
| 4 | * Copyright (C) 2005 Apple Computer |
| 5 | * |
| 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. |
| 10 | * |
| 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. |
| 15 | * |
| 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., 59 Temple Place - Suite 330, |
| 19 | * Boston, MA 02111-1307, USA. |
| 20 | * |
| 21 | */ |
darin | 9d0a628 | 2006-03-01 07:49:33 +0000 | [diff] [blame] | 22 | |
hyatt | 82bdd23 | 2005-10-21 21:27:51 +0000 | [diff] [blame] | 23 | #ifndef render_button_h |
| 24 | #define render_button_h |
| 25 | |
darin | b9481ed | 2006-03-20 02:57:59 +0000 | [diff] [blame^] | 26 | #include "RenderFlexibleBox.h" |
hyatt | 82bdd23 | 2005-10-21 21:27:51 +0000 | [diff] [blame] | 27 | |
darin | 9d0a628 | 2006-03-01 07:49:33 +0000 | [diff] [blame] | 28 | namespace WebCore { |
hyatt | 82bdd23 | 2005-10-21 21:27:51 +0000 | [diff] [blame] | 29 | |
| 30 | // RenderButtons are just like normal flexboxes except that they will generate an anonymous block child. |
| 31 | // For inputs, they will also generate an anonymous RenderText and keep its style and content up |
| 32 | // to date as the button changes. |
| 33 | class RenderButton : public RenderFlexibleBox |
| 34 | { |
| 35 | public: |
darin | b9481ed | 2006-03-20 02:57:59 +0000 | [diff] [blame^] | 36 | RenderButton(Node*); |
hyatt | 82bdd23 | 2005-10-21 21:27:51 +0000 | [diff] [blame] | 37 | |
darin | 9d0a628 | 2006-03-01 07:49:33 +0000 | [diff] [blame] | 38 | virtual void addChild(RenderObject* newChild, RenderObject *beforeChild = 0); |
| 39 | virtual void removeChild(RenderObject* oldChild); |
| 40 | virtual void removeLeftoverAnonymousBoxes() {} |
hyatt | 82bdd23 | 2005-10-21 21:27:51 +0000 | [diff] [blame] | 41 | |
darin | 9d0a628 | 2006-03-01 07:49:33 +0000 | [diff] [blame] | 42 | virtual void setStyle(RenderStyle*); |
hyatt | 82bdd23 | 2005-10-21 21:27:51 +0000 | [diff] [blame] | 43 | virtual void updateFromElement(); |
| 44 | |
darin | 9d0a628 | 2006-03-01 07:49:33 +0000 | [diff] [blame] | 45 | virtual void paintObject(PaintInfo&, int tx, int ty); |
hyatt | ebae6a8 | 2005-10-22 18:19:27 +0000 | [diff] [blame] | 46 | |
hyatt | 82bdd23 | 2005-10-21 21:27:51 +0000 | [diff] [blame] | 47 | virtual const char *renderName() const { return "RenderButton"; } |
| 48 | |
| 49 | protected: |
| 50 | RenderText* m_buttonText; |
| 51 | RenderBlock* m_inner; |
| 52 | }; |
| 53 | |
darin | 9d0a628 | 2006-03-01 07:49:33 +0000 | [diff] [blame] | 54 | } |
| 55 | |
hyatt | 82bdd23 | 2005-10-21 21:27:51 +0000 | [diff] [blame] | 56 | #endif |