2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2009, 2010 Apple Inc. All rights reserved.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
22 #ifndef RenderWidget_h
23 #define RenderWidget_h
25 #include "core/rendering/RenderReplaced.h"
26 #include "platform/Widget.h"
30 class RenderWidget : public RenderReplaced {
32 virtual ~RenderWidget();
34 Widget* widget() const { return m_widget.get(); }
35 virtual void setWidget(PassRefPtr<Widget>);
37 void updateWidgetPosition();
38 void widgetPositionsUpdated();
40 void setIsOverlapped(bool);
42 void ref() { ++m_refCount; }
45 class UpdateSuspendScope {
48 ~UpdateSuspendScope();
52 explicit RenderWidget(Element*);
56 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) OVERRIDE FINAL;
57 virtual void layout() OVERRIDE;
58 virtual void paint(PaintInfo&, const LayoutPoint&) OVERRIDE;
59 virtual CursorDirective getCursor(const LayoutPoint&, Cursor&) const OVERRIDE FINAL;
60 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) OVERRIDE;
62 virtual void paintContents(PaintInfo&, const LayoutPoint&);
65 virtual bool isWidget() const OVERRIDE FINAL { return true; }
67 virtual void willBeDestroyed() OVERRIDE FINAL;
68 virtual void destroy() OVERRIDE FINAL;
70 bool setWidgetGeometry(const LayoutRect&);
71 bool updateWidgetGeometry();
73 RefPtr<Widget> m_widget;
77 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderWidget, isWidget());
79 } // namespace WebCore
81 #endif // RenderWidget_h