#ifndef WebKitNamedFlow_h
#define WebKitNamedFlow_h
#include "EventTarget.h"
#include <wtf/ListHashSet.h>
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
#include <wtf/text/AtomicString.h>
namespace WebCore {
class Document;
class NamedFlowCollection;
class Node;
class NodeList;
class RenderNamedFlowThread;
class ScriptExecutionContext;
class WebKitNamedFlow : public RefCounted<WebKitNamedFlow>, public EventTarget {
public:
static PassRefPtr<WebKitNamedFlow> create(PassRefPtr<NamedFlowCollection> manager, const AtomicString& flowThreadName);
~WebKitNamedFlow();
const AtomicString& name() const;
bool overset() const;
int firstEmptyRegionIndex() const;
PassRefPtr<NodeList> getRegionsByContent(Node*);
PassRefPtr<NodeList> getRegions();
PassRefPtr<NodeList> getContent();
using RefCounted<WebKitNamedFlow>::ref;
using RefCounted<WebKitNamedFlow>::deref;
virtual const AtomicString& interfaceName() const;
virtual ScriptExecutionContext* scriptExecutionContext() const;
Node* ownerNode() const;
void setRenderer(RenderNamedFlowThread* parentFlowThread);
enum FlowState {
FlowStateCreated,
FlowStateNull
};
FlowState flowState() const { return m_parentFlowThread ? FlowStateCreated : FlowStateNull; }
void dispatchRegionLayoutUpdateEvent();
private:
WebKitNamedFlow(PassRefPtr<NamedFlowCollection>, const AtomicString&);
virtual void refEventTarget() { ref(); }
virtual void derefEventTarget() { deref(); }
virtual EventTargetData* eventTargetData() OVERRIDE;
virtual EventTargetData* ensureEventTargetData() OVERRIDE;
AtomicString m_flowThreadName;
RefPtr<NamedFlowCollection> m_flowManager;
RenderNamedFlowThread* m_parentFlowThread;
EventTargetData m_eventTargetData;
};
}
#endif