1 /* 2 * ReactOS Explorer 3 * 4 * Copyright 2009 Andrew Hill <ash77@reactos.org> 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 */ 20 21 #pragma once 22 23 class CCommonBrowser : 24 public CComCoClass<CCommonBrowser, &CLSID_CCommonBrowser>, 25 public CComObjectRootEx<CComMultiThreadModelNoCS>, 26 public IShellBrowser, 27 public IBrowserService3, 28 public IServiceProvider, 29 public IOleCommandTarget, 30 public IDockingWindowSite, 31 public IDockingWindowFrame, 32 public IInputObjectSite, 33 public IDropTarget, 34 public IShellBrowserService 35 { 36 private: 37 public: 38 CCommonBrowser(); 39 ~CCommonBrowser(); 40 41 // *** IServiceProvider methods *** 42 STDMETHOD(QueryService)(REFGUID guidService, REFIID riid, void **ppvObject) override; 43 44 // *** IOleCommandTarget methods *** 45 STDMETHOD(QueryStatus)(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[ ], OLECMDTEXT *pCmdText) override; 46 STDMETHOD(Exec)(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut) override; 47 48 // *** IBrowserService methods *** 49 STDMETHOD(GetParentSite)(IOleInPlaceSite **ppipsite) override; 50 STDMETHOD(SetTitle)(IShellView *psv, LPCWSTR pszName) override; 51 STDMETHOD(GetTitle)(IShellView *psv, LPWSTR pszName, DWORD cchName) override; 52 STDMETHOD(GetOleObject)(IOleObject **ppobjv) override; 53 STDMETHOD(GetTravelLog)(ITravelLog **pptl) override; 54 STDMETHOD(ShowControlWindow)(UINT id, BOOL fShow) override; 55 STDMETHOD(IsControlWindowShown)(UINT id, BOOL *pfShown) override; 56 STDMETHOD(IEGetDisplayName)(LPCITEMIDLIST pidl, LPWSTR pwszName, UINT uFlags) override; 57 STDMETHOD(IEParseDisplayName)(UINT uiCP, LPCWSTR pwszPath, LPITEMIDLIST *ppidlOut) override; 58 STDMETHOD(DisplayParseError)(HRESULT hres, LPCWSTR pwszPath) override; 59 STDMETHOD(NavigateToPidl)(LPCITEMIDLIST pidl, DWORD grfHLNF) override; 60 STDMETHOD(SetNavigateState)(BNSTATE bnstate) override; 61 STDMETHOD(GetNavigateState)(BNSTATE *pbnstate) override; 62 STDMETHOD(NotifyRedirect)(IShellView *psv, LPCITEMIDLIST pidl, BOOL *pfDidBrowse) override; 63 STDMETHOD(UpdateWindowList)() override; 64 STDMETHOD(UpdateBackForwardState)() override; 65 STDMETHOD(SetFlags)(DWORD dwFlags, DWORD dwFlagMask) override; 66 STDMETHOD(GetFlags)(DWORD *pdwFlags) override; 67 STDMETHOD(CanNavigateNow)() override; 68 STDMETHOD(GetPidl)(LPITEMIDLIST *ppidl) override; 69 STDMETHOD(SetReferrer)(LPCITEMIDLIST pidl) override; 70 STDMETHOD_(DWORD, GetBrowserIndex)() override; 71 STDMETHOD(GetBrowserByIndex)(DWORD dwID, IUnknown **ppunk) override; 72 STDMETHOD(GetHistoryObject)(IOleObject **ppole, IStream **pstm, IBindCtx **ppbc) override; 73 STDMETHOD(SetHistoryObject)(IOleObject *pole, BOOL fIsLocalAnchor) override; 74 STDMETHOD(CacheOLEServer)(IOleObject *pole) override; 75 STDMETHOD(GetSetCodePage)(VARIANT *pvarIn, VARIANT *pvarOut) override; 76 STDMETHOD(OnHttpEquiv)(IShellView *psv, BOOL fDone, VARIANT *pvarargIn, VARIANT *pvarargOut) override; 77 STDMETHOD(GetPalette)(HPALETTE *hpal) override; 78 STDMETHOD(RegisterWindow)(BOOL fForceRegister, int swc) override; 79 80 // *** IBrowserService2 methods *** 81 STDMETHOD_(LRESULT, WndProcBS)(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) override; 82 STDMETHOD(SetAsDefFolderSettings)() override; 83 STDMETHOD(GetViewRect)(RECT *prc) override; 84 STDMETHOD(OnSize)(WPARAM wParam) override; 85 STDMETHOD(OnCreate)(struct tagCREATESTRUCTW *pcs) override; 86 STDMETHOD_(LRESULT, OnCommand)(WPARAM wParam, LPARAM lParam) override; 87 STDMETHOD(OnDestroy)() override; 88 STDMETHOD_(LRESULT, OnNotify)(struct tagNMHDR *pnm) override; 89 STDMETHOD(OnSetFocus)() override; 90 STDMETHOD(OnFrameWindowActivateBS)(BOOL fActive) override; 91 STDMETHOD(ReleaseShellView)() override; 92 STDMETHOD(ActivatePendingView)() override; 93 STDMETHOD(CreateViewWindow)(IShellView *psvNew, IShellView *psvOld, LPRECT prcView, HWND *phwnd) override; 94 STDMETHOD(CreateBrowserPropSheetExt)(REFIID riid, void **ppv) override; 95 STDMETHOD(GetViewWindow)(HWND *phwndView) override; 96 STDMETHOD(GetBaseBrowserData)(LPCBASEBROWSERDATA *pbbd) override; 97 STDMETHOD_(LPBASEBROWSERDATA, PutBaseBrowserData)() override; 98 STDMETHOD(InitializeTravelLog)(ITravelLog *ptl, DWORD dw) override; 99 STDMETHOD(SetTopBrowser)() override; 100 STDMETHOD(Offline)(int iCmd) override; 101 STDMETHOD(AllowViewResize)(BOOL f) override; 102 STDMETHOD(SetActivateState)(UINT u) override; 103 STDMETHOD(UpdateSecureLockIcon)(int eSecureLock) override; 104 STDMETHOD(InitializeDownloadManager)() override; 105 STDMETHOD(InitializeTransitionSite)() override; 106 STDMETHOD(_Initialize)(HWND hwnd, IUnknown *pauto) override; 107 STDMETHOD(_CancelPendingNavigationAsync)() override; 108 STDMETHOD(_CancelPendingView)() override; 109 STDMETHOD(_MaySaveChanges)() override; 110 STDMETHOD(_PauseOrResumeView)(BOOL fPaused) override; 111 STDMETHOD(_DisableModeless)() override; 112 STDMETHOD(_NavigateToPidl)(LPCITEMIDLIST pidl, DWORD grfHLNF, DWORD dwFlags) override; 113 STDMETHOD(_TryShell2Rename)(IShellView *psv, LPCITEMIDLIST pidlNew) override; 114 STDMETHOD(_SwitchActivationNow)() override; 115 STDMETHOD(_ExecChildren)(IUnknown *punkBar, BOOL fBroadcast, const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANTARG *pvarargIn, VARIANTARG *pvarargOut) override; 116 STDMETHOD(_SendChildren)(HWND hwndBar, BOOL fBroadcast, UINT uMsg, WPARAM wParam, LPARAM lParam) override; 117 STDMETHOD(GetFolderSetData)(struct tagFolderSetData *pfsd) override; 118 STDMETHOD(_OnFocusChange)(UINT itb) override; 119 STDMETHOD(v_ShowHideChildWindows)(BOOL fChildOnly) override; 120 STDMETHOD_(UINT, _get_itbLastFocus)() override; 121 STDMETHOD(_put_itbLastFocus)(UINT itbLastFocus) override; 122 STDMETHOD(_UIActivateView)(UINT uState) override; 123 STDMETHOD(_GetViewBorderRect)(RECT *prc) override; 124 STDMETHOD(_UpdateViewRectSize)() override; 125 STDMETHOD(_ResizeNextBorder)(UINT itb) override; 126 STDMETHOD(_ResizeView)() override; 127 STDMETHOD(_GetEffectiveClientArea)(LPRECT lprectBorder, HMONITOR hmon) override; 128 STDMETHOD_(IStream *, v_GetViewStream)(LPCITEMIDLIST pidl, DWORD grfMode, LPCWSTR pwszName) override; 129 STDMETHOD_(LRESULT, ForwardViewMsg)(UINT uMsg, WPARAM wParam, LPARAM lParam) override; 130 STDMETHOD(SetAcceleratorMenu)(HACCEL hacc) override; 131 STDMETHOD_(int, _GetToolbarCount)() override; 132 STDMETHOD_(LPTOOLBARITEM, _GetToolbarItem)(int itb) override; 133 STDMETHOD(_SaveToolbars)(IStream *pstm) override; 134 STDMETHOD(_LoadToolbars)(IStream *pstm) override; 135 STDMETHOD(_CloseAndReleaseToolbars)(BOOL fClose) override; 136 STDMETHOD(v_MayGetNextToolbarFocus)(LPMSG lpMsg, UINT itbNext, int citb, LPTOOLBARITEM *pptbi, HWND *phwnd) override; 137 STDMETHOD(_ResizeNextBorderHelper)(UINT itb, BOOL bUseHmonitor) override; 138 STDMETHOD_(UINT, _FindTBar)(IUnknown *punkSrc) override; 139 STDMETHOD(_SetFocus)(LPTOOLBARITEM ptbi, HWND hwnd, LPMSG lpMsg) override; 140 STDMETHOD(v_MayTranslateAccelerator)(MSG *pmsg) override; 141 STDMETHOD(_GetBorderDWHelper)(IUnknown *punkSrc, LPRECT lprectBorder, BOOL bUseHmonitor) override; 142 STDMETHOD(v_CheckZoneCrossing)(LPCITEMIDLIST pidl) override; 143 144 // *** IBrowserService3 methods *** 145 STDMETHOD(_PositionViewWindow)(HWND, RECT *) override; 146 STDMETHOD(IEParseDisplayNameEx)(UINT, PCWSTR, DWORD, LPITEMIDLIST *) override; 147 148 // *** IShellBrowser methods *** 149 STDMETHOD(InsertMenusSB)(HMENU hmenuShared, LPOLEMENUGROUPWIDTHS lpMenuWidths) override; 150 STDMETHOD(SetMenuSB)(HMENU hmenuShared, HOLEMENU holemenuRes, HWND hwndActiveObject) override; 151 STDMETHOD(RemoveMenusSB)(HMENU hmenuShared) override; 152 STDMETHOD(SetStatusTextSB)(LPCOLESTR pszStatusText) override; 153 STDMETHOD(EnableModelessSB)(BOOL fEnable) override; 154 STDMETHOD(TranslateAcceleratorSB)(MSG *pmsg, WORD wID) override; 155 STDMETHOD(BrowseObject)(LPCITEMIDLIST pidl, UINT wFlags) override; 156 STDMETHOD(GetViewStateStream)(DWORD grfMode, IStream **ppStrm) override; 157 STDMETHOD(GetControlWindow)(UINT id, HWND *lphwnd) override; 158 STDMETHOD(SendControlMsg)(UINT id, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *pret) override; 159 STDMETHOD(QueryActiveShellView)(struct IShellView **ppshv) override; 160 STDMETHOD(OnViewWindowActive)(struct IShellView *ppshv) override; 161 STDMETHOD(SetToolbarItems)(LPTBBUTTON lpButtons, UINT nButtons, UINT uFlags) override; 162 163 // *** IShellBowserService methods *** 164 STDMETHOD(GetPropertyBag)(long flags, REFIID riid, void **ppvObject) override; 165 166 // *** IOleWindow methods *** 167 STDMETHOD(GetWindow)(HWND *lphwnd) override; 168 STDMETHOD(ContextSensitiveHelp)(BOOL fEnterMode) override; 169 170 // *** IDockingWindowSite methods *** 171 STDMETHOD(GetBorderDW)(IUnknown* punkObj, LPRECT prcBorder) override; 172 STDMETHOD(RequestBorderSpaceDW)(IUnknown* punkObj, LPCBORDERWIDTHS pbw) override; 173 STDMETHOD(SetBorderSpaceDW)(IUnknown* punkObj, LPCBORDERWIDTHS pbw) override; 174 175 // *** IDockingWindowFrame methods *** 176 STDMETHOD(AddToolbar)(IUnknown *punkSrc, LPCWSTR pwszItem, DWORD dwAddFlags) override; 177 STDMETHOD(RemoveToolbar)(IUnknown *punkSrc, DWORD dwRemoveFlags) override; 178 STDMETHOD(FindToolbar)(LPCWSTR pwszItem, REFIID riid, void **ppv) override; 179 180 // *** IInputObjectSite specific methods *** 181 STDMETHOD(OnFocusChangeIS)(IUnknown *punkObj, BOOL fSetFocus) override; 182 183 // *** IDropTarget methods *** 184 STDMETHOD(DragEnter)(IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect) override; 185 STDMETHOD(DragOver)(DWORD grfKeyState, POINTL pt, DWORD *pdwEffect) override; 186 STDMETHOD(DragLeave)() override; 187 STDMETHOD(Drop)(IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect) override; 188 189 DECLARE_REGISTRY_RESOURCEID(IDR_COMMONBROWSER) 190 DECLARE_AGGREGATABLE(CCommonBrowser) 191 192 DECLARE_PROTECT_FINAL_CONSTRUCT() 193 194 BEGIN_COM_MAP(CCommonBrowser) 195 COM_INTERFACE_ENTRY_IID(IID_IServiceProvider, IServiceProvider) 196 COM_INTERFACE_ENTRY_IID(IID_IOleCommandTarget, IOleCommandTarget) 197 COM_INTERFACE_ENTRY_IID(IID_IBrowserService, IBrowserService) 198 COM_INTERFACE_ENTRY_IID(IID_IBrowserService2, IBrowserService2) 199 COM_INTERFACE_ENTRY_IID(IID_IBrowserService3, IBrowserService3) 200 COM_INTERFACE_ENTRY_IID(IID_IShellBrowser, IShellBrowser) 201 COM_INTERFACE_ENTRY_IID(IID_IShellBrowserService, IShellBrowserService) 202 COM_INTERFACE_ENTRY2_IID(IID_IOleWindow, IOleWindow, IDockingWindowSite) 203 COM_INTERFACE_ENTRY_IID(IID_IDockingWindowSite, IDockingWindowSite) 204 COM_INTERFACE_ENTRY_IID(IID_IDockingWindowFrame, IDockingWindowFrame) 205 COM_INTERFACE_ENTRY_IID(IID_IInputObjectSite, IInputObjectSite) 206 COM_INTERFACE_ENTRY_IID(IID_IDropTarget, IDropTarget) 207 END_COM_MAP() 208 }; 209