xref: /reactos/dll/win32/browseui/addresseditbox.h (revision 84ccccab)
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 public:
51     // *** IShellService methods ***
52     virtual HRESULT STDMETHODCALLTYPE SetOwner(IUnknown *);
53 
54     // *** IAddressBand methods ***
55     virtual HRESULT STDMETHODCALLTYPE FileSysChange(long param8, long paramC);
56     virtual HRESULT STDMETHODCALLTYPE Refresh(long param8);
57 
58     // *** IAddressEditBox methods ***
59     virtual HRESULT STDMETHODCALLTYPE Init(HWND comboboxEx, HWND editControl, long param14, IUnknown *param18);
60     virtual HRESULT STDMETHODCALLTYPE SetCurrentDir(long paramC);
61     virtual HRESULT STDMETHODCALLTYPE ParseNow(long paramC);
62     virtual HRESULT STDMETHODCALLTYPE Execute(long paramC);
63     virtual HRESULT STDMETHODCALLTYPE Save(long paramC);
64 
65     // *** IWinEventHandler methods ***
66     virtual HRESULT STDMETHODCALLTYPE OnWinEvent(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *theResult);
67     virtual HRESULT STDMETHODCALLTYPE IsWindowOwner(HWND hWnd);
68 
69     // *** IOleCommandTarget methods ***
70     virtual HRESULT STDMETHODCALLTYPE QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[  ], OLECMDTEXT *pCmdText);
71     virtual HRESULT STDMETHODCALLTYPE Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut);
72 
73     // *** IDispatch methods ***
74     virtual HRESULT STDMETHODCALLTYPE GetTypeInfoCount(UINT *pctinfo);
75     virtual HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo);
76     virtual HRESULT STDMETHODCALLTYPE GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId);
77     virtual HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr);
78 
79     // *** IPersist methods ***
80     virtual HRESULT STDMETHODCALLTYPE GetClassID(CLSID *pClassID);
81 
82     // *** IPersistStream methods ***
83     virtual HRESULT STDMETHODCALLTYPE IsDirty();
84     virtual HRESULT STDMETHODCALLTYPE Load(IStream *pStm);
85     virtual HRESULT STDMETHODCALLTYPE Save(IStream *pStm, BOOL fClearDirty);
86     virtual HRESULT STDMETHODCALLTYPE GetSizeMax(ULARGE_INTEGER *pcbSize);
87 
88     // message handlers
89 
90     DECLARE_REGISTRY_RESOURCEID(IDR_ADDRESSEDITBOX)
91     DECLARE_NOT_AGGREGATABLE(CAddressEditBox)
92 
93     DECLARE_PROTECT_FINAL_CONSTRUCT()
94 
95     BEGIN_MSG_MAP(CAddressEditBox)
96     END_MSG_MAP()
97 
98     BEGIN_COM_MAP(CAddressEditBox)
99         COM_INTERFACE_ENTRY_IID(IID_IShellService, IShellService)
100         COM_INTERFACE_ENTRY_IID(IID_IAddressBand, IAddressBand)
101         COM_INTERFACE_ENTRY_IID(IID_IAddressEditBox, IAddressEditBox)
102         COM_INTERFACE_ENTRY_IID(IID_IWinEventHandler, IWinEventHandler)
103         COM_INTERFACE_ENTRY_IID(IID_IOleCommandTarget, IOleCommandTarget)
104         COM_INTERFACE_ENTRY_IID(IID_IDispatch, IDispatch)
105         COM_INTERFACE_ENTRY_IID(IID_IPersist, IPersist)
106         COM_INTERFACE_ENTRY_IID(IID_IPersistStream, IPersistStream)
107     END_COM_MAP()
108 };
109