1 /* 2 * Multisource AutoComplete list 3 * 4 * Copyright 2007 Mikolaj Zalewski 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 #pragma once 23 24 class CACLMulti : 25 public CComCoClass<CACLMulti, &CLSID_ACLMulti>, 26 public CComObjectRootEx<CComMultiThreadModelNoCS>, 27 public IEnumString, 28 public IObjMgr, 29 public IACList 30 { 31 private: 32 struct ACLMultiSublist 33 { 34 IUnknown *punk; 35 IEnumString *pEnum; 36 IACList *pACL; 37 }; 38 39 INT fObjectCount; 40 INT fCurrentObject; 41 struct ACLMultiSublist *fObjects; 42 public: 43 CACLMulti(); 44 ~CACLMulti(); 45 46 // *** IEnumString methods *** 47 STDMETHOD(Next)(ULONG celt, LPOLESTR *rgelt, ULONG *pceltFetched) override; 48 STDMETHOD(Skip)(ULONG celt) override; 49 STDMETHOD(Reset)() override; 50 STDMETHOD(Clone)(IEnumString **ppenum) override; 51 52 // *** IACList methods *** 53 STDMETHOD(Expand)(LPCOLESTR pszExpand) override; 54 55 // *** IObjMgr methods *** 56 STDMETHOD(Append)(IUnknown *punk) override; 57 STDMETHOD(Remove)(IUnknown *punk) override; 58 59 private: 60 void release_obj(struct ACLMultiSublist *obj); 61 62 public: 63 64 DECLARE_REGISTRY_RESOURCEID(IDR_ACLMULTI) 65 DECLARE_NOT_AGGREGATABLE(CACLMulti) 66 67 DECLARE_PROTECT_FINAL_CONSTRUCT() 68 69 BEGIN_COM_MAP(CACLMulti) 70 COM_INTERFACE_ENTRY_IID(IID_IEnumString, IEnumString) 71 COM_INTERFACE_ENTRY_IID(IID_IACList, IACList) 72 COM_INTERFACE_ENTRY_IID(IID_IObjMgr, IObjMgr) 73 END_COM_MAP() 74 }; 75