[SHELL32]
[reactos.git] / dll / win32 / shell32 / 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 {
30 private:
31 BOOL enabled;
32 BOOL initialized;
33 HWND hwndEdit;
34 HWND hwndListBox;
35 WNDPROC wpOrigEditProc;
36 WNDPROC wpOrigLBoxProc;
37 WCHAR *txtbackup;
38 WCHAR *quickComplete;
39 CComPtr<IEnumString> enumstr;
40 AUTOCOMPLETEOPTIONS options;
41 public:
42
43 CAutoComplete();
44 ~CAutoComplete();
45
46 static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
47 static LRESULT APIENTRY ACLBoxSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
48
49 // IAutoComplete2
50 virtual HRESULT WINAPI Enable(BOOL fEnable);
51 virtual HRESULT WINAPI Init(HWND hwndEdit, IUnknown *punkACL, LPCOLESTR pwzsRegKeyPath, LPCOLESTR pwszQuickComplete);
52 virtual HRESULT WINAPI GetOptions(DWORD *pdwFlag);
53 virtual HRESULT WINAPI SetOptions(DWORD dwFlag);
54
55 DECLARE_REGISTRY_RESOURCEID(IDR_AUTOCOMPLETE)
56 DECLARE_NOT_AGGREGATABLE(CAutoComplete)
57
58 DECLARE_PROTECT_FINAL_CONSTRUCT()
59
60 BEGIN_COM_MAP(CAutoComplete)
61 COM_INTERFACE_ENTRY_IID(IID_IAutoComplete, IAutoComplete)
62 COM_INTERFACE_ENTRY_IID(IID_IAutoComplete2, IAutoComplete2)
63 END_COM_MAP()
64 };
65
66 #endif /* _AUTOCOMPLETE_H_ */