[SHELL32] CDrivesFolder: Implement the eject and disconnect menu items. CORE-13841
[reactos.git] / dll / win32 / shell32 / CShellDispatch.h
1 /*
2 * IShellDispatch implementation
3 *
4 * Copyright 2015 Mark Jansen
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21 #ifndef _SHELLDISPATCH_H_
22 #define _SHELLDISPATCH_H_
23
24 #undef ShellExecute
25
26 class CShellDispatch:
27 public CComCoClass<CShellDispatch, &CLSID_Shell>,
28 public CComObjectRootEx<CComMultiThreadModelNoCS>,
29 public IDispatchImpl<IShellDispatch4, &IID_IShellDispatch4>,
30 public IObjectSafety,
31 public IObjectWithSite
32 {
33 private:
34
35 public:
36 CShellDispatch();
37 ~CShellDispatch();
38
39 HRESULT Initialize();
40
41 // *** IShellDispatch methods ***
42 virtual HRESULT STDMETHODCALLTYPE get_Application(IDispatch **ppid);
43 virtual HRESULT STDMETHODCALLTYPE get_Parent(IDispatch **ppid);
44 virtual HRESULT STDMETHODCALLTYPE NameSpace(VARIANT vDir, Folder **ppsdf);
45 virtual HRESULT STDMETHODCALLTYPE BrowseForFolder(LONG Hwnd, BSTR Title, LONG Options, VARIANT RootFolder, Folder **ppsdf);
46 virtual HRESULT STDMETHODCALLTYPE Windows(IDispatch **ppid);
47 virtual HRESULT STDMETHODCALLTYPE Open(VARIANT vDir);
48 virtual HRESULT STDMETHODCALLTYPE Explore(VARIANT vDir);
49 virtual HRESULT STDMETHODCALLTYPE MinimizeAll();
50 virtual HRESULT STDMETHODCALLTYPE UndoMinimizeALL();
51 virtual HRESULT STDMETHODCALLTYPE FileRun();
52 virtual HRESULT STDMETHODCALLTYPE CascadeWindows();
53 virtual HRESULT STDMETHODCALLTYPE TileVertically();
54 virtual HRESULT STDMETHODCALLTYPE TileHorizontally();
55 virtual HRESULT STDMETHODCALLTYPE ShutdownWindows();
56 virtual HRESULT STDMETHODCALLTYPE Suspend();
57 virtual HRESULT STDMETHODCALLTYPE EjectPC();
58 virtual HRESULT STDMETHODCALLTYPE SetTime();
59 virtual HRESULT STDMETHODCALLTYPE TrayProperties();
60 virtual HRESULT STDMETHODCALLTYPE Help();
61 virtual HRESULT STDMETHODCALLTYPE FindFiles();
62 virtual HRESULT STDMETHODCALLTYPE FindComputer();
63 virtual HRESULT STDMETHODCALLTYPE RefreshMenu();
64 virtual HRESULT STDMETHODCALLTYPE ControlPanelItem(BSTR szDir);
65
66 // *** IShellDispatch2 methods ***
67 virtual HRESULT STDMETHODCALLTYPE IsRestricted(BSTR group, BSTR restriction, LONG *value);
68 virtual HRESULT STDMETHODCALLTYPE ShellExecute(BSTR file, VARIANT args, VARIANT dir, VARIANT op, VARIANT show);
69 virtual HRESULT STDMETHODCALLTYPE FindPrinter(BSTR name, BSTR location, BSTR model);
70 virtual HRESULT STDMETHODCALLTYPE GetSystemInformation(BSTR name, VARIANT *ret);
71 virtual HRESULT STDMETHODCALLTYPE ServiceStart(BSTR service, VARIANT persistent, VARIANT *ret);
72 virtual HRESULT STDMETHODCALLTYPE ServiceStop(BSTR service, VARIANT persistent, VARIANT *ret);
73 virtual HRESULT STDMETHODCALLTYPE IsServiceRunning(BSTR service, VARIANT *running);
74 virtual HRESULT STDMETHODCALLTYPE CanStartStopService(BSTR service, VARIANT *ret);
75 virtual HRESULT STDMETHODCALLTYPE ShowBrowserBar(BSTR clsid, VARIANT show, VARIANT *ret);
76
77 // *** IShellDispatch3 methods ***
78 virtual HRESULT STDMETHODCALLTYPE AddToRecent(VARIANT file, BSTR category);
79
80 // *** IShellDispatch4 methods ***
81 virtual HRESULT STDMETHODCALLTYPE WindowsSecurity();
82 virtual HRESULT STDMETHODCALLTYPE ToggleDesktop();
83 virtual HRESULT STDMETHODCALLTYPE ExplorerPolicy(BSTR policy, VARIANT *value);
84 virtual HRESULT STDMETHODCALLTYPE GetSetting(LONG setting, VARIANT_BOOL *result);
85
86 // *** IObjectSafety methods ***
87 virtual HRESULT STDMETHODCALLTYPE GetInterfaceSafetyOptions(REFIID riid, DWORD *pdwSupportedOptions, DWORD *pdwEnabledOptions);
88 virtual HRESULT STDMETHODCALLTYPE SetInterfaceSafetyOptions(REFIID riid, DWORD dwOptionSetMask, DWORD dwEnabledOptions);
89
90 // *** IObjectWithSite methods ***
91 virtual HRESULT STDMETHODCALLTYPE SetSite(IUnknown *pUnkSite);
92 virtual HRESULT STDMETHODCALLTYPE GetSite(REFIID riid, PVOID *ppvSite);
93
94
95 DECLARE_REGISTRY_RESOURCEID(IDR_SHELL)
96 DECLARE_NOT_AGGREGATABLE(CShellDispatch)
97
98 DECLARE_PROTECT_FINAL_CONSTRUCT()
99
100 BEGIN_COM_MAP(CShellDispatch)
101 COM_INTERFACE_ENTRY_IID(IID_IShellDispatch4, IShellDispatch4)
102 COM_INTERFACE_ENTRY_IID(IID_IShellDispatch3, IShellDispatch3)
103 COM_INTERFACE_ENTRY_IID(IID_IShellDispatch2, IShellDispatch2)
104 COM_INTERFACE_ENTRY_IID(IID_IShellDispatch, IShellDispatch)
105 COM_INTERFACE_ENTRY_IID(IID_IDispatch, IDispatch)
106 COM_INTERFACE_ENTRY_IID(IID_IObjectSafety, IObjectSafety)
107 COM_INTERFACE_ENTRY_IID(IID_IObjectWithSite, IObjectWithSite)
108 END_COM_MAP()
109 };
110
111 #endif /* _SHELLDISPATCH_H_ */