[BROWSEUI:FORMATTING]
[reactos.git] / reactos / 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(
94 HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *theResult)
95 {
96 // handle fill of listbox here
97 return E_NOTIMPL;
98 }
99
100 HRESULT STDMETHODCALLTYPE CAddressEditBox::IsWindowOwner(HWND hWnd)
101 {
102 return E_NOTIMPL;
103 }
104
105 HRESULT STDMETHODCALLTYPE CAddressEditBox::QueryStatus(
106 const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[ ], OLECMDTEXT *pCmdText)
107 {
108 return E_NOTIMPL;
109 }
110
111 HRESULT STDMETHODCALLTYPE CAddressEditBox::Exec(const GUID *pguidCmdGroup, DWORD nCmdID,
112 DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
113 {
114 return E_NOTIMPL;
115 }
116
117 HRESULT STDMETHODCALLTYPE CAddressEditBox::GetTypeInfoCount(UINT *pctinfo)
118 {
119 return E_NOTIMPL;
120 }
121
122 HRESULT STDMETHODCALLTYPE CAddressEditBox::GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
123 {
124 return E_NOTIMPL;
125 }
126
127 HRESULT STDMETHODCALLTYPE CAddressEditBox::GetIDsOfNames(
128 REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
129 {
130 return E_NOTIMPL;
131 }
132
133 HRESULT STDMETHODCALLTYPE CAddressEditBox::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid,
134 WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
135 {
136 // on navigate complete, change edit section of combobox
137 return E_NOTIMPL;
138 }
139
140 HRESULT STDMETHODCALLTYPE CAddressEditBox::GetClassID(CLSID *pClassID)
141 {
142 if (pClassID == NULL)
143 return E_POINTER;
144 *pClassID = CLSID_AddressEditBox;
145 return S_OK;
146 }
147
148 HRESULT STDMETHODCALLTYPE CAddressEditBox::IsDirty()
149 {
150 return E_NOTIMPL;
151 }
152
153 HRESULT STDMETHODCALLTYPE CAddressEditBox::Load(IStream *pStm)
154 {
155 return E_NOTIMPL;
156 }
157
158 HRESULT STDMETHODCALLTYPE CAddressEditBox::Save(IStream *pStm, BOOL fClearDirty)
159 {
160 return E_NOTIMPL;
161 }
162
163 HRESULT STDMETHODCALLTYPE CAddressEditBox::GetSizeMax(ULARGE_INTEGER *pcbSize)
164 {
165 return E_NOTIMPL;
166 }
167
168 HRESULT CreateAddressEditBox(REFIID riid, void **ppv)
169 {
170 CComObject<CAddressEditBox> *theMenuBar;
171 HRESULT hResult;
172
173 if (ppv == NULL)
174 return E_POINTER;
175 *ppv = NULL;
176 ATLTRY (theMenuBar = new CComObject<CAddressEditBox>);
177 if (theMenuBar == NULL)
178 return E_OUTOFMEMORY;
179 hResult = theMenuBar->QueryInterface(riid, reinterpret_cast<void **>(ppv));
180 if (FAILED(hResult))
181 {
182 delete theMenuBar;
183 return hResult;
184 }
185 return S_OK;
186 }