WebOptionElement.cpp [plain text]
#include "config.h"
#include "WebOptionElement.h"
#include "HTMLNames.h"
#include "HTMLOptionElement.h"
#include "HTMLSelectElement.h"
#include "platform/WebString.h"
#include <wtf/PassRefPtr.h>
using namespace WebCore;
using namespace HTMLNames;
namespace WebKit {
void WebOptionElement::setValue(const WebString& newValue)
{
return unwrap<HTMLOptionElement>()->setValue(newValue);
}
WebString WebOptionElement::value() const
{
return constUnwrap<HTMLOptionElement>()->value();
}
int WebOptionElement::index() const
{
return constUnwrap<HTMLOptionElement>()->index();
}
WebString WebOptionElement::text() const
{
return constUnwrap<HTMLOptionElement>()->text();
}
bool WebOptionElement::defaultSelected() const
{
return constUnwrap<HTMLOptionElement>()->hasAttribute(selectedAttr);
}
void WebOptionElement::setDefaultSelected(bool newSelected)
{
return unwrap<HTMLOptionElement>()->setAttribute(selectedAttr, newSelected ? "" : 0);
}
WebString WebOptionElement::label() const
{
return constUnwrap<HTMLOptionElement>()->label();
}
bool WebOptionElement::isEnabled() const
{
return !(constUnwrap<HTMLOptionElement>()->disabled());
}
WebOptionElement::WebOptionElement(const PassRefPtr<HTMLOptionElement>& elem)
: WebElement(elem)
{
}
WebOptionElement& WebOptionElement::operator=(const PassRefPtr<HTMLOptionElement>& elem)
{
m_private = elem;
return *this;
}
WebOptionElement::operator PassRefPtr<HTMLOptionElement>() const
{
return static_cast<HTMLOptionElement*>(m_private.get());
}
}