ReactOS 0.4.16-dev-456-ga97fcf1
CEnumIDListBase.h
Go to the documentation of this file.
1/*
2 * This library is free software; you can redistribute it and/or
3 * modify it under the terms of the GNU Lesser General Public
4 * License as published by the Free Software Foundation; either
5 * version 2.1 of the License, or (at your option) any later version.
6 *
7 * This library is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 * Lesser General Public License for more details.
11 *
12 * You should have received a copy of the GNU Lesser General Public
13 * License along with this library; if not, write to the Free Software
14 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
15 */
16
17#ifndef __ENUMIDLIST_H__
18#define __ENUMIDLIST_H__
19
21{
24};
25
27 public CComObjectRootEx<CComMultiThreadModelNoCS>,
28 public IEnumIDList
29{
30protected:
34public:
36 virtual ~CEnumIDListBase();
41
42 template <class T> BOOL HasItemWithCLSIDImpl(LPCITEMIDLIST pidl)
43 {
44 const CLSID * const pClsid = static_cast<T*>(this)->GetPidlClsid((PCUITEMID_CHILD)pidl);
45 for (ENUMLIST *pCur = mpFirst; pClsid && pCur; pCur = pCur->pNext)
46 {
47 const CLSID * const pEnumClsid = static_cast<T*>(this)->GetPidlClsid((PCUITEMID_CHILD)pCur->pidl);
48 if (pEnumClsid && IsEqualCLSID(*pClsid, *pEnumClsid))
49 return TRUE;
50 }
51 return FALSE;
52 }
53
54 // *** IEnumIDList methods ***
55 STDMETHOD(Next)(ULONG celt, LPITEMIDLIST *rgelt, ULONG *pceltFetched) override;
56 STDMETHOD(Skip)(ULONG celt) override;
57 STDMETHOD(Reset)() override;
58 STDMETHOD(Clone)(IEnumIDList **ppenum) override;
59
61 COM_INTERFACE_ENTRY_IID(IID_IEnumIDList, IEnumIDList)
63};
64
65#endif /* __ENUMIDLIST_H__ */
#define STDMETHOD(m)
Definition: basetyps.h:62
STDMETHOD() Clone(IEnumIDList **ppenum) override
STDMETHOD() Skip(ULONG celt) override
ENUMLIST * mpLast
ENUMLIST * mpCurrent
BOOL HasItemWithCLSID(LPITEMIDLIST pidl)
ENUMLIST * mpFirst
BOOL HasItemWithCLSIDImpl(LPCITEMIDLIST pidl)
BOOL AddToEnumList(LPITEMIDLIST pidl)
virtual ~CEnumIDListBase()
HRESULT AppendItemsFromEnumerator(IEnumIDList *pEnum)
STDMETHOD() Reset() override
STDMETHOD() Next(ULONG celt, LPITEMIDLIST *rgelt, ULONG *pceltFetched) override
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
SINGLE_LIST_ENTRY * pCur
#define BEGIN_COM_MAP(x)
Definition: atlcom.h:581
#define COM_INTERFACE_ENTRY_IID(iid, x)
Definition: atlcom.h:601
#define END_COM_MAP()
Definition: atlcom.h:592
#define T
Definition: mbstring.h:31
#define IsEqualCLSID(rclsid1, rclsid2)
Definition: guiddef.h:96
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
const ITEMID_CHILD UNALIGNED * PCUITEMID_CHILD
Definition: shtypes.idl:70
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
ENUMLIST * pNext
LPITEMIDLIST pidl
uint32_t ULONG
Definition: typedefs.h:59