2016-04-08 08:30:09 +00:00
|
|
|
/*
|
|
|
|
* FolderItemVerb(s) implementation
|
|
|
|
*
|
|
|
|
* Copyright 2015 Mark Jansen
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _FOLDERITEMVERBS_H_
|
|
|
|
#define _FOLDERITEMVERBS_H_
|
|
|
|
|
|
|
|
class CFolderItemVerb:
|
|
|
|
public CComCoClass<CFolderItemVerb>,
|
|
|
|
public CComObjectRootEx<CComMultiThreadModelNoCS>,
|
2016-04-11 18:28:31 +00:00
|
|
|
public IDispatchImpl<FolderItemVerb, &IID_FolderItemVerb>
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
|
|
|
private:
|
2016-04-11 18:28:31 +00:00
|
|
|
CComPtr<IContextMenu> m_contextmenu;
|
|
|
|
CComBSTR m_name;
|
2016-04-08 08:30:09 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
CFolderItemVerb();
|
|
|
|
~CFolderItemVerb();
|
|
|
|
|
2016-04-11 18:28:31 +00:00
|
|
|
void Init(IContextMenu* menu, BSTR name);
|
2016-04-08 08:30:09 +00:00
|
|
|
|
|
|
|
// *** FolderItemVerb 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(DoIt)() override;
|
2016-04-08 08:30:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
DECLARE_NOT_AGGREGATABLE(CFolderItemVerb)
|
|
|
|
DECLARE_PROTECT_FINAL_CONSTRUCT()
|
|
|
|
|
|
|
|
BEGIN_COM_MAP(CFolderItemVerb)
|
|
|
|
COM_INTERFACE_ENTRY_IID(IID_FolderItemVerb, FolderItemVerb)
|
|
|
|
COM_INTERFACE_ENTRY_IID(IID_IDispatch, IDispatch)
|
|
|
|
END_COM_MAP()
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class CFolderItemVerbs:
|
|
|
|
public CComCoClass<CFolderItemVerbs>,
|
|
|
|
public CComObjectRootEx<CComMultiThreadModelNoCS>,
|
2016-04-11 18:28:31 +00:00
|
|
|
public IDispatchImpl<FolderItemVerbs, &IID_FolderItemVerbs>
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
|
|
|
private:
|
2016-04-11 18:28:31 +00:00
|
|
|
CComPtr<IContextMenu> m_contextmenu;
|
|
|
|
HMENU m_menu;
|
|
|
|
int m_count;
|
2016-04-08 08:30:09 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
CFolderItemVerbs();
|
2016-04-11 18:28:31 +00:00
|
|
|
virtual ~CFolderItemVerbs();
|
2016-04-08 08:30:09 +00:00
|
|
|
|
2016-04-11 18:28:31 +00:00
|
|
|
HRESULT Init(LPITEMIDLIST idlist);
|
2016-04-08 08:30:09 +00:00
|
|
|
|
|
|
|
// *** FolderItemVerbs 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, FolderItemVerb **ppid) override;
|
|
|
|
STDMETHOD(_NewEnum)(IUnknown **ppunk) override;
|
2016-04-08 08:30:09 +00:00
|
|
|
|
|
|
|
DECLARE_NOT_AGGREGATABLE(CFolderItemVerbs)
|
|
|
|
DECLARE_PROTECT_FINAL_CONSTRUCT()
|
|
|
|
|
|
|
|
BEGIN_COM_MAP(CFolderItemVerbs)
|
|
|
|
COM_INTERFACE_ENTRY_IID(IID_FolderItemVerbs, FolderItemVerbs)
|
|
|
|
COM_INTERFACE_ENTRY_IID(IID_IDispatch, IDispatch)
|
|
|
|
END_COM_MAP()
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|