wintrust: Use path in WIN_TRUST_SUBJECT_FILE structure rather than assuming a path...
[wine] / dlls / mshtml / htmlgeneric.c
1 /*
2  * Copyright 2008 Jacek Caban for CodeWeavers
3  *
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.
8  *
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.
13  *
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
17  */
18
19
20 #include <stdarg.h>
21
22 #define COBJMACROS
23
24 #include "windef.h"
25 #include "winbase.h"
26 #include "winuser.h"
27 #include "ole2.h"
28
29 #include "wine/debug.h"
30
31 #include "mshtml_private.h"
32
33 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
34
35 typedef struct {
36     HTMLElement element;
37
38     const IHTMLGenericElementVtbl *lpHTMLGenericElementVtbl;
39 } HTMLGenericElement;
40
41 #define HTMLGENERIC(x)  ((IHTMLGenericElement*)  &(x)->lpHTMLGenericElementVtbl)
42
43 #define HTMLGENERIC_THIS(iface) DEFINE_THIS(HTMLGenericElement, HTMLGenericElement, iface)
44
45 static HRESULT WINAPI HTMLGenericElement_QueryInterface(IHTMLGenericElement *iface, REFIID riid, void **ppv)
46 {
47     HTMLGenericElement *This = HTMLGENERIC_THIS(iface);
48
49     return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(&This->element.node), riid, ppv);
50 }
51
52 static ULONG WINAPI HTMLGenericElement_AddRef(IHTMLGenericElement *iface)
53 {
54     HTMLGenericElement *This = HTMLGENERIC_THIS(iface);
55
56     return IHTMLDOMNode_AddRef(HTMLDOMNODE(&This->element.node));
57 }
58
59 static ULONG WINAPI HTMLGenericElement_Release(IHTMLGenericElement *iface)
60 {
61     HTMLGenericElement *This = HTMLGENERIC_THIS(iface);
62
63     return IHTMLDOMNode_Release(HTMLDOMNODE(&This->element.node));
64 }
65
66 static HRESULT WINAPI HTMLGenericElement_GetTypeInfoCount(IHTMLGenericElement *iface, UINT *pctinfo)
67 {
68     HTMLGenericElement *This = HTMLGENERIC_THIS(iface);
69     FIXME("(%p)->(%p)\n", This, pctinfo);
70     return E_NOTIMPL;
71 }
72
73 static HRESULT WINAPI HTMLGenericElement_GetTypeInfo(IHTMLGenericElement *iface, UINT iTInfo,
74                                               LCID lcid, ITypeInfo **ppTInfo)
75 {
76     HTMLGenericElement *This = HTMLGENERIC_THIS(iface);
77     FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
78     return E_NOTIMPL;
79 }
80
81 static HRESULT WINAPI HTMLGenericElement_GetIDsOfNames(IHTMLGenericElement *iface, REFIID riid,
82         LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
83 {
84     HTMLGenericElement *This = HTMLGENERIC_THIS(iface);
85     FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
86           lcid, rgDispId);
87     return E_NOTIMPL;
88 }
89
90 static HRESULT WINAPI HTMLGenericElement_Invoke(IHTMLGenericElement *iface, DISPID dispIdMember,
91         REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
92         VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
93 {
94     HTMLGenericElement *This = HTMLGENERIC_THIS(iface);
95     FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
96           lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
97     return E_NOTIMPL;
98 }
99
100 static HRESULT WINAPI HTMLGenericElement_get_recordset(IHTMLGenericElement *iface, IDispatch **p)
101 {
102     HTMLGenericElement *This = HTMLGENERIC_THIS(iface);
103     FIXME("(%p)->(%p)\n", This, p);
104     return E_NOTIMPL;
105 }
106
107 static HRESULT WINAPI HTMLGenericElement_namedRecordset(IHTMLGenericElement *iface,
108         BSTR dataMember, VARIANT *hierarchy, IDispatch **ppRecordset)
109 {
110     HTMLGenericElement *This = HTMLGENERIC_THIS(iface);
111     FIXME("(%p)->(%s %p %p)\n", This, debugstr_w(dataMember), hierarchy, ppRecordset);
112     return E_NOTIMPL;
113 }
114
115 static const IHTMLGenericElementVtbl HTMLGenericElementVtbl = {
116     HTMLGenericElement_QueryInterface,
117     HTMLGenericElement_AddRef,
118     HTMLGenericElement_Release,
119     HTMLGenericElement_GetTypeInfoCount,
120     HTMLGenericElement_GetTypeInfo,
121     HTMLGenericElement_GetIDsOfNames,
122     HTMLGenericElement_Invoke,
123     HTMLGenericElement_get_recordset,
124     HTMLGenericElement_namedRecordset
125 };
126
127 #define HTMLGENERIC_NODE_THIS(iface) DEFINE_THIS2(HTMLGenericElement, element.node, iface)
128
129 static HRESULT HTMLGenericElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
130 {
131     HTMLGenericElement *This = HTMLGENERIC_NODE_THIS(iface);
132
133     *ppv = NULL;
134
135     if(IsEqualGUID(&IID_IHTMLGenericElement, riid)) {
136         TRACE("(%p)->(IID_IHTMLGenericElement %p)\n", This, ppv);
137         *ppv = HTMLGENERIC(This);
138     }else {
139         return HTMLElement_QI(&This->element.node, riid, ppv);
140     }
141
142     IUnknown_AddRef((IUnknown*)*ppv);
143     return S_OK;
144 }
145
146 static void HTMLGenericElement_destructor(HTMLDOMNode *iface)
147 {
148     HTMLGenericElement *This = HTMLGENERIC_NODE_THIS(iface);
149
150     HTMLElement_destructor(&This->element.node);
151 }
152
153 #undef HTMLGENERIC_NODE_THIS
154
155 static const NodeImplVtbl HTMLGenericElementImplVtbl = {
156     HTMLGenericElement_QI,
157     HTMLGenericElement_destructor
158 };
159
160 static const tid_t HTMLGenericElement_iface_tids[] = {
161     IHTMLDOMNode_tid,
162     IHTMLDOMNode2_tid,
163     IHTMLElement_tid,
164     IHTMLElement2_tid,
165     IHTMLElement2_tid,
166     IHTMLGenericElement_tid,
167     0
168 };
169
170 static dispex_static_data_t HTMLGenericElement_dispex = {
171     NULL,
172     DispHTMLGenericElement_tid,
173     NULL,
174     HTMLGenericElement_iface_tids
175 };
176
177 HTMLElement *HTMLGenericElement_Create(nsIDOMHTMLElement *nselem)
178 {
179     HTMLGenericElement *ret;
180
181     ret = heap_alloc_zero(sizeof(HTMLGenericElement));
182
183     ret->lpHTMLGenericElementVtbl = &HTMLGenericElementVtbl;
184     ret->element.node.vtbl = &HTMLGenericElementImplVtbl;
185
186     init_dispex(&ret->element.node.dispex, (IUnknown*)HTMLGENERIC(ret), &HTMLGenericElement_dispex);
187     HTMLElement_Init(&ret->element);
188
189     return &ret->element;
190 }