update for HEAD-2003091401
[reactos.git] / subsys / system / 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  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 window example
28  //
29
30
31 struct IShellBrowserImpl : public IShellBrowser, public ICommDlgBrowser
32 {
33         IShellBrowserImpl()
34          :      _dwRef(0)
35         {
36         }
37
38         STDMETHOD(QueryInterface)(REFIID iid, void **ppvObject)
39         {
40                 if (!ppvObject)
41                         return E_POINTER;
42
43                 if (iid == IID_IUnknown)
44                         *ppvObject = (IUnknown*)static_cast<IShellBrowser*>(this);
45                 else if (iid == IID_IOleWindow)
46                         *ppvObject = static_cast<IOleWindow*>(this);
47                 else if (iid == IID_IShellBrowser)
48                         *ppvObject = static_cast<IShellBrowser*>(this);
49                 else if (iid == IID_ICommDlgBrowser)
50                         *ppvObject = static_cast<ICommDlgBrowser*>(this);
51                 else {
52                         *ppvObject = NULL;
53                         return E_NOINTERFACE;
54                 }
55
56                 return S_OK;
57         }
58
59         STDMETHOD_(ULONG, AddRef)() {return ++_dwRef;}
60         STDMETHOD_(ULONG, Release)() {return --_dwRef;}  //not heap based
61
62     // *** IOleWindow methods ***
63     STDMETHOD(ContextSensitiveHelp)(BOOL fEnterMode) {return E_NOTIMPL;}
64
65         // *** ICommDlgBrowser methods ***
66     STDMETHOD(OnDefaultCommand)(struct IShellView* ppshv)
67         {
68                 return E_NOTIMPL;
69         }
70
71     STDMETHOD(OnStateChange)(struct IShellView* ppshv, ULONG uChange)
72         {       //handle selection, rename, focus if needed
73                 return E_NOTIMPL;
74         }
75
76     STDMETHOD(IncludeObject)(struct IShellView* ppshv, LPCITEMIDLIST pidl)
77         {       //filter files if needed
78                 return S_OK;
79         }
80
81     // *** IShellBrowser methods *** (same as IOleInPlaceFrame)
82     STDMETHOD(InsertMenusSB)(HMENU hmenuShared, LPOLEMENUGROUPWIDTHS lpMenuWidths) {return E_NOTIMPL;}
83     STDMETHOD(SetMenuSB)(HMENU hmenuShared, HOLEMENU holemenuReserved,HWND hwndActiveObject) {return E_NOTIMPL;}
84     STDMETHOD(RemoveMenusSB)(HMENU hmenuShared) {return E_NOTIMPL;}
85     STDMETHOD(SetStatusTextSB)(LPCOLESTR lpszStatusText) {return E_NOTIMPL;}
86     STDMETHOD(EnableModelessSB)(BOOL fEnable) {return E_NOTIMPL;}
87         STDMETHOD(BrowseObject)(LPCITEMIDLIST pidl, UINT wFlags) {return E_NOTIMPL;}
88         STDMETHOD(GetViewStateStream)(DWORD grfMode,LPSTREAM  *ppStrm) {return E_NOTIMPL;}
89         STDMETHOD(OnViewWindowActive)(struct IShellView *ppshv) {return E_NOTIMPL;}
90         STDMETHOD(SetToolbarItems)(LPTBBUTTON lpButtons, UINT nButtons,UINT uFlags) {return E_NOTIMPL;}
91         STDMETHOD(TranslateAcceleratorSB)(LPMSG lpmsg, WORD wID) {return S_OK;}
92
93 protected:
94         DWORD   _dwRef;
95 };
96
97 #ifndef WM_GETISHELLBROWSER
98 #define WM_GETISHELLBROWSER (WM_USER+7)
99 #endif