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