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
28 #include "wine/debug.h"
30 #include "mshtml_private.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
);
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
;
54 IUnknown_AddRef((IUnknown
*)*ppv
);
58 WARN("(%p)->(%s %p)\n", This
, debugstr_guid(riid
), ppv
);
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
);
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
);
80 if(This
->doc
&& This
->doc
->location
== This
)
81 This
->doc
->location
= NULL
;
88 static HRESULT WINAPI
HTMLLocation_GetTypeInfoCount(IHTMLLocation
*iface
, UINT
*pctinfo
)
90 HTMLLocation
*This
= HTMLLOCATION_THIS(iface
);
91 FIXME("(%p)->(%p)\n", This
, pctinfo
);
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
);
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
,
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
);
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
));
130 static HRESULT WINAPI
HTMLLocation_get_href(IHTMLLocation
*iface
, BSTR
*p
)
132 HTMLLocation
*This
= HTMLLOCATION_THIS(iface
);
133 FIXME("(%p)->(%p)\n", This
, p
);
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
));
144 static HRESULT WINAPI
HTMLLocation_get_protocol(IHTMLLocation
*iface
, BSTR
*p
)
146 HTMLLocation
*This
= HTMLLOCATION_THIS(iface
);
147 FIXME("(%p)->(%p)\n", This
, p
);
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
));
158 static HRESULT WINAPI
HTMLLocation_get_host(IHTMLLocation
*iface
, BSTR
*p
)
160 HTMLLocation
*This
= HTMLLOCATION_THIS(iface
);
161 FIXME("(%p)->(%p)\n", This
, p
);
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
));
172 static HRESULT WINAPI
HTMLLocation_get_hostname(IHTMLLocation
*iface
, BSTR
*p
)
174 HTMLLocation
*This
= HTMLLOCATION_THIS(iface
);
175 FIXME("(%p)->(%p)\n", This
, p
);
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
));
186 static HRESULT WINAPI
HTMLLocation_get_port(IHTMLLocation
*iface
, BSTR
*p
)
188 HTMLLocation
*This
= HTMLLOCATION_THIS(iface
);
189 FIXME("(%p)->(%p)\n", This
, p
);
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
));
200 static HRESULT WINAPI
HTMLLocation_get_pathname(IHTMLLocation
*iface
, BSTR
*p
)
202 HTMLLocation
*This
= HTMLLOCATION_THIS(iface
);
203 FIXME("(%p)->(%p)\n", This
, p
);
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
));
214 static HRESULT WINAPI
HTMLLocation_get_search(IHTMLLocation
*iface
, BSTR
*p
)
216 HTMLLocation
*This
= HTMLLOCATION_THIS(iface
);
217 FIXME("(%p)->(%p)\n", This
, p
);
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
));
228 static HRESULT WINAPI
HTMLLocation_get_hash(IHTMLLocation
*iface
, BSTR
*p
)
230 HTMLLocation
*This
= HTMLLOCATION_THIS(iface
);
231 FIXME("(%p)->(%p)\n", This
, p
);
235 static HRESULT WINAPI
HTMLLocation_reload(IHTMLLocation
*iface
, VARIANT_BOOL flag
)
237 HTMLLocation
*This
= HTMLLOCATION_THIS(iface
);
238 FIXME("(%p)->(%x)\n", This
, flag
);
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
));
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
));
256 static HRESULT WINAPI
HTMLLocation_toString(IHTMLLocation
*iface
, BSTR
*String
)
258 HTMLLocation
*This
= HTMLLOCATION_THIS(iface
);
259 FIXME("(%p)->(%p)\n", This
, String
);
263 #undef HTMLLOCATION_THIS
265 static const IHTMLLocationVtbl HTMLLocationVtbl
= {
266 HTMLLocation_QueryInterface
,
268 HTMLLocation_Release
,
269 HTMLLocation_GetTypeInfoCount
,
270 HTMLLocation_GetTypeInfo
,
271 HTMLLocation_GetIDsOfNames
,
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
,
290 HTMLLocation_replace
,
292 HTMLLocation_toString
295 static const tid_t HTMLLocation_iface_tids
[] = {
299 static dispex_static_data_t HTMLLocation_dispex
= {
303 HTMLLocation_iface_tids
307 HTMLLocation
*HTMLLocation_Create(HTMLDocument
*doc
)
309 HTMLLocation
*ret
= heap_alloc(sizeof(*ret
));
311 ret
->lpHTMLLocationVtbl
= &HTMLLocationVtbl
;
315 init_dispex(&ret
->dispex
, (IUnknown
*)HTMLLOCATION(ret
), &HTMLLocation_dispex
);