1c2c66affSColin Finck /*
2c2c66affSColin Finck  * FolderItemVerb(s) implementation
3c2c66affSColin Finck  *
4c2c66affSColin Finck  * Copyright 2015 Mark Jansen
5c2c66affSColin Finck  *
6c2c66affSColin Finck  * This library is free software; you can redistribute it and/or
7c2c66affSColin Finck  * modify it under the terms of the GNU Lesser General Public
8c2c66affSColin Finck  * License as published by the Free Software Foundation; either
9c2c66affSColin Finck  * version 2.1 of the License, or (at your option) any later version.
10c2c66affSColin Finck  *
11c2c66affSColin Finck  * This library is distributed in the hope that it will be useful,
12c2c66affSColin Finck  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13c2c66affSColin Finck  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14c2c66affSColin Finck  * Lesser General Public License for more details.
15c2c66affSColin Finck  *
16c2c66affSColin Finck  * You should have received a copy of the GNU Lesser General Public
17c2c66affSColin Finck  * License along with this library; if not, write to the Free Software
18c2c66affSColin Finck  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19c2c66affSColin Finck  */
20c2c66affSColin Finck 
21c2c66affSColin Finck #ifndef _FOLDERITEMVERBS_H_
22c2c66affSColin Finck #define _FOLDERITEMVERBS_H_
23c2c66affSColin Finck 
24c2c66affSColin Finck class CFolderItemVerb:
25c2c66affSColin Finck     public CComCoClass<CFolderItemVerb>,
26c2c66affSColin Finck     public CComObjectRootEx<CComMultiThreadModelNoCS>,
27c2c66affSColin Finck     public IDispatchImpl<FolderItemVerb, &IID_FolderItemVerb>
28c2c66affSColin Finck {
29c2c66affSColin Finck private:
30c2c66affSColin Finck     CComPtr<IContextMenu> m_contextmenu;
31c2c66affSColin Finck     CComBSTR m_name;
32c2c66affSColin Finck 
33c2c66affSColin Finck public:
34c2c66affSColin Finck     CFolderItemVerb();
35c2c66affSColin Finck     ~CFolderItemVerb();
36c2c66affSColin Finck 
37c2c66affSColin Finck     void Init(IContextMenu* menu, BSTR name);
38c2c66affSColin Finck 
39c2c66affSColin Finck     // *** FolderItemVerb methods ***
40*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(get_Application)(IDispatch **ppid) override;
41*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(get_Parent)(IDispatch **ppid) override;
42*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(get_Name)(BSTR *pbs) override;
43*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(DoIt)() override;
44c2c66affSColin Finck 
45c2c66affSColin Finck 
46c2c66affSColin Finck DECLARE_NOT_AGGREGATABLE(CFolderItemVerb)
47c2c66affSColin Finck DECLARE_PROTECT_FINAL_CONSTRUCT()
48c2c66affSColin Finck 
49c2c66affSColin Finck BEGIN_COM_MAP(CFolderItemVerb)
50c2c66affSColin Finck     COM_INTERFACE_ENTRY_IID(IID_FolderItemVerb, FolderItemVerb)
51c2c66affSColin Finck     COM_INTERFACE_ENTRY_IID(IID_IDispatch, IDispatch)
52c2c66affSColin Finck END_COM_MAP()
53c2c66affSColin Finck };
54c2c66affSColin Finck 
55c2c66affSColin Finck 
56c2c66affSColin Finck class CFolderItemVerbs:
57c2c66affSColin Finck     public CComCoClass<CFolderItemVerbs>,
58c2c66affSColin Finck     public CComObjectRootEx<CComMultiThreadModelNoCS>,
59c2c66affSColin Finck     public IDispatchImpl<FolderItemVerbs, &IID_FolderItemVerbs>
60c2c66affSColin Finck {
61c2c66affSColin Finck private:
62c2c66affSColin Finck     CComPtr<IContextMenu> m_contextmenu;
63c2c66affSColin Finck     HMENU m_menu;
64c2c66affSColin Finck     int m_count;
65c2c66affSColin Finck 
66c2c66affSColin Finck public:
67c2c66affSColin Finck     CFolderItemVerbs();
68c2c66affSColin Finck     virtual ~CFolderItemVerbs();
69c2c66affSColin Finck 
70c2c66affSColin Finck     HRESULT Init(LPITEMIDLIST idlist);
71c2c66affSColin Finck 
72c2c66affSColin Finck     // *** FolderItemVerbs methods ***
73*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(get_Count)(LONG *plCount) override;
74*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(get_Application)(IDispatch **ppid) override;
75*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(get_Parent)(IDispatch **ppid) override;
76*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(Item)(VARIANT index, FolderItemVerb **ppid) override;
77*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(_NewEnum)(IUnknown **ppunk) override;
78c2c66affSColin Finck 
79c2c66affSColin Finck DECLARE_NOT_AGGREGATABLE(CFolderItemVerbs)
80c2c66affSColin Finck DECLARE_PROTECT_FINAL_CONSTRUCT()
81c2c66affSColin Finck 
82c2c66affSColin Finck BEGIN_COM_MAP(CFolderItemVerbs)
83c2c66affSColin Finck     COM_INTERFACE_ENTRY_IID(IID_FolderItemVerbs, FolderItemVerbs)
84c2c66affSColin Finck     COM_INTERFACE_ENTRY_IID(IID_IDispatch, IDispatch)
85c2c66affSColin Finck END_COM_MAP()
86c2c66affSColin Finck };
87c2c66affSColin Finck 
88c2c66affSColin Finck #endif
89