1 /* 2 * Copyright (C) 1999 Lars Knoll (knoll (at) kde.org) 3 * (C) 2000 Simon Hausmann <hausmann (at) kde.org> 4 * Copyright (C) 2006, 2009 Apple Inc. All rights reserved. 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., 51 Franklin Street, Fifth Floor, 19 * Boston, MA 02110-1301, USA. 20 * 21 */ 22 23 #ifndef RenderPart_h 24 #define RenderPart_h 25 26 #include "RenderWidget.h" 27 28 namespace WebCore { 29 30 // Renderer for frames via RenderPartObject, and plug-ins via RenderEmbeddedObject. 31 32 // FIXME: This class is subclassed in RenderPartObject for iframes, which is in turn 33 // subclassed in RenderEmbeddedObject for object and embed. This class itself could be removed. 34 class RenderPart : public RenderWidget { 35 public: 36 RenderPart(Element*); 37 virtual ~RenderPart(); 38 39 bool hasFallbackContent() const { return m_hasFallbackContent; } 40 41 virtual void setWidget(PassRefPtr<Widget>); 42 virtual void viewCleared(); 43 44 protected: 45 bool m_hasFallbackContent; 46 47 private: 48 virtual bool isRenderPart() const { return true; } 49 virtual const char* renderName() const { return "RenderPart"; } 50 }; 51 52 inline RenderPart* toRenderPart(RenderObject* object) 53 { 54 ASSERT(!object || object->isRenderPart()); 55 return static_cast<RenderPart*>(object); 56 } 57 58 // This will catch anyone doing an unnecessary cast. 59 void toRenderPart(const RenderPart*); 60 61 } 62 63 #endif 64