1c2c66affSColin Finck /* 2c2c66affSColin Finck * IShellItem implementation 3c2c66affSColin Finck * 4c2c66affSColin Finck * Copyright 2008 Vincent Povirk for CodeWeavers 5c2c66affSColin Finck * Copyright 2009 Andrew Hill 6c2c66affSColin Finck * 7c2c66affSColin Finck * This library is free software; you can redistribute it and/or 8c2c66affSColin Finck * modify it under the terms of the GNU Lesser General Public 9c2c66affSColin Finck * License as published by the Free Software Foundation; either 10c2c66affSColin Finck * version 2.1 of the License, or (at your option) any later version. 11c2c66affSColin Finck * 12c2c66affSColin Finck * This library is distributed in the hope that it will be useful, 13c2c66affSColin Finck * but WITHOUT ANY WARRANTY; without even the implied warranty of 14c2c66affSColin Finck * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15c2c66affSColin Finck * Lesser General Public License for more details. 16c2c66affSColin Finck * 17c2c66affSColin Finck * You should have received a copy of the GNU Lesser General Public 18c2c66affSColin Finck * License along with this library; if not, write to the Free Software 19c2c66affSColin Finck * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 20c2c66affSColin Finck */ 21c2c66affSColin Finck 22c2c66affSColin Finck #ifndef _SHELLITEM_H_ 23c2c66affSColin Finck #define _SHELLITEM_H_ 24c2c66affSColin Finck 25c2c66affSColin Finck class CShellItem : 26c2c66affSColin Finck public CComCoClass<CShellItem, &CLSID_ShellItem>, 27c2c66affSColin Finck public CComObjectRootEx<CComMultiThreadModelNoCS>, 28c2c66affSColin Finck public IShellItem, 29c2c66affSColin Finck public IPersistIDList 30c2c66affSColin Finck { 31c2c66affSColin Finck private: 32c2c66affSColin Finck LPITEMIDLIST m_pidl; 33c2c66affSColin Finck 34c2c66affSColin Finck public: 35c2c66affSColin Finck CShellItem(); 36c2c66affSColin Finck ~CShellItem(); 37c2c66affSColin Finck HRESULT get_parent_pidl(LPITEMIDLIST *parent_pidl); 38c2c66affSColin Finck HRESULT get_parent_shellfolder(IShellFolder **ppsf); 399d731327SGiannis Adamopoulos HRESULT get_shellfolder(IBindCtx *pbc, REFIID riid, void **ppvOut); 40c2c66affSColin Finck 41c2c66affSColin Finck // IShellItem 42*49b2b1daSKatayama Hirofumi MZ STDMETHOD(BindToHandler)(IBindCtx *pbc, REFGUID rbhid, REFIID riid, void **ppvOut) override; 43*49b2b1daSKatayama Hirofumi MZ STDMETHOD(GetParent)(IShellItem **ppsi) override; 44*49b2b1daSKatayama Hirofumi MZ STDMETHOD(GetDisplayName)(SIGDN sigdnName, LPWSTR *ppszName) override; 45*49b2b1daSKatayama Hirofumi MZ STDMETHOD(GetAttributes)(SFGAOF sfgaoMask, SFGAOF *psfgaoAttribs) override; 46*49b2b1daSKatayama Hirofumi MZ STDMETHOD(Compare)(IShellItem *oth, SICHINTF hint, int *piOrder) override; 47c2c66affSColin Finck 48c2c66affSColin Finck // IPersistIDList 49*49b2b1daSKatayama Hirofumi MZ STDMETHOD(GetClassID)(CLSID *pClassID) override; 50*49b2b1daSKatayama Hirofumi MZ STDMETHOD(SetIDList)(PCIDLIST_ABSOLUTE pidl) override; 51*49b2b1daSKatayama Hirofumi MZ STDMETHOD(GetIDList)(PIDLIST_ABSOLUTE *ppidl) override; 52c2c66affSColin Finck 53c2c66affSColin Finck DECLARE_NO_REGISTRY() 54c2c66affSColin Finck DECLARE_NOT_AGGREGATABLE(CShellItem) 55c2c66affSColin Finck 56c2c66affSColin Finck DECLARE_PROTECT_FINAL_CONSTRUCT() 57c2c66affSColin Finck 58c2c66affSColin Finck BEGIN_COM_MAP(CShellItem) 59c2c66affSColin Finck COM_INTERFACE_ENTRY_IID(IID_IShellItem, IShellItem) 60c2c66affSColin Finck COM_INTERFACE_ENTRY_IID(IID_IPersistIDList, IPersistIDList) 61c2c66affSColin Finck END_COM_MAP() 62c2c66affSColin Finck }; 63c2c66affSColin Finck 64c2c66affSColin Finck #endif /* _SHELLITEM_H_ */ 65