push 9d6e510d5bb9560a6aa2e6ec402cb2d2444b5081
[wine/hacks.git] / dlls / mshtml / htmllocation.c
blob5f0d7fbe51e77dabc5841ba0f68d578d8649cb8d
1 /*
2 * Copyright 2008 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
19 #include <stdarg.h>
21 #define COBJMACROS
23 #include "windef.h"
24 #include "winbase.h"
25 #include "winuser.h"
26 #include "ole2.h"
28 #include "wine/debug.h"
30 #include "mshtml_private.h"
31 #include "resource.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
35 #define HTMLLOCATION_THIS(iface) DEFINE_THIS(HTMLLocation, HTMLLocation, iface)
37 static HRESULT WINAPI HTMLLocation_QueryInterface(IHTMLLocation *iface, REFIID riid, void **ppv)
39 HTMLLocation *This = HTMLLOCATION_THIS(iface);
41 *ppv = NULL;
43 if(IsEqualGUID(&IID_IUnknown, riid)) {
44 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
45 *ppv = HTMLLOCATION(This);
46 }else if(IsEqualGUID(&IID_IHTMLLocation, riid)) {
47 TRACE("(%p)->(IID_IHTMLLocation %p)\n", This, ppv);
48 *ppv = HTMLLOCATION(This);
49 }else if(dispex_query_interface(&This->dispex, riid, ppv)) {
50 return *ppv ? S_OK : E_NOINTERFACE;
53 if(*ppv) {
54 IUnknown_AddRef((IUnknown*)*ppv);
55 return S_OK;
58 WARN("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
59 return E_NOINTERFACE;
62 static ULONG WINAPI HTMLLocation_AddRef(IHTMLLocation *iface)
64 HTMLLocation *This = HTMLLOCATION_THIS(iface);
65 LONG ref = InterlockedIncrement(&This->ref);
67 TRACE("(%p) ref=%d\n", This, ref);
69 return ref;
72 static ULONG WINAPI HTMLLocation_Release(IHTMLLocation *iface)
74 HTMLLocation *This = HTMLLOCATION_THIS(iface);
75 LONG ref = InterlockedDecrement(&This->ref);
77 TRACE("(%p) ref=%d\n", This, ref);
79 if(!ref) {
80 if(This->doc && This->doc->location == This)
81 This->doc->location = NULL;
82 heap_free(This);
85 return ref;
88 static HRESULT WINAPI HTMLLocation_GetTypeInfoCount(IHTMLLocation *iface, UINT *pctinfo)
90 HTMLLocation *This = HTMLLOCATION_THIS(iface);
91 FIXME("(%p)->(%p)\n", This, pctinfo);
92 return E_NOTIMPL;
95 static HRESULT WINAPI HTMLLocation_GetTypeInfo(IHTMLLocation *iface, UINT iTInfo,
96 LCID lcid, ITypeInfo **ppTInfo)
98 HTMLLocation *This = HTMLLOCATION_THIS(iface);
99 FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
100 return E_NOTIMPL;
103 static HRESULT WINAPI HTMLLocation_GetIDsOfNames(IHTMLLocation *iface, REFIID riid,
104 LPOLESTR *rgszNames, UINT cNames,
105 LCID lcid, DISPID *rgDispId)
107 HTMLLocation *This = HTMLLOCATION_THIS(iface);
108 FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
109 lcid, rgDispId);
110 return E_NOTIMPL;
113 static HRESULT WINAPI HTMLLocation_Invoke(IHTMLLocation *iface, DISPID dispIdMember,
114 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
115 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
117 HTMLLocation *This = HTMLLOCATION_THIS(iface);
118 FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
119 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
120 return E_NOTIMPL;
123 static HRESULT WINAPI HTMLLocation_put_href(IHTMLLocation *iface, BSTR v)
125 HTMLLocation *This = HTMLLOCATION_THIS(iface);
126 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
127 return E_NOTIMPL;
130 static HRESULT WINAPI HTMLLocation_get_href(IHTMLLocation *iface, BSTR *p)
132 HTMLLocation *This = HTMLLOCATION_THIS(iface);
133 FIXME("(%p)->(%p)\n", This, p);
134 return E_NOTIMPL;
137 static HRESULT WINAPI HTMLLocation_put_protocol(IHTMLLocation *iface, BSTR v)
139 HTMLLocation *This = HTMLLOCATION_THIS(iface);
140 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
141 return E_NOTIMPL;
144 static HRESULT WINAPI HTMLLocation_get_protocol(IHTMLLocation *iface, BSTR *p)
146 HTMLLocation *This = HTMLLOCATION_THIS(iface);
147 FIXME("(%p)->(%p)\n", This, p);
148 return E_NOTIMPL;
151 static HRESULT WINAPI HTMLLocation_put_host(IHTMLLocation *iface, BSTR v)
153 HTMLLocation *This = HTMLLOCATION_THIS(iface);
154 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
155 return E_NOTIMPL;
158 static HRESULT WINAPI HTMLLocation_get_host(IHTMLLocation *iface, BSTR *p)
160 HTMLLocation *This = HTMLLOCATION_THIS(iface);
161 FIXME("(%p)->(%p)\n", This, p);
162 return E_NOTIMPL;
165 static HRESULT WINAPI HTMLLocation_put_hostname(IHTMLLocation *iface, BSTR v)
167 HTMLLocation *This = HTMLLOCATION_THIS(iface);
168 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
169 return E_NOTIMPL;
172 static HRESULT WINAPI HTMLLocation_get_hostname(IHTMLLocation *iface, BSTR *p)
174 HTMLLocation *This = HTMLLOCATION_THIS(iface);
175 FIXME("(%p)->(%p)\n", This, p);
176 return E_NOTIMPL;
179 static HRESULT WINAPI HTMLLocation_put_port(IHTMLLocation *iface, BSTR v)
181 HTMLLocation *This = HTMLLOCATION_THIS(iface);
182 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
183 return E_NOTIMPL;
186 static HRESULT WINAPI HTMLLocation_get_port(IHTMLLocation *iface, BSTR *p)
188 HTMLLocation *This = HTMLLOCATION_THIS(iface);
189 FIXME("(%p)->(%p)\n", This, p);
190 return E_NOTIMPL;
193 static HRESULT WINAPI HTMLLocation_put_pathname(IHTMLLocation *iface, BSTR v)
195 HTMLLocation *This = HTMLLOCATION_THIS(iface);
196 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
197 return E_NOTIMPL;
200 static HRESULT WINAPI HTMLLocation_get_pathname(IHTMLLocation *iface, BSTR *p)
202 HTMLLocation *This = HTMLLOCATION_THIS(iface);
203 FIXME("(%p)->(%p)\n", This, p);
204 return E_NOTIMPL;
207 static HRESULT WINAPI HTMLLocation_put_search(IHTMLLocation *iface, BSTR v)
209 HTMLLocation *This = HTMLLOCATION_THIS(iface);
210 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
211 return E_NOTIMPL;
214 static HRESULT WINAPI HTMLLocation_get_search(IHTMLLocation *iface, BSTR *p)
216 HTMLLocation *This = HTMLLOCATION_THIS(iface);
217 FIXME("(%p)->(%p)\n", This, p);
218 return E_NOTIMPL;
221 static HRESULT WINAPI HTMLLocation_put_hash(IHTMLLocation *iface, BSTR v)
223 HTMLLocation *This = HTMLLOCATION_THIS(iface);
224 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
225 return E_NOTIMPL;
228 static HRESULT WINAPI HTMLLocation_get_hash(IHTMLLocation *iface, BSTR *p)
230 HTMLLocation *This = HTMLLOCATION_THIS(iface);
231 FIXME("(%p)->(%p)\n", This, p);
232 return E_NOTIMPL;
235 static HRESULT WINAPI HTMLLocation_reload(IHTMLLocation *iface, VARIANT_BOOL flag)
237 HTMLLocation *This = HTMLLOCATION_THIS(iface);
238 FIXME("(%p)->(%x)\n", This, flag);
239 return E_NOTIMPL;
242 static HRESULT WINAPI HTMLLocation_replace(IHTMLLocation *iface, BSTR bstr)
244 HTMLLocation *This = HTMLLOCATION_THIS(iface);
245 FIXME("(%p)->(%s)\n", This, debugstr_w(bstr));
246 return E_NOTIMPL;
249 static HRESULT WINAPI HTMLLocation_assign(IHTMLLocation *iface, BSTR bstr)
251 HTMLLocation *This = HTMLLOCATION_THIS(iface);
252 FIXME("(%p)->(%s)\n", This, debugstr_w(bstr));
253 return E_NOTIMPL;
256 static HRESULT WINAPI HTMLLocation_toString(IHTMLLocation *iface, BSTR *String)
258 HTMLLocation *This = HTMLLOCATION_THIS(iface);
259 FIXME("(%p)->(%p)\n", This, String);
260 return E_NOTIMPL;
263 #undef HTMLLOCATION_THIS
265 static const IHTMLLocationVtbl HTMLLocationVtbl = {
266 HTMLLocation_QueryInterface,
267 HTMLLocation_AddRef,
268 HTMLLocation_Release,
269 HTMLLocation_GetTypeInfoCount,
270 HTMLLocation_GetTypeInfo,
271 HTMLLocation_GetIDsOfNames,
272 HTMLLocation_Invoke,
273 HTMLLocation_put_href,
274 HTMLLocation_get_href,
275 HTMLLocation_put_protocol,
276 HTMLLocation_get_protocol,
277 HTMLLocation_put_host,
278 HTMLLocation_get_host,
279 HTMLLocation_put_hostname,
280 HTMLLocation_get_hostname,
281 HTMLLocation_put_port,
282 HTMLLocation_get_port,
283 HTMLLocation_put_pathname,
284 HTMLLocation_get_pathname,
285 HTMLLocation_put_search,
286 HTMLLocation_get_search,
287 HTMLLocation_put_hash,
288 HTMLLocation_get_hash,
289 HTMLLocation_reload,
290 HTMLLocation_replace,
291 HTMLLocation_assign,
292 HTMLLocation_toString
295 static const tid_t HTMLLocation_iface_tids[] = {
296 IHTMLLocation_tid,
299 static dispex_static_data_t HTMLLocation_dispex = {
300 NULL,
301 IHTMLLocation_tid,
302 NULL,
303 HTMLLocation_iface_tids
307 HTMLLocation *HTMLLocation_Create(HTMLDocument *doc)
309 HTMLLocation *ret = heap_alloc(sizeof(*ret));
311 ret->lpHTMLLocationVtbl = &HTMLLocationVtbl;
312 ret->ref = 1;
313 ret->doc = doc;
315 init_dispex(&ret->dispex, (IUnknown*)HTMLLOCATION(ret), &HTMLLocation_dispex);
317 return ret;