#ifndef DOMSettableTokenList_h
#define DOMSettableTokenList_h
#include "core/dom/DOMTokenList.h"
#include "core/dom/SpaceSplitString.h"
#include "wtf/RefCounted.h"
#include "wtf/text/AtomicString.h"
namespace WebCore {
class ExceptionState;
class DOMSettableTokenList FINAL : public DOMTokenList, public RefCounted<DOMSettableTokenList> {
WTF_MAKE_FAST_ALLOCATED;
public:
static PassRefPtr<DOMSettableTokenList> create()
{
return adoptRef(new DOMSettableTokenList());
}
virtual ~DOMSettableTokenList();
virtual void ref() OVERRIDE { RefCounted<DOMSettableTokenList>::ref(); }
virtual void deref() OVERRIDE { RefCounted<DOMSettableTokenList>::deref(); }
virtual unsigned length() const OVERRIDE { return m_tokens.size(); }
virtual const AtomicString item(unsigned index) const OVERRIDE;
virtual void add(const Vector<String>&, ExceptionState&) OVERRIDE;
virtual void remove(const Vector<String>&, ExceptionState&) OVERRIDE;
virtual const AtomicString& value() const OVERRIDE { return m_value; }
virtual void setValue(const AtomicString&) OVERRIDE;
const SpaceSplitString& tokens() const { return m_tokens; }
protected:
DOMSettableTokenList();
private:
virtual void addInternal(const AtomicString&) OVERRIDE;
virtual bool containsInternal(const AtomicString&) const OVERRIDE;
virtual void removeInternal(const AtomicString&) OVERRIDE;
AtomicString m_value;
SpaceSplitString m_tokens;
};
}
#endif