ReactOS 0.4.15-dev-7924-g5949c20
htmloption.c File Reference
#include "mshtml_private.h"
Include dependency graph for htmloption.c:

Go to the source code of this file.

Classes

struct  HTMLOptionElement
 

Functions

static HTMLOptionElementimpl_from_IHTMLOptionElement (IHTMLOptionElement *iface)
 
static HRESULT WINAPI HTMLOptionElement_QueryInterface (IHTMLOptionElement *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI HTMLOptionElement_AddRef (IHTMLOptionElement *iface)
 
static ULONG WINAPI HTMLOptionElement_Release (IHTMLOptionElement *iface)
 
static HRESULT WINAPI HTMLOptionElement_GetTypeInfoCount (IHTMLOptionElement *iface, UINT *pctinfo)
 
static HRESULT WINAPI HTMLOptionElement_GetTypeInfo (IHTMLOptionElement *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI HTMLOptionElement_GetIDsOfNames (IHTMLOptionElement *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI HTMLOptionElement_Invoke (IHTMLOptionElement *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT WINAPI HTMLOptionElement_put_selected (IHTMLOptionElement *iface, VARIANT_BOOL v)
 
static HRESULT WINAPI HTMLOptionElement_get_selected (IHTMLOptionElement *iface, VARIANT_BOOL *p)
 
static HRESULT WINAPI HTMLOptionElement_put_value (IHTMLOptionElement *iface, BSTR v)
 
static HRESULT WINAPI HTMLOptionElement_get_value (IHTMLOptionElement *iface, BSTR *p)
 
static HRESULT WINAPI HTMLOptionElement_put_defaultSelected (IHTMLOptionElement *iface, VARIANT_BOOL v)
 
static HRESULT WINAPI HTMLOptionElement_get_defaultSelected (IHTMLOptionElement *iface, VARIANT_BOOL *p)
 
static HRESULT WINAPI HTMLOptionElement_put_index (IHTMLOptionElement *iface, LONG v)
 
static HRESULT WINAPI HTMLOptionElement_get_index (IHTMLOptionElement *iface, LONG *p)
 
static HRESULT WINAPI HTMLOptionElement_put_text (IHTMLOptionElement *iface, BSTR v)
 
static HRESULT WINAPI HTMLOptionElement_get_text (IHTMLOptionElement *iface, BSTR *p)
 
static HRESULT WINAPI HTMLOptionElement_get_form (IHTMLOptionElement *iface, IHTMLFormElement **p)
 
static HTMLOptionElementimpl_from_HTMLDOMNode (HTMLDOMNode *iface)
 
static HRESULT HTMLOptionElement_QI (HTMLDOMNode *iface, REFIID riid, void **ppv)
 
static void HTMLOptionElement_traverse (HTMLDOMNode *iface, nsCycleCollectionTraversalCallback *cb)
 
static void HTMLOptionElement_unlink (HTMLDOMNode *iface)
 
HRESULT HTMLOptionElement_Create (HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
 
static HTMLOptionElementFactoryimpl_from_IHTMLOptionElementFactory (IHTMLOptionElementFactory *iface)
 
static HRESULT WINAPI HTMLOptionElementFactory_QueryInterface (IHTMLOptionElementFactory *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI HTMLOptionElementFactory_AddRef (IHTMLOptionElementFactory *iface)
 
static ULONG WINAPI HTMLOptionElementFactory_Release (IHTMLOptionElementFactory *iface)
 
static HRESULT WINAPI HTMLOptionElementFactory_GetTypeInfoCount (IHTMLOptionElementFactory *iface, UINT *pctinfo)
 
static HRESULT WINAPI HTMLOptionElementFactory_GetTypeInfo (IHTMLOptionElementFactory *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI HTMLOptionElementFactory_GetIDsOfNames (IHTMLOptionElementFactory *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI HTMLOptionElementFactory_Invoke (IHTMLOptionElementFactory *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT WINAPI HTMLOptionElementFactory_create (IHTMLOptionElementFactory *iface, VARIANT text, VARIANT value, VARIANT defaultselected, VARIANT selected, IHTMLOptionElement **optelem)
 
HRESULT HTMLOptionElementFactory_Create (HTMLInnerWindow *window, HTMLOptionElementFactory **ret_ptr)
 

Variables

static const IHTMLOptionElementVtbl HTMLOptionElementVtbl
 
static const NodeImplVtbl HTMLOptionElementImplVtbl
 
static const tid_t HTMLOptionElement_iface_tids []
 
static dispex_static_data_t HTMLOptionElement_dispex
 
static const IHTMLOptionElementFactoryVtbl HTMLOptionElementFactoryVtbl
 
static const tid_t HTMLOptionElementFactory_iface_tids []
 
static dispex_static_data_t HTMLOptionElementFactory_dispex
 

Function Documentation

◆ HTMLOptionElement_AddRef()

static ULONG WINAPI HTMLOptionElement_AddRef ( IHTMLOptionElement *  iface)
static

Definition at line 42 of file htmloption.c.

43{
45
46 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
47}
static HTMLOptionElement * impl_from_IHTMLOptionElement(IHTMLOptionElement *iface)
Definition: htmloption.c:29

◆ HTMLOptionElement_Create()

HRESULT HTMLOptionElement_Create ( HTMLDocumentNode doc,
nsIDOMHTMLElement nselem,
HTMLElement **  elem 
)

Definition at line 437 of file htmloption.c.

438{
440 nsresult nsres;
441
442 ret = heap_alloc_zero(sizeof(HTMLOptionElement));
443 if(!ret)
444 return E_OUTOFMEMORY;
445
446 ret->IHTMLOptionElement_iface.lpVtbl = &HTMLOptionElementVtbl;
447 ret->element.node.vtbl = &HTMLOptionElementImplVtbl;
448
449 HTMLElement_Init(&ret->element, doc, nselem, &HTMLOptionElement_dispex);
450
451 nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLOptionElement, (void**)&ret->nsoption);
452 assert(nsres == NS_OK);
453
454 *elem = &ret->element;
455 return S_OK;
456}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define assert(x)
Definition: debug.h:53
void HTMLElement_Init(HTMLElement *This, HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, dispex_static_data_t *dispex_data)
Definition: htmlelem.c:4008
static const IHTMLOptionElementVtbl HTMLOptionElementVtbl
Definition: htmloption.c:334
static dispex_static_data_t HTMLOptionElement_dispex
Definition: htmloption.c:430
static const NodeImplVtbl HTMLOptionElementImplVtbl
Definition: htmloption.c:405
#define S_OK
Definition: intsafe.h:52
static size_t elem
Definition: string.c:68
#define NS_OK
int ret

◆ HTMLOptionElement_get_defaultSelected()

static HRESULT WINAPI HTMLOptionElement_get_defaultSelected ( IHTMLOptionElement *  iface,
VARIANT_BOOL p 
)
static

Definition at line 185 of file htmloption.c.

186{
189 nsresult nsres;
190
191 TRACE("(%p)->(%p)\n", This, p);
192 if(!p)
193 return E_POINTER;
194 nsres = nsIDOMHTMLOptionElement_GetDefaultSelected(This->nsoption, &val);
195 if(NS_FAILED(nsres)) {
196 ERR("GetDefaultSelected failed: %08x\n", nsres);
197 return E_FAIL;
198 }
199
200 *p = val ? VARIANT_TRUE : VARIANT_FALSE;
201 return S_OK;
202}
#define ERR(fmt,...)
Definition: debug.h:110
#define E_FAIL
Definition: ddrawi.h:102
unsigned char cpp_bool
Definition: atl.c:38
GLuint GLfloat * val
Definition: glext.h:7180
GLfloat GLfloat p
Definition: glext.h:8902
#define NS_FAILED(res)
#define TRACE(s)
Definition: solgame.cpp:4
#define E_POINTER
Definition: winerror.h:2365

◆ HTMLOptionElement_get_form()

static HRESULT WINAPI HTMLOptionElement_get_form ( IHTMLOptionElement *  iface,
IHTMLFormElement **  p 
)
static

Definition at line 293 of file htmloption.c.

294{
296 nsIDOMHTMLFormElement *nsform;
297 nsIDOMNode *form_node;
300 nsresult nsres;
301
302 TRACE("(%p)->(%p)\n", This, p);
303
304 if(!p)
305 return E_POINTER;
306
307 nsres = nsIDOMHTMLOptionElement_GetForm(This->nsoption, &nsform);
308 if (NS_FAILED(nsres)) {
309 ERR("GetForm failed: %08x, nsform: %p\n", nsres, nsform);
310 *p = NULL;
311 return E_FAIL;
312 }
313 if (nsform == NULL) {
314 TRACE("nsform not found\n");
315 *p = NULL;
316 return S_OK;
317 }
318
319 nsres = nsIDOMHTMLFormElement_QueryInterface(nsform, &IID_nsIDOMNode, (void**)&form_node);
320 nsIDOMHTMLFormElement_Release(nsform);
321 assert(nsres == NS_OK);
322
323 hres = get_node(This->element.node.doc, form_node, TRUE, &node);
324 nsIDOMNode_Release(form_node);
325 if (FAILED(hres))
326 return hres;
327
328 hres = IHTMLDOMNode_QueryInterface(&node->IHTMLDOMNode_iface, &IID_IHTMLElement, (void**)p);
329
331 return hres;
332}
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
HRESULT get_node(HTMLDocumentNode *This, nsIDOMNode *nsnode, BOOL create, HTMLDOMNode **ret)
Definition: htmlnode.c:1339
#define FAILED(hr)
Definition: intsafe.h:51
HRESULT hres
Definition: protocol.c:465
static void node_release(HTMLDOMNode *node)
Definition: dlist.c:348

◆ HTMLOptionElement_get_index()

static HRESULT WINAPI HTMLOptionElement_get_index ( IHTMLOptionElement *  iface,
LONG p 
)
static

Definition at line 211 of file htmloption.c.

212{
214 LONG val;
215 nsresult nsres;
216
217 TRACE("(%p)->(%p)\n", This, p);
218
219 if(!p)
220 return E_INVALIDARG;
221
222 nsres = nsIDOMHTMLOptionElement_GetIndex(This->nsoption, &val);
223 if(NS_FAILED(nsres)) {
224 ERR("GetIndex failed: %08x\n", nsres);
225 return E_FAIL;
226 }
227 *p = val;
228 return S_OK;
229}
#define E_INVALIDARG
Definition: ddrawi.h:101
long LONG
Definition: pedump.c:60

◆ HTMLOptionElement_get_selected()

static HRESULT WINAPI HTMLOptionElement_get_selected ( IHTMLOptionElement *  iface,
VARIANT_BOOL p 
)
static

Definition at line 104 of file htmloption.c.

105{
108 nsresult nsres;
109
110 TRACE("(%p)->(%p)\n", This, p);
111
112 nsres = nsIDOMHTMLOptionElement_GetSelected(This->nsoption, &selected);
113 if(NS_FAILED(nsres)) {
114 ERR("GetSelected failed: %08x\n", nsres);
115 return E_FAIL;
116 }
117
118 *p = selected ? VARIANT_TRUE : VARIANT_FALSE;
119 return S_OK;
120}
static char selected[MAX_PATH+1]
Definition: dirdlg.c:7

◆ HTMLOptionElement_get_text()

static HRESULT WINAPI HTMLOptionElement_get_text ( IHTMLOptionElement *  iface,
BSTR p 
)
static

Definition at line 280 of file htmloption.c.

281{
283 nsAString text_str;
284 nsresult nsres;
285
286 TRACE("(%p)->(%p)\n", This, p);
287
288 nsAString_Init(&text_str, NULL);
289 nsres = nsIDOMHTMLOptionElement_GetText(This->nsoption, &text_str);
290 return return_nsstr(nsres, &text_str, p);
291}
BOOL nsAString_Init(nsAString *, const PRUnichar *) DECLSPEC_HIDDEN
Definition: nsembed.c:817
HRESULT return_nsstr(nsresult, nsAString *, BSTR *) DECLSPEC_HIDDEN
Definition: nsembed.c:841

◆ HTMLOptionElement_get_value()

static HRESULT WINAPI HTMLOptionElement_get_value ( IHTMLOptionElement *  iface,
BSTR p 
)
static

Definition at line 139 of file htmloption.c.

140{
143 nsresult nsres;
144
145 TRACE("(%p)->(%p)\n", This, p);
146
148 nsres = nsIDOMHTMLOptionElement_GetValue(This->nsoption, &value_str);
149 return return_nsstr(nsres, &value_str, p);
150}
static UNICODE_STRING value_str
Definition: reg.c:1328

◆ HTMLOptionElement_GetIDsOfNames()

static HRESULT WINAPI HTMLOptionElement_GetIDsOfNames ( IHTMLOptionElement *  iface,
REFIID  riid,
LPOLESTR rgszNames,
UINT  cNames,
LCID  lcid,
DISPID rgDispId 
)
static

Definition at line 70 of file htmloption.c.

73{
75 return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
76 cNames, lcid, rgDispId);
77}
REFIID riid
Definition: atlbase.h:39

◆ HTMLOptionElement_GetTypeInfo()

static HRESULT WINAPI HTMLOptionElement_GetTypeInfo ( IHTMLOptionElement *  iface,
UINT  iTInfo,
LCID  lcid,
ITypeInfo **  ppTInfo 
)
static

Definition at line 62 of file htmloption.c.

64{
66 return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
67 ppTInfo);
68}

◆ HTMLOptionElement_GetTypeInfoCount()

static HRESULT WINAPI HTMLOptionElement_GetTypeInfoCount ( IHTMLOptionElement *  iface,
UINT pctinfo 
)
static

Definition at line 56 of file htmloption.c.

57{
59 return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
60}

◆ HTMLOptionElement_Invoke()

static HRESULT WINAPI HTMLOptionElement_Invoke ( IHTMLOptionElement *  iface,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 79 of file htmloption.c.

82{
84 return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
85 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
86}
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:531

◆ HTMLOptionElement_put_defaultSelected()

static HRESULT WINAPI HTMLOptionElement_put_defaultSelected ( IHTMLOptionElement *  iface,
VARIANT_BOOL  v 
)
static

Definition at line 152 of file htmloption.c.

153{
156 nsresult nsres;
157
158 TRACE("(%p)->(%x)\n", This, v);
159
160 val = (v == VARIANT_TRUE);
161
162 nsres = nsIDOMHTMLOptionElement_GetSelected(This->nsoption, &selected);
163 if(NS_FAILED(nsres)) {
164 ERR("GetSelected failed: %08x\n", nsres);
165 return E_FAIL;
166 }
167
168 nsres = nsIDOMHTMLOptionElement_SetDefaultSelected(This->nsoption, val);
169 if(NS_FAILED(nsres)) {
170 ERR("SetDefaultSelected failed: %08x\n", nsres);
171 return E_FAIL;
172 }
173
174 if(val != selected) {
175 nsres = nsIDOMHTMLOptionElement_SetSelected(This->nsoption, selected); /* WinAPI will reserve selected property */
176 if(NS_FAILED(nsres)) {
177 ERR("SetSelected failed: %08x\n", nsres);
178 return E_FAIL;
179 }
180 }
181
182 return S_OK;
183}
const GLdouble * v
Definition: gl.h:2040

◆ HTMLOptionElement_put_index()

static HRESULT WINAPI HTMLOptionElement_put_index ( IHTMLOptionElement *  iface,
LONG  v 
)
static

Definition at line 204 of file htmloption.c.

205{
207 FIXME("(%p)->(%d)\n", This, v);
208 return E_NOTIMPL;
209}
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ HTMLOptionElement_put_selected()

static HRESULT WINAPI HTMLOptionElement_put_selected ( IHTMLOptionElement *  iface,
VARIANT_BOOL  v 
)
static

Definition at line 88 of file htmloption.c.

89{
91 nsresult nsres;
92
93 TRACE("(%p)->(%x)\n", This, v);
94
95 nsres = nsIDOMHTMLOptionElement_SetSelected(This->nsoption, v != VARIANT_FALSE);
96 if(NS_FAILED(nsres)) {
97 ERR("SetSelected failed: %08x\n", nsres);
98 return E_FAIL;
99 }
100
101 return S_OK;
102}

◆ HTMLOptionElement_put_text()

static HRESULT WINAPI HTMLOptionElement_put_text ( IHTMLOptionElement *  iface,
BSTR  v 
)
static

Definition at line 231 of file htmloption.c.

232{
234 nsIDOMText *text_node;
235 nsAString text_str;
236 nsIDOMNode *tmp;
237 nsresult nsres;
238
239 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
240
241 if(!This->element.node.doc->nsdoc) {
242 WARN("NULL nsdoc\n");
243 return E_UNEXPECTED;
244 }
245
246 while(1) {
248
249 nsres = nsIDOMHTMLElement_GetFirstChild(This->element.nselem, &child);
250 if(NS_FAILED(nsres) || !child)
251 break;
252
253 nsres = nsIDOMHTMLElement_RemoveChild(This->element.nselem, child, &tmp);
254 nsIDOMNode_Release(child);
255 if(NS_SUCCEEDED(nsres)) {
256 nsIDOMNode_Release(tmp);
257 }else {
258 ERR("RemoveChild failed: %08x\n", nsres);
259 break;
260 }
261 }
262
263 nsAString_InitDepend(&text_str, v);
264 nsres = nsIDOMHTMLDocument_CreateTextNode(This->element.node.doc->nsdoc, &text_str, &text_node);
265 nsAString_Finish(&text_str);
266 if(NS_FAILED(nsres)) {
267 ERR("CreateTextNode failed: %08x\n", nsres);
268 return E_FAIL;
269 }
270
271 nsres = nsIDOMHTMLElement_AppendChild(This->element.nselem, (nsIDOMNode*)text_node, &tmp);
272 if(NS_SUCCEEDED(nsres))
273 nsIDOMNode_Release(tmp);
274 else
275 ERR("AppendChild failed: %08x\n", nsres);
276
277 return S_OK;
278}
#define WARN(fmt,...)
Definition: debug.h:112
#define debugstr_w
Definition: kernel32.h:32
static HWND child
Definition: cursoricon.c:298
void nsAString_Finish(nsAString *) DECLSPEC_HIDDEN
Definition: nsembed.c:836
void nsAString_InitDepend(nsAString *, const PRUnichar *) DECLSPEC_HIDDEN
Definition: nsembed.c:826
#define NS_SUCCEEDED(res)
#define E_UNEXPECTED
Definition: winerror.h:2456

◆ HTMLOptionElement_put_value()

static HRESULT WINAPI HTMLOptionElement_put_value ( IHTMLOptionElement *  iface,
BSTR  v 
)
static

Definition at line 122 of file htmloption.c.

123{
126 nsresult nsres;
127
128 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
129
131 nsres = nsIDOMHTMLOptionElement_SetValue(This->nsoption, &value_str);
133 if(NS_FAILED(nsres))
134 ERR("SetValue failed: %08x\n", nsres);
135
136 return S_OK;
137}

◆ HTMLOptionElement_QI()

static HRESULT HTMLOptionElement_QI ( HTMLDOMNode iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 360 of file htmloption.c.

361{
363
364 *ppv = NULL;
365
367 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
368 *ppv = &This->IHTMLOptionElement_iface;
369 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
370 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
371 *ppv = &This->IHTMLOptionElement_iface;
372 }else if(IsEqualGUID(&IID_IHTMLOptionElement, riid)) {
373 TRACE("(%p)->(IID_IHTMLOptionElement %p)\n", This, ppv);
374 *ppv = &This->IHTMLOptionElement_iface;
375 }
376
377 if(*ppv) {
378 IUnknown_AddRef((IUnknown*)*ppv);
379 return S_OK;
380 }
381
382 return HTMLElement_QI(&This->element.node, riid, ppv);
383}
const GUID IID_IUnknown
HRESULT HTMLElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
Definition: htmlelem.c:3738
static HTMLOptionElement * impl_from_HTMLDOMNode(HTMLDOMNode *iface)
Definition: htmloption.c:355
REFIID LPVOID * ppv
Definition: atlbase.h:39
const GUID IID_IDispatch
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147

◆ HTMLOptionElement_QueryInterface()

static HRESULT WINAPI HTMLOptionElement_QueryInterface ( IHTMLOptionElement *  iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 34 of file htmloption.c.

36{
38
39 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
40}

◆ HTMLOptionElement_Release()

static ULONG WINAPI HTMLOptionElement_Release ( IHTMLOptionElement *  iface)
static

Definition at line 49 of file htmloption.c.

50{
52
53 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
54}

◆ HTMLOptionElement_traverse()

static void HTMLOptionElement_traverse ( HTMLDOMNode iface,
nsCycleCollectionTraversalCallback cb 
)
static

Definition at line 385 of file htmloption.c.

386{
388
389 if(This->nsoption)
390 note_cc_edge((nsISupports*)This->nsoption, "This->nsoption", cb);
391}
static HMODULE MODULEINFO DWORD cb
Definition: module.c:33

◆ HTMLOptionElement_unlink()

static void HTMLOptionElement_unlink ( HTMLDOMNode iface)
static

Definition at line 393 of file htmloption.c.

394{
396
397 if(This->nsoption) {
398 nsIDOMHTMLOptionElement *nsoption = This->nsoption;
399
400 This->nsoption = NULL;
401 nsIDOMHTMLOptionElement_Release(nsoption);
402 }
403}

◆ HTMLOptionElementFactory_AddRef()

static ULONG WINAPI HTMLOptionElementFactory_AddRef ( IHTMLOptionElementFactory *  iface)
static

Definition at line 488 of file htmloption.c.

489{
492
493 TRACE("(%p) ref=%d\n", This, ref);
494
495 return ref;
496}
#define InterlockedIncrement
Definition: armddk.h:53
static HTMLOptionElementFactory * impl_from_IHTMLOptionElementFactory(IHTMLOptionElementFactory *iface)
Definition: htmloption.c:458
Definition: send.c:48

◆ HTMLOptionElementFactory_Create()

HRESULT HTMLOptionElementFactory_Create ( HTMLInnerWindow window,
HTMLOptionElementFactory **  ret_ptr 
)

Definition at line 618 of file htmloption.c.

619{
621
622 ret = heap_alloc(sizeof(*ret));
623 if(!ret)
624 return E_OUTOFMEMORY;
625
626 ret->IHTMLOptionElementFactory_iface.lpVtbl = &HTMLOptionElementFactoryVtbl;
627 ret->ref = 1;
628 ret->window = window;
629
630 init_dispex(&ret->dispex, (IUnknown*)&ret->IHTMLOptionElementFactory_iface,
632
633 *ret_ptr = ret;
634 return S_OK;
635}
static void * heap_alloc(size_t len)
Definition: appwiz.h:66
static dispex_static_data_t HTMLOptionElementFactory_dispex
Definition: htmloption.c:611
static const IHTMLOptionElementFactoryVtbl HTMLOptionElementFactoryVtbl
Definition: htmloption.c:595
HRESULT init_dispex(jsdisp_t *dispex, script_ctx_t *ctx, const builtin_info_t *builtin_info, jsdisp_t *prototype)
Definition: dispex.c:919
static IHTMLWindow2 * window
Definition: events.c:77

Referenced by HTMLWindow2_get_Option().

◆ HTMLOptionElementFactory_create()

static HRESULT WINAPI HTMLOptionElementFactory_create ( IHTMLOptionElementFactory *  iface,
VARIANT  text,
VARIANT  value,
VARIANT  defaultselected,
VARIANT  selected,
IHTMLOptionElement **  optelem 
)
static

Definition at line 543 of file htmloption.c.

546{
548 nsIDOMHTMLElement *nselem;
551
552 static const PRUnichar optionW[] = {'O','P','T','I','O','N',0};
553
554 TRACE("(%p)->(%s %s %s %s %p)\n", This, debugstr_variant(&text), debugstr_variant(&value),
555 debugstr_variant(&defaultselected), debugstr_variant(&selected), optelem);
556
557 if(!This->window || !This->window->doc) {
558 WARN("NULL doc\n");
559 return E_UNEXPECTED;
560 }
561
562 *optelem = NULL;
563
564 hres = create_nselem(This->window->doc, optionW, &nselem);
565 if(FAILED(hres))
566 return hres;
567
568 hres = get_node(This->window->doc, (nsIDOMNode*)nselem, TRUE, &node);
569 nsIDOMHTMLElement_Release(nselem);
570 if(FAILED(hres))
571 return hres;
572
573 hres = IHTMLDOMNode_QueryInterface(&node->IHTMLDOMNode_iface,
574 &IID_IHTMLOptionElement, (void**)optelem);
576
577 if(V_VT(&text) == VT_BSTR)
578 IHTMLOptionElement_put_text(*optelem, V_BSTR(&text));
579 else if(V_VT(&text) != VT_EMPTY)
580 FIXME("Unsupported text %s\n", debugstr_variant(&text));
581
582 if(V_VT(&value) == VT_BSTR)
583 IHTMLOptionElement_put_value(*optelem, V_BSTR(&value));
584 else if(V_VT(&value) != VT_EMPTY)
585 FIXME("Unsupported value %s\n", debugstr_variant(&value));
586
587 if(V_VT(&defaultselected) != VT_EMPTY)
588 FIXME("Unsupported defaultselected %s\n", debugstr_variant(&defaultselected));
589 if(V_VT(&selected) != VT_EMPTY)
590 FIXME("Unsupported selected %s\n", debugstr_variant(&selected));
591
592 return S_OK;
593}
@ VT_BSTR
Definition: compat.h:2303
@ VT_EMPTY
Definition: compat.h:2295
const WCHAR * text
Definition: package.c:1799
static const WCHAR optionW[]
Definition: htmlelem.c:36
HRESULT create_nselem(HTMLDocumentNode *doc, const WCHAR *tag, nsIDOMHTMLElement **ret)
Definition: htmlelem.c:246
static const char * debugstr_variant(const VARIANT *var)
Definition: container.c:46
WCHAR PRUnichar
Definition: nsiface.idl:48
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
Definition: pdh_main.c:94

◆ HTMLOptionElementFactory_GetIDsOfNames()

static HRESULT WINAPI HTMLOptionElementFactory_GetIDsOfNames ( IHTMLOptionElementFactory *  iface,
REFIID  riid,
LPOLESTR rgszNames,
UINT  cNames,
LCID  lcid,
DISPID rgDispId 
)
static

Definition at line 526 of file htmloption.c.

529{
531 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames, lcid, rgDispId);
532}

◆ HTMLOptionElementFactory_GetTypeInfo()

static HRESULT WINAPI HTMLOptionElementFactory_GetTypeInfo ( IHTMLOptionElementFactory *  iface,
UINT  iTInfo,
LCID  lcid,
ITypeInfo **  ppTInfo 
)
static

Definition at line 519 of file htmloption.c.

521{
523 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
524}

◆ HTMLOptionElementFactory_GetTypeInfoCount()

static HRESULT WINAPI HTMLOptionElementFactory_GetTypeInfoCount ( IHTMLOptionElementFactory *  iface,
UINT pctinfo 
)
static

Definition at line 513 of file htmloption.c.

514{
516 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
517}

◆ HTMLOptionElementFactory_Invoke()

static HRESULT WINAPI HTMLOptionElementFactory_Invoke ( IHTMLOptionElementFactory *  iface,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 534 of file htmloption.c.

537{
539 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, pDispParams,
540 pVarResult, pExcepInfo, puArgErr);
541}

◆ HTMLOptionElementFactory_QueryInterface()

static HRESULT WINAPI HTMLOptionElementFactory_QueryInterface ( IHTMLOptionElementFactory *  iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 463 of file htmloption.c.

465{
467
468 TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
469
471 *ppv = &This->IHTMLOptionElementFactory_iface;
472 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
473 *ppv = &This->IHTMLOptionElementFactory_iface;
474 }else if(IsEqualGUID(&IID_IHTMLOptionElementFactory, riid)) {
475 *ppv = &This->IHTMLOptionElementFactory_iface;
476 }else if(dispex_query_interface(&This->dispex, riid, ppv)) {
477 return *ppv ? S_OK : E_NOINTERFACE;
478 }else {
479 *ppv = NULL;
480 WARN("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
481 return E_NOINTERFACE;
482 }
483
484 IUnknown_AddRef((IUnknown*)*ppv);
485 return S_OK;
486}
const char * debugstr_mshtml_guid(const GUID *iid)
Definition: main.c:542
BOOL dispex_query_interface(DispatchEx *This, REFIID riid, void **ppv)
Definition: dispex.c:1656
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ HTMLOptionElementFactory_Release()

static ULONG WINAPI HTMLOptionElementFactory_Release ( IHTMLOptionElementFactory *  iface)
static

Definition at line 498 of file htmloption.c.

499{
502
503 TRACE("(%p) ref=%d\n", This, ref);
504
505 if(!ref) {
506 release_dispex(&This->dispex);
508 }
509
510 return ref;
511}
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
#define InterlockedDecrement
Definition: armddk.h:52
void release_dispex(DispatchEx *This)
Definition: dispex.c:1706

◆ impl_from_HTMLDOMNode()

static HTMLOptionElement * impl_from_HTMLDOMNode ( HTMLDOMNode iface)
inlinestatic

Definition at line 355 of file htmloption.c.

356{
357 return CONTAINING_RECORD(iface, HTMLOptionElement, element.node);
358}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by HTMLOptionElement_QI(), HTMLOptionElement_traverse(), and HTMLOptionElement_unlink().

◆ impl_from_IHTMLOptionElement()

◆ impl_from_IHTMLOptionElementFactory()

Variable Documentation

◆ HTMLOptionElement_dispex

dispex_static_data_t HTMLOptionElement_dispex
static
Initial value:
= {
DispHTMLOptionElement_tid,
}
static const tid_t HTMLOptionElement_iface_tids[]
Definition: htmloption.c:425

Definition at line 430 of file htmloption.c.

Referenced by HTMLOptionElement_Create().

◆ HTMLOptionElement_iface_tids

const tid_t HTMLOptionElement_iface_tids[]
static
Initial value:
= {
IHTMLOptionElement_tid,
0
}
#define HTMLELEMENT_TIDS

Definition at line 425 of file htmloption.c.

◆ HTMLOptionElementFactory_dispex

dispex_static_data_t HTMLOptionElementFactory_dispex
static
Initial value:
= {
IHTMLOptionElementFactory_tid,
}
static const tid_t HTMLOptionElementFactory_iface_tids[]
Definition: htmloption.c:606

Definition at line 611 of file htmloption.c.

Referenced by HTMLOptionElementFactory_Create().

◆ HTMLOptionElementFactory_iface_tids

const tid_t HTMLOptionElementFactory_iface_tids[]
static
Initial value:
= {
IHTMLOptionElementFactory_tid,
0
}

Definition at line 606 of file htmloption.c.

◆ HTMLOptionElementFactoryVtbl

const IHTMLOptionElementFactoryVtbl HTMLOptionElementFactoryVtbl
static
Initial value:
= {
}
static ULONG WINAPI HTMLOptionElementFactory_AddRef(IHTMLOptionElementFactory *iface)
Definition: htmloption.c:488
static HRESULT WINAPI HTMLOptionElementFactory_Invoke(IHTMLOptionElementFactory *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: htmloption.c:534
static HRESULT WINAPI HTMLOptionElementFactory_GetTypeInfo(IHTMLOptionElementFactory *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: htmloption.c:519
static HRESULT WINAPI HTMLOptionElementFactory_create(IHTMLOptionElementFactory *iface, VARIANT text, VARIANT value, VARIANT defaultselected, VARIANT selected, IHTMLOptionElement **optelem)
Definition: htmloption.c:543
static HRESULT WINAPI HTMLOptionElementFactory_GetTypeInfoCount(IHTMLOptionElementFactory *iface, UINT *pctinfo)
Definition: htmloption.c:513
static HRESULT WINAPI HTMLOptionElementFactory_QueryInterface(IHTMLOptionElementFactory *iface, REFIID riid, void **ppv)
Definition: htmloption.c:463
static HRESULT WINAPI HTMLOptionElementFactory_GetIDsOfNames(IHTMLOptionElementFactory *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: htmloption.c:526
static ULONG WINAPI HTMLOptionElementFactory_Release(IHTMLOptionElementFactory *iface)
Definition: htmloption.c:498

Definition at line 595 of file htmloption.c.

Referenced by HTMLOptionElementFactory_Create().

◆ HTMLOptionElementImplVtbl

const NodeImplVtbl HTMLOptionElementImplVtbl
static
Initial value:
= {
}
HRESULT HTMLElement_clone(HTMLDOMNode *iface, nsIDOMNode *nsnode, HTMLDOMNode **ret)
Definition: htmlelem.c:3793
void HTMLElement_destructor(HTMLDOMNode *iface)
Definition: htmlelem.c:3764
HRESULT HTMLElement_handle_event(HTMLDOMNode *iface, DWORD eid, nsIDOMEvent *event, BOOL *prevent_default)
Definition: htmlelem.c:3815
const cpc_entry_t HTMLElement_cpc[]
Definition: htmlelem.c:3847
HRESULT HTMLElement_get_attr_col(HTMLDOMNode *iface, HTMLAttributeCollection **ac)
Definition: htmlelem.c:4827
static void HTMLOptionElement_traverse(HTMLDOMNode *iface, nsCycleCollectionTraversalCallback *cb)
Definition: htmloption.c:385
static void HTMLOptionElement_unlink(HTMLDOMNode *iface)
Definition: htmloption.c:393
static HRESULT HTMLOptionElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
Definition: htmloption.c:360

Definition at line 405 of file htmloption.c.

Referenced by HTMLOptionElement_Create().

◆ HTMLOptionElementVtbl

const IHTMLOptionElementVtbl HTMLOptionElementVtbl
static
Initial value:
= {
}
static HRESULT WINAPI HTMLOptionElement_GetIDsOfNames(IHTMLOptionElement *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: htmloption.c:70
static HRESULT WINAPI HTMLOptionElement_get_text(IHTMLOptionElement *iface, BSTR *p)
Definition: htmloption.c:280
static HRESULT WINAPI HTMLOptionElement_get_defaultSelected(IHTMLOptionElement *iface, VARIANT_BOOL *p)
Definition: htmloption.c:185
static HRESULT WINAPI HTMLOptionElement_put_defaultSelected(IHTMLOptionElement *iface, VARIANT_BOOL v)
Definition: htmloption.c:152
static HRESULT WINAPI HTMLOptionElement_GetTypeInfoCount(IHTMLOptionElement *iface, UINT *pctinfo)
Definition: htmloption.c:56
static HRESULT WINAPI HTMLOptionElement_get_index(IHTMLOptionElement *iface, LONG *p)
Definition: htmloption.c:211
static HRESULT WINAPI HTMLOptionElement_put_index(IHTMLOptionElement *iface, LONG v)
Definition: htmloption.c:204
static HRESULT WINAPI HTMLOptionElement_get_form(IHTMLOptionElement *iface, IHTMLFormElement **p)
Definition: htmloption.c:293
static ULONG WINAPI HTMLOptionElement_Release(IHTMLOptionElement *iface)
Definition: htmloption.c:49
static HRESULT WINAPI HTMLOptionElement_get_value(IHTMLOptionElement *iface, BSTR *p)
Definition: htmloption.c:139
static HRESULT WINAPI HTMLOptionElement_put_text(IHTMLOptionElement *iface, BSTR v)
Definition: htmloption.c:231
static HRESULT WINAPI HTMLOptionElement_GetTypeInfo(IHTMLOptionElement *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: htmloption.c:62
static HRESULT WINAPI HTMLOptionElement_Invoke(IHTMLOptionElement *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: htmloption.c:79
static HRESULT WINAPI HTMLOptionElement_put_value(IHTMLOptionElement *iface, BSTR v)
Definition: htmloption.c:122
static ULONG WINAPI HTMLOptionElement_AddRef(IHTMLOptionElement *iface)
Definition: htmloption.c:42
static HRESULT WINAPI HTMLOptionElement_put_selected(IHTMLOptionElement *iface, VARIANT_BOOL v)
Definition: htmloption.c:88
static HRESULT WINAPI HTMLOptionElement_get_selected(IHTMLOptionElement *iface, VARIANT_BOOL *p)
Definition: htmloption.c:104
static HRESULT WINAPI HTMLOptionElement_QueryInterface(IHTMLOptionElement *iface, REFIID riid, void **ppv)
Definition: htmloption.c:34

Definition at line 334 of file htmloption.c.

Referenced by HTMLOptionElement_Create().