#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 final : public RefCounted<WebKitNamedFlow>, public EventTargetWithInlineData {
public:
static Ref<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 EventTargetInterface eventTargetInterface() const override { return WebKitNamedFlowEventTargetInterfaceType; }
virtual ScriptExecutionContext* scriptExecutionContext() const override;
Node* ownerNode() const;
void setRenderer(RenderNamedFlowThread* parentFlowThread);
enum FlowState {
FlowStateCreated,
FlowStateNull
};
FlowState flowState() const { return m_parentFlowThread ? FlowStateCreated : FlowStateNull; }
void dispatchRegionOversetChangeEvent();
private:
WebKitNamedFlow(PassRefPtr<NamedFlowCollection>, const AtomicString&);
virtual void refEventTarget() override { ref(); }
virtual void derefEventTarget() override { deref(); }
AtomicString m_flowThreadName;
RefPtr<NamedFlowCollection> m_flowManager;
RenderNamedFlowThread* m_parentFlowThread;
};
}
#endif