2 * Copyright 2007 Jacek Caban for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
32 #include "wine/debug.h"
34 #include "mshtml_private.h"
36 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
41 const IHTMLOptionElementVtbl *lpHTMLOptionElementVtbl;
44 #define HTMLOPTION(x) ((IHTMLOptionElement*) &(x)->lpHTMLOptionElementVtbl)
46 #define HTMLOPTION_THIS(iface) DEFINE_THIS(HTMLOptionElement, HTMLOptionElement, iface)
48 static HRESULT WINAPI HTMLOptionElement_QueryInterface(IHTMLOptionElement *iface,
49 REFIID riid, void **ppv)
51 HTMLOptionElement *This = HTMLOPTION_THIS(iface);
53 return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(&This->element.node), riid, ppv);
56 static ULONG WINAPI HTMLOptionElement_AddRef(IHTMLOptionElement *iface)
58 HTMLOptionElement *This = HTMLOPTION_THIS(iface);
60 return IHTMLDOMNode_AddRef(HTMLDOMNODE(&This->element.node));
63 static ULONG WINAPI HTMLOptionElement_Release(IHTMLOptionElement *iface)
65 HTMLOptionElement *This = HTMLOPTION_THIS(iface);
67 return IHTMLDOMNode_Release(HTMLDOMNODE(&This->element.node));
70 static HRESULT WINAPI HTMLOptionElement_GetTypeInfoCount(IHTMLOptionElement *iface, UINT *pctinfo)
72 HTMLOptionElement *This = HTMLOPTION_THIS(iface);
73 FIXME("(%p)->(%p)\n", This, pctinfo);
77 static HRESULT WINAPI HTMLOptionElement_GetTypeInfo(IHTMLOptionElement *iface, UINT iTInfo,
78 LCID lcid, ITypeInfo **ppTInfo)
80 HTMLOptionElement *This = HTMLOPTION_THIS(iface);
81 FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
85 static HRESULT WINAPI HTMLOptionElement_GetIDsOfNames(IHTMLOptionElement *iface, REFIID riid,
86 LPOLESTR *rgszNames, UINT cNames,
87 LCID lcid, DISPID *rgDispId)
89 HTMLOptionElement *This = HTMLOPTION_THIS(iface);
90 FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
95 static HRESULT WINAPI HTMLOptionElement_Invoke(IHTMLOptionElement *iface, DISPID dispIdMember,
96 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
97 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
99 HTMLOptionElement *This = HTMLOPTION_THIS(iface);
100 FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
101 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
105 static HRESULT WINAPI HTMLOptionElement_put_selected(IHTMLOptionElement *iface, VARIANT_BOOL v)
107 HTMLOptionElement *This = HTMLOPTION_THIS(iface);
108 FIXME("(%p)->(%x)\n", This, v);
112 static HRESULT WINAPI HTMLOptionElement_get_selected(IHTMLOptionElement *iface, VARIANT_BOOL *p)
114 HTMLOptionElement *This = HTMLOPTION_THIS(iface);
115 FIXME("(%p)->(%p)\n", This, p);
119 static HRESULT WINAPI HTMLOptionElement_put_value(IHTMLOptionElement *iface, BSTR v)
121 HTMLOptionElement *This = HTMLOPTION_THIS(iface);
122 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
126 static HRESULT WINAPI HTMLOptionElement_get_value(IHTMLOptionElement *iface, BSTR *p)
128 HTMLOptionElement *This = HTMLOPTION_THIS(iface);
129 FIXME("(%p)->(%p)\n", This, p);
133 static HRESULT WINAPI HTMLOptionElement_put_defaultSelected(IHTMLOptionElement *iface, VARIANT_BOOL v)
135 HTMLOptionElement *This = HTMLOPTION_THIS(iface);
136 FIXME("(%p)->(%x)\n", This, v);
140 static HRESULT WINAPI HTMLOptionElement_get_defaultSelected(IHTMLOptionElement *iface, VARIANT_BOOL *p)
142 HTMLOptionElement *This = HTMLOPTION_THIS(iface);
143 FIXME("(%p)->(%p)\n", This, p);
147 static HRESULT WINAPI HTMLOptionElement_put_index(IHTMLOptionElement *iface, LONG v)
149 HTMLOptionElement *This = HTMLOPTION_THIS(iface);
150 FIXME("(%p)->(%d)\n", This, v);
154 static HRESULT WINAPI HTMLOptionElement_get_index(IHTMLOptionElement *iface, LONG *p)
156 HTMLOptionElement *This = HTMLOPTION_THIS(iface);
157 FIXME("(%p)->(%p)\n", This, p);
161 static HRESULT WINAPI HTMLOptionElement_put_text(IHTMLOptionElement *iface, BSTR v)
163 HTMLOptionElement *This = HTMLOPTION_THIS(iface);
164 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
168 static HRESULT WINAPI HTMLOptionElement_get_text(IHTMLOptionElement *iface, BSTR *p)
170 HTMLOptionElement *This = HTMLOPTION_THIS(iface);
171 FIXME("(%p)->(%p)\n", This, p);
175 static HRESULT WINAPI HTMLOptionElement_get_form(IHTMLOptionElement *iface, IHTMLFormElement **p)
177 HTMLOptionElement *This = HTMLOPTION_THIS(iface);
178 FIXME("(%p)->(%p)\n", This, p);
182 #undef HTMLOPTION_THIS
184 static const IHTMLOptionElementVtbl HTMLOptionElementVtbl = {
185 HTMLOptionElement_QueryInterface,
186 HTMLOptionElement_AddRef,
187 HTMLOptionElement_Release,
188 HTMLOptionElement_GetTypeInfoCount,
189 HTMLOptionElement_GetTypeInfo,
190 HTMLOptionElement_GetIDsOfNames,
191 HTMLOptionElement_Invoke,
192 HTMLOptionElement_put_selected,
193 HTMLOptionElement_get_selected,
194 HTMLOptionElement_put_value,
195 HTMLOptionElement_get_value,
196 HTMLOptionElement_put_defaultSelected,
197 HTMLOptionElement_get_defaultSelected,
198 HTMLOptionElement_put_index,
199 HTMLOptionElement_get_index,
200 HTMLOptionElement_put_text,
201 HTMLOptionElement_get_text,
202 HTMLOptionElement_get_form
205 #define HTMLOPTION_NODE_THIS(iface) DEFINE_THIS2(HTMLOptionElement, element.node, iface)
207 static HRESULT HTMLOptionElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
209 HTMLOptionElement *This = HTMLOPTION_NODE_THIS(iface);
213 if(IsEqualGUID(&IID_IUnknown, riid)) {
214 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
215 *ppv = HTMLOPTION(This);
216 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
217 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
218 *ppv = HTMLOPTION(This);
219 }else if(IsEqualGUID(&IID_IHTMLOptionElement, riid)) {
220 TRACE("(%p)->(IID_IHTMLOptionElement %p)\n", This, ppv);
221 *ppv = HTMLOPTION(This);
225 IUnknown_AddRef((IUnknown*)*ppv);
229 return HTMLElement_QI(&This->element.node, riid, ppv);
232 static void HTMLOptionElement_destructor(HTMLDOMNode *iface)
234 HTMLOptionElement *This = HTMLOPTION_NODE_THIS(iface);
235 HTMLElement_destructor(&This->element.node);
238 #undef HTMLOPTION_NODE_THIS
240 static const NodeImplVtbl HTMLOptionElementImplVtbl = {
241 HTMLOptionElement_QI,
242 HTMLOptionElement_destructor
245 HTMLElement *HTMLOptionElement_Create(nsIDOMHTMLElement *nselem)
247 HTMLOptionElement *ret = mshtml_alloc(sizeof(HTMLOptionElement));
249 ret->lpHTMLOptionElementVtbl = &HTMLOptionElementVtbl;
250 ret->element.node.vtbl = &HTMLOptionElementImplVtbl;
252 return &ret->element;