[EXPLORER][EXPLORER_NEW]
[reactos.git] / base / shell / explorer / utility / shellbrowserimpl.h
1 /*
2 * Copyright 2003 Martin Fuchs
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19
20 //
21 // Explorer clone
22 //
23 // shellbrowserimpl.h
24 //
25 // Martin Fuchs, 23.07.2003
26 //
27 // Credits: Thanks to Leon Finker for his explorer cabinet window example
28 //
29
30 #ifdef __MINGW32__
31 #include "servprov.h" // for IServiceProvider
32 #include "docobj.h" // for IOleCommandTarget
33 #endif
34
35
36 /// Implementation of IShellBrowser and ICommDlgBrowser interfaces for explorer child windows (see ShellBrowserChild)
37 struct IShellBrowserImpl
38 : public IShellBrowser,
39 public ICommDlgBrowser,
40 public IServiceProvider,
41 public IOleCommandTarget
42 {
43 IShellBrowserImpl()
44 : _dwRef(0)
45 {
46 }
47
48 virtual ~IShellBrowserImpl()
49 {
50 }
51
52 virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, void** ppvObject);
53
54 virtual ULONG STDMETHODCALLTYPE AddRef() {return ++_dwRef;}
55 virtual ULONG STDMETHODCALLTYPE Release() {return --_dwRef;} //not heap based
56
57 // *** IOleWindow methods ***
58 virtual HRESULT STDMETHODCALLTYPE ContextSensitiveHelp(BOOL fEnterMode) {return E_NOTIMPL;}
59
60 // *** ICommDlgBrowser methods ***
61 virtual HRESULT STDMETHODCALLTYPE OnDefaultCommand(IShellView* ppshv);
62
63 virtual HRESULT STDMETHODCALLTYPE OnStateChange(IShellView* ppshv, ULONG uChange)
64 { //handle selection, rename, focus if needed
65 return E_NOTIMPL;
66 }
67
68 virtual HRESULT STDMETHODCALLTYPE IncludeObject(IShellView* ppshv, LPCITEMIDLIST pidl)
69 { //filter files if needed
70 return S_OK;
71 }
72
73 // *** IShellBrowser methods *** (same as IOleInPlaceFrame)
74 virtual HRESULT STDMETHODCALLTYPE InsertMenusSB(HMENU hmenuShared, LPOLEMENUGROUPWIDTHS lpMenuWidths) {return E_NOTIMPL;}
75 virtual HRESULT STDMETHODCALLTYPE SetMenuSB(HMENU hmenuShared, HOLEMENU holemenuReserved, HWND hwndActiveObject) {return E_NOTIMPL;}
76 virtual HRESULT STDMETHODCALLTYPE RemoveMenusSB(HMENU hmenuShared) {return E_NOTIMPL;}
77 virtual HRESULT STDMETHODCALLTYPE SetStatusTextSB(LPCOLESTR lpszStatusText) {return E_NOTIMPL;}
78 virtual HRESULT STDMETHODCALLTYPE EnableModelessSB(BOOL fEnable) {return E_NOTIMPL;}
79 virtual HRESULT STDMETHODCALLTYPE BrowseObject(LPCITEMIDLIST pidl, UINT wFlags) {return E_NOTIMPL;}
80 virtual HRESULT STDMETHODCALLTYPE GetViewStateStream(DWORD grfMode, LPSTREAM* ppStrm) {return E_NOTIMPL;}
81 virtual HRESULT STDMETHODCALLTYPE OnViewWindowActive(IShellView* ppshv) {return E_NOTIMPL;}
82 virtual HRESULT STDMETHODCALLTYPE SetToolbarItems(LPTBBUTTON lpButtons, UINT nButtons, UINT uFlags) {return E_NOTIMPL;}
83 virtual HRESULT STDMETHODCALLTYPE TranslateAcceleratorSB(LPMSG lpmsg, WORD wID) {return S_OK;}
84
85 // IServiceProvider
86 virtual HRESULT STDMETHODCALLTYPE QueryService(REFGUID guidService, REFIID riid, void** ppvObject);
87
88 // IOleCommandTarget
89 virtual HRESULT STDMETHODCALLTYPE QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT* pCmdText);
90 virtual HRESULT STDMETHODCALLTYPE Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut);
91
92 protected:
93 DWORD _dwRef;
94
95 virtual HRESULT OnDefaultCommand(LPIDA pida) {return E_NOTIMPL;}
96 };
97
98 #ifndef WM_GETISHELLBROWSER
99 #define WM_GETISHELLBROWSER (WM_USER+7)
100 #endif