5cbb5d8988514d3b0ee828a361d72642d0f6c309
[reactos.git] / reactos / dll / win32 / browseui / CAutoComplete.h
1 /*
2 * AutoComplete interfaces implementation.
3 *
4 * Copyright 2004 Maxime Bellengé <maxime.bellenge@laposte.net>
5 * Copyright 2009 Andrew Hill
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 */
21
22 #ifndef _AUTOCOMPLETE_H_
23 #define _AUTOCOMPLETE_H_
24
25 class CAutoComplete :
26 public CComCoClass<CAutoComplete, &CLSID_AutoComplete>,
27 public CComObjectRootEx<CComMultiThreadModelNoCS>,
28 public IAutoComplete2,
29 public IAutoCompleteDropDown,
30 public IEnumString
31 {
32 private:
33 BOOL enabled;
34 BOOL initialized;
35 HWND hwndEdit;
36 HWND hwndListBox;
37 WNDPROC wpOrigEditProc;
38 WNDPROC wpOrigLBoxProc;
39 WCHAR *txtbackup;
40 WCHAR *quickComplete;
41 CComPtr<IEnumString> enumstr;
42 AUTOCOMPLETEOPTIONS options;
43 public:
44
45 CAutoComplete();
46 ~CAutoComplete();
47
48 static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
49 static LRESULT APIENTRY ACLBoxSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
50
51 // IAutoComplete2
52 virtual HRESULT WINAPI Enable(BOOL fEnable);
53 virtual HRESULT WINAPI Init(HWND hwndEdit, IUnknown *punkACL, LPCOLESTR pwzsRegKeyPath, LPCOLESTR pwszQuickComplete);
54 virtual HRESULT WINAPI GetOptions(DWORD *pdwFlag);
55 virtual HRESULT WINAPI SetOptions(DWORD dwFlag);
56
57 // IAutoCompleteDropDown
58 virtual HRESULT STDMETHODCALLTYPE GetDropDownStatus(DWORD *pdwFlags, LPWSTR *ppwszString);
59 virtual HRESULT STDMETHODCALLTYPE ResetEnumerator();
60
61 // IEnumString methods
62 virtual HRESULT STDMETHODCALLTYPE Next(ULONG celt, LPOLESTR *rgelt, ULONG *pceltFetched);
63 virtual HRESULT STDMETHODCALLTYPE Skip(ULONG celt);
64 virtual HRESULT STDMETHODCALLTYPE Reset();
65 virtual HRESULT STDMETHODCALLTYPE Clone(IEnumString **ppenum);
66
67 DECLARE_REGISTRY_RESOURCEID(IDR_AUTOCOMPLETE)
68 DECLARE_NOT_AGGREGATABLE(CAutoComplete)
69
70 DECLARE_PROTECT_FINAL_CONSTRUCT()
71
72 BEGIN_COM_MAP(CAutoComplete)
73 COM_INTERFACE_ENTRY_IID(IID_IAutoComplete, IAutoComplete)
74 COM_INTERFACE_ENTRY_IID(IID_IAutoComplete2, IAutoComplete2)
75 COM_INTERFACE_ENTRY_IID(IID_IAutoCompleteDropDown, IAutoCompleteDropDown)
76 COM_INTERFACE_ENTRY_IID(IID_IEnumString, IEnumString)
77 END_COM_MAP()
78 };
79
80 #endif /* _AUTOCOMPLETE_H_ */