00001 /* 00002 * Copyright 2003 Martin Fuchs 00003 * 00004 * This library is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU Lesser General Public 00006 * License as published by the Free Software Foundation; either 00007 * version 2.1 of the License, or (at your option) any later version. 00008 * 00009 * This library is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 * Lesser General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Lesser General Public 00015 * License along with this library; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00017 */ 00018 00019 00020 // 00021 // Explorer clone 00022 // 00023 // shellbrowserimpl.h 00024 // 00025 // Martin Fuchs, 23.07.2003 00026 // 00027 // Credits: Thanks to Leon Finker for his explorer cabinet window example 00028 // 00029 00030 #ifdef __MINGW32__ 00031 #include "servprov.h" // for IServiceProvider 00032 #include "docobj.h" // for IOleCommandTarget 00033 #endif 00034 00035 00036 /// Implementation of IShellBrowser and ICommDlgBrowser interfaces for explorer child windows (see ShellBrowserChild) 00037 struct IShellBrowserImpl 00038 : public IShellBrowser, 00039 public ICommDlgBrowser, 00040 public IServiceProvider, 00041 public IOleCommandTarget 00042 { 00043 IShellBrowserImpl() 00044 : _dwRef(0) 00045 { 00046 } 00047 00048 virtual ~IShellBrowserImpl() 00049 { 00050 } 00051 00052 virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, void** ppvObject); 00053 00054 virtual ULONG STDMETHODCALLTYPE AddRef() {return ++_dwRef;} 00055 virtual ULONG STDMETHODCALLTYPE Release() {return --_dwRef;} //not heap based 00056 00057 // *** IOleWindow methods *** 00058 virtual HRESULT STDMETHODCALLTYPE ContextSensitiveHelp(BOOL fEnterMode) {return E_NOTIMPL;} 00059 00060 // *** ICommDlgBrowser methods *** 00061 virtual HRESULT STDMETHODCALLTYPE OnDefaultCommand(IShellView* ppshv); 00062 00063 virtual HRESULT STDMETHODCALLTYPE OnStateChange(IShellView* ppshv, ULONG uChange) 00064 { //handle selection, rename, focus if needed 00065 return E_NOTIMPL; 00066 } 00067 00068 virtual HRESULT STDMETHODCALLTYPE IncludeObject(IShellView* ppshv, LPCITEMIDLIST pidl) 00069 { //filter files if needed 00070 return S_OK; 00071 } 00072 00073 // *** IShellBrowser methods *** (same as IOleInPlaceFrame) 00074 virtual HRESULT STDMETHODCALLTYPE InsertMenusSB(HMENU hmenuShared, LPOLEMENUGROUPWIDTHS lpMenuWidths) {return E_NOTIMPL;} 00075 virtual HRESULT STDMETHODCALLTYPE SetMenuSB(HMENU hmenuShared, HOLEMENU holemenuReserved, HWND hwndActiveObject) {return E_NOTIMPL;} 00076 virtual HRESULT STDMETHODCALLTYPE RemoveMenusSB(HMENU hmenuShared) {return E_NOTIMPL;} 00077 virtual HRESULT STDMETHODCALLTYPE SetStatusTextSB(LPCOLESTR lpszStatusText) {return E_NOTIMPL;} 00078 virtual HRESULT STDMETHODCALLTYPE EnableModelessSB(BOOL fEnable) {return E_NOTIMPL;} 00079 virtual HRESULT STDMETHODCALLTYPE BrowseObject(LPCITEMIDLIST pidl, UINT wFlags) {return E_NOTIMPL;} 00080 virtual HRESULT STDMETHODCALLTYPE GetViewStateStream(DWORD grfMode, LPSTREAM* ppStrm) {return E_NOTIMPL;} 00081 virtual HRESULT STDMETHODCALLTYPE OnViewWindowActive(IShellView* ppshv) {return E_NOTIMPL;} 00082 virtual HRESULT STDMETHODCALLTYPE SetToolbarItems(LPTBBUTTON lpButtons, UINT nButtons, UINT uFlags) {return E_NOTIMPL;} 00083 virtual HRESULT STDMETHODCALLTYPE TranslateAcceleratorSB(LPMSG lpmsg, WORD wID) {return S_OK;} 00084 00085 // IServiceProvider 00086 virtual HRESULT STDMETHODCALLTYPE QueryService(REFGUID guidService, REFIID riid, void** ppvObject); 00087 00088 // IOleCommandTarget 00089 virtual HRESULT STDMETHODCALLTYPE QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT* pCmdText); 00090 virtual HRESULT STDMETHODCALLTYPE Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut); 00091 00092 protected: 00093 DWORD _dwRef; 00094 00095 virtual HRESULT OnDefaultCommand(LPIDA pida) {return E_NOTIMPL;} 00096 }; 00097 00098 #ifndef WM_GETISHELLBROWSER 00099 #define WM_GETISHELLBROWSER (WM_USER+7) 00100 #endif
ROS Explorer Source Code Documentation
generated on 02.01.2013 by ![]() |