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