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_IDispatch
, riid
)) {
47 TRACE("(%p)->(IID_IDispatch %p)\n", This
, ppv
);
48 *ppv
= HTMLLOCATION(This
);
49 }else if(IsEqualGUID(&IID_IHTMLLocation
, riid
)) {
50 TRACE("(%p)->(IID_IHTMLLocation %p)\n", This
, ppv
);
51 *ppv
= HTMLLOCATION(This
);
55 IUnknown_AddRef((IUnknown
*)*ppv
);
59 WARN("(%p)->(%s %p)\n", This
, debugstr_guid(riid
), ppv
);
63 static ULONG WINAPI
HTMLLocation_AddRef(IHTMLLocation
*iface
)
65 HTMLLocation
*This
= HTMLLOCATION_THIS(iface
);
66 LONG ref
= InterlockedIncrement(&This
->ref
);
68 TRACE("(%p) ref=%d\n", This
, ref
);
73 static ULONG WINAPI
HTMLLocation_Release(IHTMLLocation
*iface
)
75 HTMLLocation
*This
= HTMLLOCATION_THIS(iface
);
76 LONG ref
= InterlockedDecrement(&This
->ref
);
78 TRACE("(%p) ref=%d\n", This
, ref
);
81 if(This
->doc
&& This
->doc
->location
== This
)
82 This
->doc
->location
= NULL
;
89 static HRESULT WINAPI
HTMLLocation_GetTypeInfoCount(IHTMLLocation
*iface
, UINT
*pctinfo
)
91 HTMLLocation
*This
= HTMLLOCATION_THIS(iface
);
92 FIXME("(%p)->(%p)\n", This
, pctinfo
);
96 static HRESULT WINAPI
HTMLLocation_GetTypeInfo(IHTMLLocation
*iface
, UINT iTInfo
,
97 LCID lcid
, ITypeInfo
**ppTInfo
)
99 HTMLLocation
*This
= HTMLLOCATION_THIS(iface
);
100 FIXME("(%p)->(%u %u %p)\n", This
, iTInfo
, lcid
, ppTInfo
);
104 static HRESULT WINAPI
HTMLLocation_GetIDsOfNames(IHTMLLocation
*iface
, REFIID riid
,
105 LPOLESTR
*rgszNames
, UINT cNames
,
106 LCID lcid
, DISPID
*rgDispId
)
108 HTMLLocation
*This
= HTMLLOCATION_THIS(iface
);
109 FIXME("(%p)->(%s %p %u %u %p)\n", This
, debugstr_guid(riid
), rgszNames
, cNames
,
114 static HRESULT WINAPI
HTMLLocation_Invoke(IHTMLLocation
*iface
, DISPID dispIdMember
,
115 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
116 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
118 HTMLLocation
*This
= HTMLLOCATION_THIS(iface
);
119 FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This
, dispIdMember
, debugstr_guid(riid
),
120 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
124 static HRESULT WINAPI
HTMLLocation_put_href(IHTMLLocation
*iface
, BSTR v
)
126 HTMLLocation
*This
= HTMLLOCATION_THIS(iface
);
127 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
131 static HRESULT WINAPI
HTMLLocation_get_href(IHTMLLocation
*iface
, BSTR
*p
)
133 HTMLLocation
*This
= HTMLLOCATION_THIS(iface
);
134 FIXME("(%p)->(%p)\n", This
, p
);
138 static HRESULT WINAPI
HTMLLocation_put_protocol(IHTMLLocation
*iface
, BSTR v
)
140 HTMLLocation
*This
= HTMLLOCATION_THIS(iface
);
141 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
145 static HRESULT WINAPI
HTMLLocation_get_protocol(IHTMLLocation
*iface
, BSTR
*p
)
147 HTMLLocation
*This
= HTMLLOCATION_THIS(iface
);
148 FIXME("(%p)->(%p)\n", This
, p
);
152 static HRESULT WINAPI
HTMLLocation_put_host(IHTMLLocation
*iface
, BSTR v
)
154 HTMLLocation
*This
= HTMLLOCATION_THIS(iface
);
155 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
159 static HRESULT WINAPI
HTMLLocation_get_host(IHTMLLocation
*iface
, BSTR
*p
)
161 HTMLLocation
*This
= HTMLLOCATION_THIS(iface
);
162 FIXME("(%p)->(%p)\n", This
, p
);
166 static HRESULT WINAPI
HTMLLocation_put_hostname(IHTMLLocation
*iface
, BSTR v
)
168 HTMLLocation
*This
= HTMLLOCATION_THIS(iface
);
169 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
173 static HRESULT WINAPI
HTMLLocation_get_hostname(IHTMLLocation
*iface
, BSTR
*p
)
175 HTMLLocation
*This
= HTMLLOCATION_THIS(iface
);
176 FIXME("(%p)->(%p)\n", This
, p
);
180 static HRESULT WINAPI
HTMLLocation_put_port(IHTMLLocation
*iface
, BSTR v
)
182 HTMLLocation
*This
= HTMLLOCATION_THIS(iface
);
183 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
187 static HRESULT WINAPI
HTMLLocation_get_port(IHTMLLocation
*iface
, BSTR
*p
)
189 HTMLLocation
*This
= HTMLLOCATION_THIS(iface
);
190 FIXME("(%p)->(%p)\n", This
, p
);
194 static HRESULT WINAPI
HTMLLocation_put_pathname(IHTMLLocation
*iface
, BSTR v
)
196 HTMLLocation
*This
= HTMLLOCATION_THIS(iface
);
197 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
201 static HRESULT WINAPI
HTMLLocation_get_pathname(IHTMLLocation
*iface
, BSTR
*p
)
203 HTMLLocation
*This
= HTMLLOCATION_THIS(iface
);
204 FIXME("(%p)->(%p)\n", This
, p
);
208 static HRESULT WINAPI
HTMLLocation_put_search(IHTMLLocation
*iface
, BSTR v
)
210 HTMLLocation
*This
= HTMLLOCATION_THIS(iface
);
211 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
215 static HRESULT WINAPI
HTMLLocation_get_search(IHTMLLocation
*iface
, BSTR
*p
)
217 HTMLLocation
*This
= HTMLLOCATION_THIS(iface
);
218 FIXME("(%p)->(%p)\n", This
, p
);
222 static HRESULT WINAPI
HTMLLocation_put_hash(IHTMLLocation
*iface
, BSTR v
)
224 HTMLLocation
*This
= HTMLLOCATION_THIS(iface
);
225 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
229 static HRESULT WINAPI
HTMLLocation_get_hash(IHTMLLocation
*iface
, BSTR
*p
)
231 HTMLLocation
*This
= HTMLLOCATION_THIS(iface
);
232 FIXME("(%p)->(%p)\n", This
, p
);
236 static HRESULT WINAPI
HTMLLocation_reload(IHTMLLocation
*iface
, VARIANT_BOOL flag
)
238 HTMLLocation
*This
= HTMLLOCATION_THIS(iface
);
239 FIXME("(%p)->(%x)\n", This
, flag
);
243 static HRESULT WINAPI
HTMLLocation_replace(IHTMLLocation
*iface
, BSTR bstr
)
245 HTMLLocation
*This
= HTMLLOCATION_THIS(iface
);
246 FIXME("(%p)->(%s)\n", This
, debugstr_w(bstr
));
250 static HRESULT WINAPI
HTMLLocation_assign(IHTMLLocation
*iface
, BSTR bstr
)
252 HTMLLocation
*This
= HTMLLOCATION_THIS(iface
);
253 FIXME("(%p)->(%s)\n", This
, debugstr_w(bstr
));
257 static HRESULT WINAPI
HTMLLocation_toString(IHTMLLocation
*iface
, BSTR
*String
)
259 HTMLLocation
*This
= HTMLLOCATION_THIS(iface
);
260 FIXME("(%p)->(%p)\n", This
, String
);
264 #undef HTMLLOCATION_THIS
266 static const IHTMLLocationVtbl HTMLLocationVtbl
= {
267 HTMLLocation_QueryInterface
,
269 HTMLLocation_Release
,
270 HTMLLocation_GetTypeInfoCount
,
271 HTMLLocation_GetTypeInfo
,
272 HTMLLocation_GetIDsOfNames
,
274 HTMLLocation_put_href
,
275 HTMLLocation_get_href
,
276 HTMLLocation_put_protocol
,
277 HTMLLocation_get_protocol
,
278 HTMLLocation_put_host
,
279 HTMLLocation_get_host
,
280 HTMLLocation_put_hostname
,
281 HTMLLocation_get_hostname
,
282 HTMLLocation_put_port
,
283 HTMLLocation_get_port
,
284 HTMLLocation_put_pathname
,
285 HTMLLocation_get_pathname
,
286 HTMLLocation_put_search
,
287 HTMLLocation_get_search
,
288 HTMLLocation_put_hash
,
289 HTMLLocation_get_hash
,
291 HTMLLocation_replace
,
293 HTMLLocation_toString
296 HTMLLocation
*HTMLLocation_Create(HTMLDocument
*doc
)
298 HTMLLocation
*ret
= heap_alloc(sizeof(*ret
));
300 ret
->lpHTMLLocationVtbl
= &HTMLLocationVtbl
;