xref: /reactos/dll/win32/shell32/CShellDispatch.h (revision 49b2b1da)
1c2c66affSColin Finck /*
2e8dcbcc6SMark Jansen  * PROJECT:     shell32
3e8dcbcc6SMark Jansen  * LICENSE:     LGPL-2.1+ (https://spdx.org/licenses/LGPL-2.1+)
4e8dcbcc6SMark Jansen  * PURPOSE:     IShellDispatch implementation
5e8dcbcc6SMark Jansen  * COPYRIGHT:   Copyright 2015-2018 Mark Jansen (mark.jansen@reactos.org)
6c2c66affSColin Finck  */
7c2c66affSColin Finck 
8c2c66affSColin Finck #ifndef _SHELLDISPATCH_H_
9c2c66affSColin Finck #define _SHELLDISPATCH_H_
10c2c66affSColin Finck 
11c2c66affSColin Finck #undef ShellExecute
12c2c66affSColin Finck 
13c2c66affSColin Finck class CShellDispatch:
14c2c66affSColin Finck     public CComCoClass<CShellDispatch, &CLSID_Shell>,
15c2c66affSColin Finck     public CComObjectRootEx<CComMultiThreadModelNoCS>,
16c2c66affSColin Finck     public IDispatchImpl<IShellDispatch4, &IID_IShellDispatch4>,
17c2c66affSColin Finck     public IObjectSafety,
18c2c66affSColin Finck     public IObjectWithSite
19c2c66affSColin Finck {
20c2c66affSColin Finck private:
21c2c66affSColin Finck 
22c2c66affSColin Finck public:
23c2c66affSColin Finck     CShellDispatch();
24c2c66affSColin Finck     ~CShellDispatch();
25c2c66affSColin Finck 
26c2c66affSColin Finck     HRESULT Initialize();
27c2c66affSColin Finck 
28c2c66affSColin Finck     // *** IShellDispatch methods ***
29*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(get_Application)(IDispatch **ppid) override;
30*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(get_Parent)(IDispatch **ppid) override;
31*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(NameSpace)(VARIANT vDir, Folder **ppsdf) override;
32*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(BrowseForFolder)(LONG Hwnd, BSTR Title, LONG Options, VARIANT RootFolder, Folder **ppsdf) override;
33*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(Windows)(IDispatch **ppid) override;
34*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(Open)(VARIANT vDir) override;
35*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(Explore)(VARIANT vDir) override;
36*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(MinimizeAll)() override;
37*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(UndoMinimizeALL)() override;
38*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(FileRun)() override;
39*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(CascadeWindows)() override;
40*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(TileVertically)() override;
41*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(TileHorizontally)() override;
42*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(ShutdownWindows)() override;
43*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(Suspend)() override;
44*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(EjectPC)() override;
45*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(SetTime)() override;
46*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(TrayProperties)() override;
47*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(Help)() override;
48*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(FindFiles)() override;
49*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(FindComputer)() override;
50*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(RefreshMenu)() override;
51*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(ControlPanelItem)(BSTR szDir) override;
52c2c66affSColin Finck 
53c2c66affSColin Finck     // *** IShellDispatch2 methods ***
54*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(IsRestricted)(BSTR group, BSTR restriction, LONG *value) override;
55*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(ShellExecute)(BSTR file, VARIANT args, VARIANT dir, VARIANT op, VARIANT show) override;
56*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(FindPrinter)(BSTR name, BSTR location, BSTR model) override;
57*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(GetSystemInformation)(BSTR name, VARIANT *ret) override;
58*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(ServiceStart)(BSTR service, VARIANT persistent, VARIANT *ret) override;
59*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(ServiceStop)(BSTR service, VARIANT persistent, VARIANT *ret) override;
60*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(IsServiceRunning)(BSTR service, VARIANT *running) override;
61*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(CanStartStopService)(BSTR service, VARIANT *ret) override;
62*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(ShowBrowserBar)(BSTR clsid, VARIANT show, VARIANT *ret) override;
63c2c66affSColin Finck 
64c2c66affSColin Finck     // *** IShellDispatch3 methods ***
65*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(AddToRecent)(VARIANT file, BSTR category) override;
66c2c66affSColin Finck 
67c2c66affSColin Finck     // *** IShellDispatch4 methods ***
68*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(WindowsSecurity)() override;
69*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(ToggleDesktop)() override;
70*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(ExplorerPolicy)(BSTR policy, VARIANT *value) override;
71*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(GetSetting)(LONG setting, VARIANT_BOOL *result) override;
72c2c66affSColin Finck 
73c2c66affSColin Finck     // *** IObjectSafety methods ***
74*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(GetInterfaceSafetyOptions)(REFIID riid, DWORD *pdwSupportedOptions, DWORD *pdwEnabledOptions) override;
75*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(SetInterfaceSafetyOptions)(REFIID riid, DWORD dwOptionSetMask, DWORD dwEnabledOptions) override;
76c2c66affSColin Finck 
77c2c66affSColin Finck     // *** IObjectWithSite methods ***
78*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(SetSite)(IUnknown *pUnkSite) override;
79*49b2b1daSKatayama Hirofumi MZ     STDMETHOD(GetSite)(REFIID riid, PVOID *ppvSite) override;
80c2c66affSColin Finck 
81c2c66affSColin Finck DECLARE_REGISTRY_RESOURCEID(IDR_SHELL)
82c2c66affSColin Finck DECLARE_NOT_AGGREGATABLE(CShellDispatch)
83c2c66affSColin Finck 
84c2c66affSColin Finck DECLARE_PROTECT_FINAL_CONSTRUCT()
85c2c66affSColin Finck 
86c2c66affSColin Finck BEGIN_COM_MAP(CShellDispatch)
87c2c66affSColin Finck     COM_INTERFACE_ENTRY_IID(IID_IShellDispatch4, IShellDispatch4)
88c2c66affSColin Finck     COM_INTERFACE_ENTRY_IID(IID_IShellDispatch3, IShellDispatch3)
89c2c66affSColin Finck     COM_INTERFACE_ENTRY_IID(IID_IShellDispatch2, IShellDispatch2)
90c2c66affSColin Finck     COM_INTERFACE_ENTRY_IID(IID_IShellDispatch, IShellDispatch)
91c2c66affSColin Finck     COM_INTERFACE_ENTRY_IID(IID_IDispatch, IDispatch)
92c2c66affSColin Finck     COM_INTERFACE_ENTRY_IID(IID_IObjectSafety, IObjectSafety)
93c2c66affSColin Finck     COM_INTERFACE_ENTRY_IID(IID_IObjectWithSite, IObjectWithSite)
94c2c66affSColin Finck END_COM_MAP()
95c2c66affSColin Finck };
96c2c66affSColin Finck 
97c2c66affSColin Finck #endif /* _SHELLDISPATCH_H_ */
98