#ifndef WebRenderObject_h
#define WebRenderObject_h
#include "APIObject.h"
#include "MutableArray.h"
#include <WebCore/IntRect.h>
#include <wtf/PassRefPtr.h>
#include <wtf/Vector.h>
#include <wtf/text/WTFString.h>
namespace WebCore {
class RenderObject;
}
namespace WebKit {
class WebPage;
class WebRenderObject : public APIObject {
public:
static const Type APIType = TypeRenderObject;
static PassRefPtr<WebRenderObject> create(WebPage*);
static PassRefPtr<WebRenderObject> create(const String& name, WebCore::IntPoint absolutePosition, WebCore::IntRect frameRect, PassRefPtr<MutableArray> children)
{
return adoptRef(new WebRenderObject(name, absolutePosition, frameRect, children));
}
RefPtr<ImmutableArray> children() const { return m_children; }
const String& name() const { return m_name; }
WebCore::IntPoint absolutePosition() const { return m_absolutePosition; }
WebCore::IntRect frameRect() const { return m_frameRect; }
private:
WebRenderObject(WebCore::RenderObject*);
WebRenderObject(const String& name, WebCore::IntPoint absolutePosition, WebCore::IntRect frameRect, PassRefPtr<MutableArray> children)
: m_children(children)
, m_name(name)
, m_absolutePosition(absolutePosition)
, m_frameRect(frameRect)
{
}
virtual Type type() const OVERRIDE { return APIType; }
RefPtr<MutableArray> m_children;
String m_name;
WebCore::IntPoint m_absolutePosition;
WebCore::IntRect m_frameRect;
};
}
#endif // WebRenderObject_h