* Sync up to trunk head (r64921).
[reactos.git] / dll / win32 / ieframe / urlhist.c
1 /*
2 * Copyright 2006 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 #include "ieframe.h"
20
21 #include <urlhist.h>
22
23 static HRESULT WINAPI UrlHistoryStg_QueryInterface(IUrlHistoryStg2 *iface, REFIID riid, void **ppv)
24 {
25 *ppv = NULL;
26
27 if(IsEqualGUID(&IID_IUnknown, riid)) {
28 TRACE("(IID_IUnknown %p)\n", ppv);
29 *ppv = iface;
30 }else if(IsEqualGUID(&IID_IUrlHistoryStg, riid)) {
31 TRACE("(IID_IUrlHistoryStg %p)\n", ppv);
32 *ppv = iface;
33 }else if(IsEqualGUID(&IID_IUrlHistoryStg2, riid)) {
34 TRACE("(IID_IUrlHistoryStg2 %p)\n", ppv);
35 *ppv = iface;
36 }
37
38 if(*ppv) {
39 IUnknown_AddRef((IUnknown*)*ppv);
40 return S_OK;
41 }
42
43 WARN("(%s %p)\n", debugstr_guid(riid), ppv);
44 return E_NOINTERFACE;
45 }
46
47 static ULONG WINAPI UrlHistoryStg_AddRef(IUrlHistoryStg2 *iface)
48 {
49 lock_module();
50 return 2;
51 }
52
53 static ULONG WINAPI UrlHistoryStg_Release(IUrlHistoryStg2 *iface)
54 {
55 unlock_module();
56 return 1;
57 }
58
59 static HRESULT WINAPI UrlHistoryStg_AddUrl(IUrlHistoryStg2 *iface, LPCOLESTR lpcsUrl,
60 LPCOLESTR pocsTitle, DWORD dwFlags)
61 {
62 FIXME("(%s %s %08x)\n", debugstr_w(lpcsUrl), debugstr_w(pocsTitle), dwFlags);
63 return E_NOTIMPL;
64 }
65
66 static HRESULT WINAPI UrlHistoryStg_DeleteUrl(IUrlHistoryStg2 *iface, LPCOLESTR lpcsUrl,
67 DWORD dwFlags)
68 {
69 FIXME("(%s %08x)\n", debugstr_w(lpcsUrl), dwFlags);
70 return E_NOTIMPL;
71 }
72
73 static HRESULT WINAPI UrlHistoryStg_QueryUrl(IUrlHistoryStg2 *iface, LPCOLESTR lpcsUrl,
74 DWORD dwFlags, LPSTATURL lpSTATURL)
75 {
76 FIXME("(%s %08x %p)\n", debugstr_w(lpcsUrl), dwFlags, lpSTATURL);
77 return E_NOTIMPL;
78 }
79
80 static HRESULT WINAPI UrlHistoryStg_BindToObject(IUrlHistoryStg2 *iface, LPCOLESTR lpcsUrl,
81 REFIID riid, void **ppv)
82 {
83 FIXME("(%s %s %p)\n", debugstr_w(lpcsUrl), debugstr_guid(riid), ppv);
84 return E_NOTIMPL;
85 }
86
87 static HRESULT WINAPI UrlHistoryStg_EnumUrls(IUrlHistoryStg2 *iface, IEnumSTATURL **ppEnum)
88 {
89 FIXME("(%p)\n", ppEnum);
90 return E_NOTIMPL;
91 }
92
93 static HRESULT WINAPI UrlHistoryStg_AddUrlAndNotify(IUrlHistoryStg2 *iface, LPCOLESTR pocsUrl,
94 LPCOLESTR pocsTitle, DWORD dwFlags, BOOL fWriteHistory, IOleCommandTarget *poctNotify,
95 IUnknown *punkISFolder)
96 {
97 FIXME("(%s %s %08x %x %p %p)\n", debugstr_w(pocsUrl), debugstr_w(pocsTitle),
98 dwFlags, fWriteHistory, poctNotify, punkISFolder);
99 return E_NOTIMPL;
100 }
101
102 static HRESULT WINAPI UrlHistoryStg_ClearHistory(IUrlHistoryStg2 *iface)
103 {
104 FIXME("()\n");
105 return E_NOTIMPL;
106 }
107
108 static const IUrlHistoryStg2Vtbl UrlHistoryStg2Vtbl = {
109 UrlHistoryStg_QueryInterface,
110 UrlHistoryStg_AddRef,
111 UrlHistoryStg_Release,
112 UrlHistoryStg_AddUrl,
113 UrlHistoryStg_DeleteUrl,
114 UrlHistoryStg_QueryUrl,
115 UrlHistoryStg_BindToObject,
116 UrlHistoryStg_EnumUrls,
117 UrlHistoryStg_AddUrlAndNotify,
118 UrlHistoryStg_ClearHistory
119 };
120
121 static IUrlHistoryStg2 UrlHistoryStg2 = { &UrlHistoryStg2Vtbl };
122
123 HRESULT WINAPI CUrlHistory_Create(IClassFactory *iface, IUnknown *pOuter, REFIID riid, void **ppv)
124 {
125 if(pOuter)
126 return CLASS_E_NOAGGREGATION;
127
128 return IUrlHistoryStg2_QueryInterface(&UrlHistoryStg2, riid, ppv);
129 }