blob: be0c665cfaee6fbc205682df973f54313edbf515 [file] [log] [blame]
hyatt82bdd232005-10-21 21:27:51 +00001/*
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 */
darin9d0a6282006-03-01 07:49:33 +000022
hyatt82bdd232005-10-21 21:27:51 +000023#ifndef render_button_h
24#define render_button_h
25
darinb9481ed2006-03-20 02:57:59 +000026#include "RenderFlexibleBox.h"
hyatt82bdd232005-10-21 21:27:51 +000027
darin9d0a6282006-03-01 07:49:33 +000028namespace WebCore {
hyatt82bdd232005-10-21 21:27:51 +000029
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.
33class RenderButton : public RenderFlexibleBox
34{
35public:
darinb9481ed2006-03-20 02:57:59 +000036 RenderButton(Node*);
hyatt82bdd232005-10-21 21:27:51 +000037
darin9d0a6282006-03-01 07:49:33 +000038 virtual void addChild(RenderObject* newChild, RenderObject *beforeChild = 0);
39 virtual void removeChild(RenderObject* oldChild);
40 virtual void removeLeftoverAnonymousBoxes() {}
hyatt82bdd232005-10-21 21:27:51 +000041
darin9d0a6282006-03-01 07:49:33 +000042 virtual void setStyle(RenderStyle*);
hyatt82bdd232005-10-21 21:27:51 +000043 virtual void updateFromElement();
44
darin9d0a6282006-03-01 07:49:33 +000045 virtual void paintObject(PaintInfo&, int tx, int ty);
hyattebae6a82005-10-22 18:19:27 +000046
hyatt82bdd232005-10-21 21:27:51 +000047 virtual const char *renderName() const { return "RenderButton"; }
48
49protected:
50 RenderText* m_buttonText;
51 RenderBlock* m_inner;
52};
53
darin9d0a6282006-03-01 07:49:33 +000054}
55
hyatt82bdd232005-10-21 21:27:51 +000056#endif