1 /* 2 * ReactOS Explorer 3 * 4 * Copyright 2009 Andrew Hill <ash77 at domain 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 CAddressEditBox : 24 public CWindowImpl<CAddressEditBox, CWindow, CControlWinTraits>, 25 public CComCoClass<CAddressEditBox, &CLSID_AddressEditBox>, 26 public CComObjectRootEx<CComMultiThreadModelNoCS>, 27 public IWinEventHandler, 28 public IDispatch, 29 public IAddressBand, 30 public IAddressEditBox, 31 public IOleCommandTarget, 32 public IPersistStream, 33 public IShellService 34 { 35 private: 36 CContainedWindow fCombobox; 37 CContainedWindow fEditWindow; 38 DWORD fAdviseCookie; 39 CComPtr<IUnknown> fSite; 40 LPITEMIDLIST pidlLastParsed; 41 HWND hComboBoxEx; 42 public: 43 CAddressEditBox(); 44 ~CAddressEditBox(); 45 private: 46 void PopulateComboBox(LPITEMIDLIST pidl); 47 void AddComboBoxItem(LPITEMIDLIST pidl, int index, int indent); 48 void FillOneLevel(int index, int levelIndent, int indent); 49 LPITEMIDLIST GetItemData(int index); 50 HRESULT STDMETHODCALLTYPE ShowFileNotFoundError(HRESULT hRet); 51 public: 52 // *** IShellService methods *** 53 virtual HRESULT STDMETHODCALLTYPE SetOwner(IUnknown *); 54 55 // *** IAddressBand methods *** 56 virtual HRESULT STDMETHODCALLTYPE FileSysChange(long param8, long paramC); 57 virtual HRESULT STDMETHODCALLTYPE Refresh(long param8); 58 59 // *** IAddressEditBox methods *** 60 virtual HRESULT STDMETHODCALLTYPE Init(HWND comboboxEx, HWND editControl, long param14, IUnknown *param18); 61 virtual HRESULT STDMETHODCALLTYPE SetCurrentDir(long paramC); 62 virtual HRESULT STDMETHODCALLTYPE ParseNow(long paramC); 63 virtual HRESULT STDMETHODCALLTYPE Execute(long paramC); 64 virtual HRESULT STDMETHODCALLTYPE Save(long paramC); 65 66 // *** IWinEventHandler methods *** 67 virtual HRESULT STDMETHODCALLTYPE OnWinEvent(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *theResult); 68 virtual HRESULT STDMETHODCALLTYPE IsWindowOwner(HWND hWnd); 69 70 // *** IOleCommandTarget methods *** 71 virtual HRESULT STDMETHODCALLTYPE QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[ ], OLECMDTEXT *pCmdText); 72 virtual HRESULT STDMETHODCALLTYPE Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut); 73 74 // *** IDispatch methods *** 75 virtual HRESULT STDMETHODCALLTYPE GetTypeInfoCount(UINT *pctinfo); 76 virtual HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo); 77 virtual HRESULT STDMETHODCALLTYPE GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId); 78 virtual HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr); 79 80 // *** IPersist methods *** 81 virtual HRESULT STDMETHODCALLTYPE GetClassID(CLSID *pClassID); 82 83 // *** IPersistStream methods *** 84 virtual HRESULT STDMETHODCALLTYPE IsDirty(); 85 virtual HRESULT STDMETHODCALLTYPE Load(IStream *pStm); 86 virtual HRESULT STDMETHODCALLTYPE Save(IStream *pStm, BOOL fClearDirty); 87 virtual HRESULT STDMETHODCALLTYPE GetSizeMax(ULARGE_INTEGER *pcbSize); 88 89 // message handlers 90 91 DECLARE_REGISTRY_RESOURCEID(IDR_ADDRESSEDITBOX) 92 DECLARE_NOT_AGGREGATABLE(CAddressEditBox) 93 94 DECLARE_PROTECT_FINAL_CONSTRUCT() 95 96 BEGIN_MSG_MAP(CAddressEditBox) 97 END_MSG_MAP() 98 99 BEGIN_COM_MAP(CAddressEditBox) 100 COM_INTERFACE_ENTRY_IID(IID_IShellService, IShellService) 101 COM_INTERFACE_ENTRY_IID(IID_IAddressBand, IAddressBand) 102 COM_INTERFACE_ENTRY_IID(IID_IAddressEditBox, IAddressEditBox) 103 COM_INTERFACE_ENTRY_IID(IID_IWinEventHandler, IWinEventHandler) 104 COM_INTERFACE_ENTRY_IID(IID_IOleCommandTarget, IOleCommandTarget) 105 COM_INTERFACE_ENTRY_IID(IID_IDispatch, IDispatch) 106 COM_INTERFACE_ENTRY_IID(IID_IPersist, IPersist) 107 COM_INTERFACE_ENTRY_IID(IID_IPersistStream, IPersistStream) 108 END_COM_MAP() 109 }; 110