ReactOS  0.4.14-dev-115-g4576127
shellbrowserimpl.h
Go to the documentation of this file.
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 
37 struct IShellBrowserImpl
38  : public IShellBrowser,
39  public ICommDlgBrowser,
40  public IServiceProvider,
41  public IOleCommandTarget
42 {
44  : _dwRef(0)
45  {
46  }
47 
49  {
50  }
51 
53 
54  virtual ULONG STDMETHODCALLTYPE AddRef() {return ++_dwRef;}
55  virtual ULONG STDMETHODCALLTYPE Release() {return --_dwRef;} //not heap based
56 
57  // *** IOleWindow methods ***
59 
60  // *** ICommDlgBrowser methods ***
62 
64  { //handle selection, rename, focus if needed
65  return E_NOTIMPL;
66  }
67 
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;}
82  virtual HRESULT STDMETHODCALLTYPE SetToolbarItems(LPTBBUTTON lpButtons, UINT nButtons, UINT uFlags) {return E_NOTIMPL;}
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:
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
virtual HRESULT STDMETHODCALLTYPE QueryService(REFGUID guidService, REFIID riid, void **ppvObject)
virtual HRESULT STDMETHODCALLTYPE ContextSensitiveHelp(BOOL fEnterMode)
#define REFIID
Definition: guiddef.h:118
virtual HRESULT STDMETHODCALLTYPE OnStateChange(IShellView *ppshv, ULONG uChange)
Definition: scsiwmi.h:51
virtual HRESULT STDMETHODCALLTYPE Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
REFIID riid
Definition: precomp.h:44
struct IOleCommandTarget::_tagOLECMD OLECMD
virtual HRESULT STDMETHODCALLTYPE TranslateAcceleratorSB(LPMSG lpmsg, WORD wID)
virtual HRESULT STDMETHODCALLTYPE QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText)
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
interface IStream * LPSTREAM
Definition: objfwd.h:10
UINT uFlags
Definition: api.c:60
virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, void **ppvObject)
struct IOleCommandTarget::_tagOLECMDTEXT OLECMDTEXT
virtual HRESULT STDMETHODCALLTYPE BrowseObject(LPCITEMIDLIST pidl, UINT wFlags)
virtual HRESULT STDMETHODCALLTYPE RemoveMenusSB(HMENU hmenuShared)
unsigned int BOOL
Definition: ntddk_ex.h:94
virtual HRESULT STDMETHODCALLTYPE IncludeObject(IShellView *ppshv, LPCITEMIDLIST pidl)
Implementation of IShellBrowser and ICommDlgBrowser interfaces for explorer child windows (see ShellB...
virtual HRESULT STDMETHODCALLTYPE OnDefaultCommand(IShellView *ppshv)
virtual HRESULT OnDefaultCommand(LPIDA pida)
virtual ULONG STDMETHODCALLTYPE AddRef()
LONG HRESULT
Definition: typedefs.h:77
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
virtual ULONG STDMETHODCALLTYPE Release()
virtual ~IShellBrowserImpl()
REFIID LPVOID * ppvObject
Definition: precomp.h:44
virtual HRESULT STDMETHODCALLTYPE SetMenuSB(HMENU hmenuShared, HOLEMENU holemenuReserved, HWND hwndActiveObject)
virtual HRESULT STDMETHODCALLTYPE InsertMenusSB(HMENU hmenuShared, LPOLEMENUGROUPWIDTHS lpMenuWidths)
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
#define S_OK
Definition: intsafe.h:59
#define E_NOTIMPL
Definition: ddrawi.h:99
unsigned int UINT
Definition: ndis.h:50
unsigned int ULONG
Definition: retypes.h:1
virtual HRESULT STDMETHODCALLTYPE OnViewWindowActive(IShellView *ppshv)
virtual HRESULT STDMETHODCALLTYPE SetToolbarItems(LPTBBUTTON lpButtons, UINT nButtons, UINT uFlags)
virtual HRESULT STDMETHODCALLTYPE GetViewStateStream(DWORD grfMode, LPSTREAM *ppStrm)
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
virtual HRESULT STDMETHODCALLTYPE EnableModelessSB(BOOL fEnable)
Definition: shlobj.h:490
virtual HRESULT STDMETHODCALLTYPE SetStatusTextSB(LPCOLESTR lpszStatusText)