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 { ...@@ -39,6 +39,8 @@ typedef struct {
HTMLElement element; HTMLElement element;
const IHTMLOptionElementVtbl *lpHTMLOptionElementVtbl; const IHTMLOptionElementVtbl *lpHTMLOptionElementVtbl;
nsIDOMHTMLOptionElement *nsoption;
} HTMLOptionElement; } HTMLOptionElement;
#define HTMLOPTION(x) ((IHTMLOptionElement*) &(x)->lpHTMLOptionElementVtbl) #define HTMLOPTION(x) ((IHTMLOptionElement*) &(x)->lpHTMLOptionElementVtbl)
...@@ -126,8 +128,24 @@ static HRESULT WINAPI HTMLOptionElement_put_value(IHTMLOptionElement *iface, BST ...@@ -126,8 +128,24 @@ static HRESULT WINAPI HTMLOptionElement_put_value(IHTMLOptionElement *iface, BST
static HRESULT WINAPI HTMLOptionElement_get_value(IHTMLOptionElement *iface, BSTR *p) static HRESULT WINAPI HTMLOptionElement_get_value(IHTMLOptionElement *iface, BSTR *p)
{ {
HTMLOptionElement *This = HTMLOPTION_THIS(iface); HTMLOptionElement *This = HTMLOPTION_THIS(iface);
FIXME("(%p)->(%p)\n", This, p); nsAString value_str;
return E_NOTIMPL; 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) 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) ...@@ -232,6 +250,10 @@ static HRESULT HTMLOptionElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
static void HTMLOptionElement_destructor(HTMLDOMNode *iface) static void HTMLOptionElement_destructor(HTMLDOMNode *iface)
{ {
HTMLOptionElement *This = HTMLOPTION_NODE_THIS(iface); HTMLOptionElement *This = HTMLOPTION_NODE_THIS(iface);
if(This->nsoption)
nsIDOMHTMLOptionElement_Release(This->nsoption);
HTMLElement_destructor(&This->element.node); HTMLElement_destructor(&This->element.node);
} }
...@@ -245,10 +267,15 @@ static const NodeImplVtbl HTMLOptionElementImplVtbl = { ...@@ -245,10 +267,15 @@ static const NodeImplVtbl HTMLOptionElementImplVtbl = {
HTMLElement *HTMLOptionElement_Create(nsIDOMHTMLElement *nselem) HTMLElement *HTMLOptionElement_Create(nsIDOMHTMLElement *nselem)
{ {
HTMLOptionElement *ret = mshtml_alloc(sizeof(HTMLOptionElement)); HTMLOptionElement *ret = mshtml_alloc(sizeof(HTMLOptionElement));
nsresult nsres;
ret->lpHTMLOptionElementVtbl = &HTMLOptionElementVtbl; ret->lpHTMLOptionElementVtbl = &HTMLOptionElementVtbl;
ret->element.node.vtbl = &HTMLOptionElementImplVtbl; 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; return &ret->element;
} }
......
...@@ -1078,6 +1078,28 @@ interface nsIDOMHTMLInputElement : nsIDOMHTMLElement ...@@ -1078,6 +1078,28 @@ interface nsIDOMHTMLInputElement : nsIDOMHTMLElement
[ [
object, 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) uuid(a6cf9090-15b3-11d2-932e-00805f8add32)
/* FROZEN */ /* 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