[CMAKE]
[reactos.git] / dll / win32 / browseui / addresseditbox.cpp
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 /*
22 This class handles the combo box of the address band.
23 */
24 #include <windows.h>
25 #include <shlobj.h>
26 #include <shlobj_undoc.h>
27 #include <shlguid.h>
28 #include <shlguid_undoc.h>
29 #include <tchar.h>
30 #include <atlbase.h>
31 #include <atlcom.h>
32 #include <atlwin.h>
33 #include "resource.h"
34 #include "addresseditbox.h"
35 /*
36 TODO:
37 Add auto completion support
38 Subclass windows in Init method
39 Connect to browser connection point
40 Handle navigation complete messages to set edit box text
41 Handle listbox dropdown message and fill contents
42 Add drag and drop of icon in edit box
43 Handle enter in edit box to browse to typed path
44 Handle change notifies to update appropriately
45 Add handling of enter in edit box
46 Fix so selection in combo listbox navigates
47 Fix so editing text and typing enter navigates
48 */
49
50 CAddressEditBox::CAddressEditBox() :
51 fEditWindow(NULL, this, 1),
52 fComboBoxExWindow(NULL, this, 2)
53 {
54 }
55
56 CAddressEditBox::~CAddressEditBox()
57 {
58 }
59
60 HRESULT STDMETHODCALLTYPE CAddressEditBox::SetOwner(IUnknown *)
61 {
62 // connect to browser connection point
63 return E_NOTIMPL;
64 }
65
66 HRESULT STDMETHODCALLTYPE CAddressEditBox::FileSysChange(long param8, long paramC)
67 {
68 return E_NOTIMPL;
69 }
70
71 HRESULT STDMETHODCALLTYPE CAddressEditBox::Refresh(long param8)
72 {
73 return E_NOTIMPL;
74 }
75
76 HRESULT STDMETHODCALLTYPE CAddressEditBox::Init(HWND comboboxEx, HWND editControl, long param14, IUnknown *param18)
77 {
78 fComboBoxExWindow.SubclassWindow(comboboxEx);
79 fEditWindow.SubclassWindow(editControl);
80 return S_OK;
81 }
82
83 HRESULT STDMETHODCALLTYPE CAddressEditBox::SetCurrentDir(long paramC)
84 {
85 return E_NOTIMPL;
86 }
87
88 HRESULT STDMETHODCALLTYPE CAddressEditBox::ParseNow(long paramC)
89 {
90 return E_NOTIMPL;
91 }
92
93 HRESULT STDMETHODCALLTYPE CAddressEditBox::Execute(long paramC)
94 {
95 return E_NOTIMPL;
96 }
97
98 HRESULT STDMETHODCALLTYPE CAddressEditBox::Save(long paramC)
99 {
100 return E_NOTIMPL;
101 }
102
103 HRESULT STDMETHODCALLTYPE CAddressEditBox::OnWinEvent(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *theResult)
104 {
105 // handle fill of listbox here
106 return E_NOTIMPL;
107 }
108
109 HRESULT STDMETHODCALLTYPE CAddressEditBox::IsWindowOwner(HWND hWnd)
110 {
111 return E_NOTIMPL;
112 }
113
114 HRESULT STDMETHODCALLTYPE CAddressEditBox::QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[ ], OLECMDTEXT *pCmdText)
115 {
116 return E_NOTIMPL;
117 }
118
119 HRESULT STDMETHODCALLTYPE CAddressEditBox::Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
120 {
121 return E_NOTIMPL;
122 }
123
124 HRESULT STDMETHODCALLTYPE CAddressEditBox::GetTypeInfoCount(UINT *pctinfo)
125 {
126 return E_NOTIMPL;
127 }
128
129 HRESULT STDMETHODCALLTYPE CAddressEditBox::GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
130 {
131 return E_NOTIMPL;
132 }
133
134 HRESULT STDMETHODCALLTYPE CAddressEditBox::GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
135 {
136 return E_NOTIMPL;
137 }
138
139 HRESULT STDMETHODCALLTYPE CAddressEditBox::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
140 {
141 // on navigate complete, change edit section of combobox
142 return E_NOTIMPL;
143 }
144
145 HRESULT STDMETHODCALLTYPE CAddressEditBox::GetClassID(CLSID *pClassID)
146 {
147 if (pClassID == NULL)
148 return E_POINTER;
149 *pClassID = CLSID_AddressEditBox;
150 return S_OK;
151 }
152
153 HRESULT STDMETHODCALLTYPE CAddressEditBox::IsDirty()
154 {
155 return E_NOTIMPL;
156 }
157
158 HRESULT STDMETHODCALLTYPE CAddressEditBox::Load(IStream *pStm)
159 {
160 return E_NOTIMPL;
161 }
162
163 HRESULT STDMETHODCALLTYPE CAddressEditBox::Save(IStream *pStm, BOOL fClearDirty)
164 {
165 return E_NOTIMPL;
166 }
167
168 HRESULT STDMETHODCALLTYPE CAddressEditBox::GetSizeMax(ULARGE_INTEGER *pcbSize)
169 {
170 return E_NOTIMPL;
171 }
172
173 HRESULT CreateAddressEditBox(REFIID riid, void **ppv)
174 {
175 CComObject<CAddressEditBox> *theMenuBar;
176 HRESULT hResult;
177
178 if (ppv == NULL)
179 return E_POINTER;
180 *ppv = NULL;
181 ATLTRY (theMenuBar = new CComObject<CAddressEditBox>);
182 if (theMenuBar == NULL)
183 return E_OUTOFMEMORY;
184 hResult = theMenuBar->QueryInterface (riid, (void **)ppv);
185 if (FAILED (hResult))
186 {
187 delete theMenuBar;
188 return hResult;
189 }
190 return S_OK;
191 }