Commit b1fca21f authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Added IHTMLOptionElement::get_value implementation.

parent b14ba8aa
......@@ -39,6 +39,8 @@ typedef struct {
HTMLElement element;
const IHTMLOptionElementVtbl *lpHTMLOptionElementVtbl;
nsIDOMHTMLOptionElement *nsoption;
} HTMLOptionElement;
#define HTMLOPTION(x) ((IHTMLOptionElement*) &(x)->lpHTMLOptionElementVtbl)
......@@ -126,8 +128,24 @@ static HRESULT WINAPI HTMLOptionElement_put_value(IHTMLOptionElement *iface, BST
static HRESULT WINAPI HTMLOptionElement_get_value(IHTMLOptionElement *iface, BSTR *p)
{
HTMLOptionElement *This = HTMLOPTION_THIS(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
nsAString value_str;
const PRUnichar *value;
nsresult nsres;
TRACE("(%p)->(%p)\n", This, p);
nsAString_Init(&value_str, NULL);
nsres = nsIDOMHTMLOptionElement_GetValue(This->nsoption, &value_str);
if(NS_SUCCEEDED(nsres)) {
nsAString_GetData(&value_str, &value, NULL);
*p = SysAllocString(value);
}else {
ERR("GetValue failed: %08x\n", nsres);
*p = NULL;
}
nsAString_Finish(&value_str);
return S_OK;
}
static HRESULT WINAPI HTMLOptionElement_put_defaultSelected(IHTMLOptionElement *iface, VARIANT_BOOL v)
......@@ -232,6 +250,10 @@ static HRESULT HTMLOptionElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
static void HTMLOptionElement_destructor(HTMLDOMNode *iface)
{
HTMLOptionElement *This = HTMLOPTION_NODE_THIS(iface);
if(This->nsoption)
nsIDOMHTMLOptionElement_Release(This->nsoption);
HTMLElement_destructor(&This->element.node);
}
......@@ -245,10 +267,15 @@ static const NodeImplVtbl HTMLOptionElementImplVtbl = {
HTMLElement *HTMLOptionElement_Create(nsIDOMHTMLElement *nselem)
{
HTMLOptionElement *ret = mshtml_alloc(sizeof(HTMLOptionElement));
nsresult nsres;
ret->lpHTMLOptionElementVtbl = &HTMLOptionElementVtbl;
ret->element.node.vtbl = &HTMLOptionElementImplVtbl;
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLOptionElement, (void**)&ret->nsoption);
if(NS_FAILED(nsres))
ERR("Could not get nsIDOMHTMLOptionElement interface: %08x\n", nsres);
return &ret->element;
}
......
......@@ -1078,6 +1078,28 @@ interface nsIDOMHTMLInputElement : nsIDOMHTMLElement
[
object,
uuid(a6cf9092-15b3-11d2-932e-00805f8add32)
/* FROZEN */
]
interface nsIDOMHTMLOptionElement : nsIDOMHTMLElement
{
nsresult GetForm(nsIDOMHTMLFormElement **aForm);
nsresult GetDefaultSelected(PRBool *aDefaultSelected);
nsresult SetDefaultSelected(PRBool aDefaultSelected);
nsresult GetText(nsAString *aText);
nsresult GetIndex(PRInt32 *aIndex);
nsresult GetDisabled(PRBool *aDisabled);
nsresult SetDisabled(PRBool aDisabled);
nsresult GetLabel(nsAString *aLabel);
nsresult SetLabel(const nsAString *aLabel);
nsresult GetSelected(PRBool *aSelected);
nsresult SetSelected(PRBool aSelected);
nsresult GetValue(nsAString *aValue);
nsresult SetValue(const nsAString *aValue);
}
[
object,
uuid(a6cf9090-15b3-11d2-932e-00805f8add32)
/* FROZEN */
]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment