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