2016-04-08 08:30:09 +00:00
|
|
|
/*
|
2018-04-13 20:59:04 +00:00
|
|
|
* PROJECT: shell32
|
|
|
|
* LICENSE: LGPL-2.1+ (https://spdx.org/licenses/LGPL-2.1+)
|
|
|
|
* PURPOSE: FolderItem(s) implementation
|
|
|
|
* COPYRIGHT: Copyright 2015-2018 Mark Jansen (mark.jansen@reactos.org)
|
2016-04-08 08:30:09 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _FOLDERITEM_H_
|
|
|
|
#define _FOLDERITEM_H_
|
|
|
|
|
|
|
|
|
|
|
|
class CFolderItem:
|
|
|
|
public CComCoClass<CFolderItem>,
|
|
|
|
public CComObjectRootEx<CComMultiThreadModelNoCS>,
|
2016-04-11 18:28:31 +00:00
|
|
|
public IDispatchImpl<FolderItem, &IID_FolderItem>
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
|
|
|
private:
|
|
|
|
CComHeapPtr<ITEMIDLIST> m_idlist;
|
2018-04-13 20:59:04 +00:00
|
|
|
CComPtr<Folder> m_Folder;
|
2016-04-08 08:30:09 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
CFolderItem();
|
|
|
|
~CFolderItem();
|
|
|
|
|
2018-04-13 20:59:04 +00:00
|
|
|
HRESULT Initialize(Folder* folder, LPITEMIDLIST idlist);
|
2016-04-08 08:30:09 +00:00
|
|
|
|
|
|
|
// *** FolderItem methods ***
|
2024-03-04 23:43:39 +00:00
|
|
|
STDMETHOD(get_Application)(IDispatch **ppid) override;
|
|
|
|
STDMETHOD(get_Parent)(IDispatch **ppid) override;
|
|
|
|
STDMETHOD(get_Name)(BSTR *pbs) override;
|
|
|
|
STDMETHOD(put_Name)(BSTR bs) override;
|
|
|
|
STDMETHOD(get_Path)(BSTR *pbs) override;
|
|
|
|
STDMETHOD(get_GetLink)(IDispatch **ppid) override;
|
|
|
|
STDMETHOD(get_GetFolder)(IDispatch **ppid) override;
|
|
|
|
STDMETHOD(get_IsLink)(VARIANT_BOOL *pb) override;
|
|
|
|
STDMETHOD(get_IsFolder)(VARIANT_BOOL *pb) override;
|
|
|
|
STDMETHOD(get_IsFileSystem)(VARIANT_BOOL *pb) override;
|
|
|
|
STDMETHOD(get_IsBrowsable)(VARIANT_BOOL *pb) override;
|
|
|
|
STDMETHOD(get_ModifyDate)(DATE *pdt) override;
|
|
|
|
STDMETHOD(put_ModifyDate)(DATE dt) override;
|
|
|
|
STDMETHOD(get_Size)(LONG *pul) override;
|
|
|
|
STDMETHOD(get_Type)(BSTR *pbs) override;
|
|
|
|
STDMETHOD(Verbs)(FolderItemVerbs **ppfic) override;
|
|
|
|
STDMETHOD(InvokeVerb)(VARIANT vVerb) override;
|
2016-04-08 08:30:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
DECLARE_NOT_AGGREGATABLE(CFolderItem)
|
|
|
|
DECLARE_PROTECT_FINAL_CONSTRUCT()
|
|
|
|
|
|
|
|
BEGIN_COM_MAP(CFolderItem)
|
|
|
|
COM_INTERFACE_ENTRY_IID(IID_FolderItem, FolderItem)
|
|
|
|
COM_INTERFACE_ENTRY_IID(IID_IDispatch, IDispatch)
|
|
|
|
END_COM_MAP()
|
|
|
|
};
|
|
|
|
|
|
|
|
class CFolderItems:
|
|
|
|
public CComCoClass<CFolderItems>,
|
|
|
|
public CComObjectRootEx<CComMultiThreadModelNoCS>,
|
2016-04-11 18:28:31 +00:00
|
|
|
public IDispatchImpl<FolderItems, &IID_FolderItems>
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
|
|
|
private:
|
2016-08-21 19:58:32 +00:00
|
|
|
CComHeapPtr<ITEMIDLIST> m_idlist;
|
|
|
|
CComPtr<IEnumIDList> m_EnumIDList;
|
2018-04-13 20:59:04 +00:00
|
|
|
CComPtr<Folder> m_Folder;
|
2016-08-21 19:58:32 +00:00
|
|
|
long m_Count;
|
2016-04-08 08:30:09 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
CFolderItems();
|
|
|
|
~CFolderItems();
|
|
|
|
|
2016-08-21 19:58:32 +00:00
|
|
|
// Please note: CFolderItems takes ownership of idlist.
|
2018-04-13 20:59:04 +00:00
|
|
|
HRESULT Initialize(LPITEMIDLIST idlist, Folder* parent);
|
2016-08-21 19:58:32 +00:00
|
|
|
|
2016-04-08 08:30:09 +00:00
|
|
|
// *** FolderItems methods ***
|
2024-03-04 23:43:39 +00:00
|
|
|
STDMETHOD(get_Count)(long *plCount) override;
|
|
|
|
STDMETHOD(get_Application)(IDispatch **ppid) override;
|
|
|
|
STDMETHOD(get_Parent)(IDispatch **ppid) override;
|
|
|
|
STDMETHOD(Item)(VARIANT index, FolderItem **ppid) override;
|
|
|
|
STDMETHOD(_NewEnum)(IUnknown **ppunk) override;
|
2016-04-08 08:30:09 +00:00
|
|
|
|
|
|
|
DECLARE_NOT_AGGREGATABLE(CFolderItems)
|
|
|
|
DECLARE_PROTECT_FINAL_CONSTRUCT()
|
|
|
|
|
|
|
|
BEGIN_COM_MAP(CFolderItems)
|
|
|
|
COM_INTERFACE_ENTRY_IID(IID_FolderItems, FolderItems)
|
|
|
|
COM_INTERFACE_ENTRY_IID(IID_IDispatch, IDispatch)
|
|
|
|
END_COM_MAP()
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|