ReactOS  0.4.15-dev-1377-ga59cecd
aclistisf.h
Go to the documentation of this file.
1 /*
2  * Shell AutoComplete list
3  *
4  * Copyright 2015 Thomas Faber
5  * Copyright 2020 Katayama Hirofumi MZ
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 CACListISF :
25  public CComCoClass<CACListISF, &CLSID_ACListISF>,
26  public CComObjectRootEx<CComMultiThreadModelNoCS>,
27  public IEnumString,
28  public IACList2,
29  public ICurrentWorkingDirectory,
30  public IShellService,
31  public IPersistFolder
32 {
33 private:
35  {
41  };
42 
47  CComHeapPtr<ITEMIDLIST> m_pidlLocation;
48  CComHeapPtr<ITEMIDLIST> m_pidlCurDir;
49  CComPtr<IEnumIDList> m_pEnumIDList;
50  CComPtr<IShellFolder> m_pShellFolder;
51  CComPtr<IBrowserService> m_pBrowserService;
52 
53 public:
54  CACListISF();
55  ~CACListISF();
56 
59  HRESULT GetDisplayName(LPCITEMIDLIST pidlChild, CComHeapPtr<WCHAR>& pszChild);
60  HRESULT GetPathName(LPCITEMIDLIST pidlChild, CComHeapPtr<WCHAR>& pszPath);
61 
62  // *** IEnumString methods ***
63  STDMETHODIMP Next(ULONG celt, LPOLESTR *rgelt, ULONG *pceltFetched) override;
64  STDMETHODIMP Skip(ULONG celt) override;
65  STDMETHODIMP Reset() override;
66  STDMETHODIMP Clone(IEnumString **ppenum) override;
67 
68  // *** IACList methods ***
69  STDMETHODIMP Expand(LPCOLESTR pszExpand) override;
70 
71  // *** IACList2 methods ***
72  STDMETHODIMP SetOptions(DWORD dwFlag) override;
73  STDMETHODIMP GetOptions(DWORD* pdwFlag) override;
74 
75  // FIXME: These virtual keywords below should be removed.
76 
77  // *** IShellService methods ***
78  virtual STDMETHODIMP SetOwner(IUnknown *punkOwner) override;
79 
80  // *** IPersist methods ***
81  virtual STDMETHODIMP GetClassID(CLSID *pClassID) override;
82 
83  // *** IPersistFolder methods ***
84  virtual STDMETHODIMP Initialize(PCIDLIST_ABSOLUTE pidl) override;
85 
86  // *** ICurrentWorkingDirectory methods ***
87  STDMETHODIMP GetDirectory(LPWSTR pwzPath, DWORD cchSize) override;
88  STDMETHODIMP SetDirectory(LPCWSTR pwzPath) override;
89 
90 public:
93 
95 
98  COM_INTERFACE_ENTRY_IID(IID_IACList, IACList)
99  COM_INTERFACE_ENTRY_IID(IID_IACList2, IACList2)
100  COM_INTERFACE_ENTRY_IID(IID_IShellService, IShellService)
101  // Windows doesn't return this
102  //COM_INTERFACE_ENTRY_IID(IID_IPersist, IPersist)
103  COM_INTERFACE_ENTRY_IID(IID_IPersistFolder, IPersistFolder)
104  COM_INTERFACE_ENTRY_IID(IID_ICurrentWorkingDirectory, ICurrentWorkingDirectory)
105  END_COM_MAP()
106 };
STDMETHODIMP Expand(LPCOLESTR pszExpand) override
Definition: aclistisf.cpp:326
#define IDR_ACLISTISF
Definition: resource.h:104
const GUID IID_IEnumString
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
CComPtr< IEnumIDList > m_pEnumIDList
Definition: aclistisf.h:49
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
#define DECLARE_NOT_AGGREGATABLE(x)
Definition: atlcom.h:611
virtual STDMETHODIMP Initialize(PCIDLIST_ABSOLUTE pidl) override
Definition: aclistisf.cpp:383
CComHeapPtr< ITEMIDLIST > m_pidlLocation
Definition: aclistisf.h:47
HRESULT GetPathName(LPCITEMIDLIST pidlChild, CComHeapPtr< WCHAR > &pszPath)
Definition: aclistisf.cpp:177
virtual STDMETHODIMP GetClassID(CLSID *pClassID) override
Definition: aclistisf.cpp:373
CComPtr< IShellFolder > m_pShellFolder
Definition: aclistisf.h:50
static LPOLESTR
Definition: stg_prop.c:27
STDMETHODIMP Reset() override
Definition: aclistisf.cpp:285
unsigned int BOOL
Definition: ntddk_ex.h:94
HRESULT GetDisplayName(LPCITEMIDLIST pidlChild, CComHeapPtr< WCHAR > &pszChild)
Definition: aclistisf.cpp:153
#define STDMETHODIMP
Definition: basetyps.h:43
STDMETHODIMP Clone(IEnumString **ppenum) override
Definition: aclistisf.cpp:318
BOOL m_fShowHidden
Definition: aclistisf.h:45
#define BEGIN_COM_MAP(x)
Definition: atlcom.h:541
LOCATION_TYPE m_iNextLocation
Definition: aclistisf.h:44
DWORD m_dwOptions
Definition: aclistisf.h:43
HRESULT NextLocation()
Definition: aclistisf.cpp:35
LONG HRESULT
Definition: typedefs.h:79
virtual STDMETHODIMP SetOwner(IUnknown *punkOwner) override
Definition: aclistisf.cpp:364
unsigned long DWORD
Definition: ntddk_ex.h:95
CComHeapPtr< ITEMIDLIST > m_pidlCurDir
Definition: aclistisf.h:48
STDMETHODIMP Skip(ULONG celt) override
Definition: aclistisf.cpp:312
HRESULT SetLocation(LPITEMIDLIST pidl)
Definition: aclistisf.cpp:109
#define DECLARE_REGISTRY_RESOURCEID(x)
Definition: atlcom.h:605
STDMETHODIMP GetDirectory(LPWSTR pwzPath, DWORD cchSize) override
Definition: aclistisf.cpp:401
STDMETHODIMP GetOptions(DWORD *pdwFlag) override
Definition: aclistisf.cpp:352
STDMETHODIMP SetOptions(DWORD dwFlag) override
Definition: aclistisf.cpp:345
#define COM_INTERFACE_ENTRY_IID(iid, x)
Definition: atlcom.h:561
STDMETHODIMP Next(ULONG celt, LPOLESTR *rgelt, ULONG *pceltFetched) override
Definition: aclistisf.cpp:213
#define DECLARE_PROTECT_FINAL_CONSTRUCT()
Definition: atlcom.h:639
unsigned int ULONG
Definition: retypes.h:1
CAtlStringW CStringW
Definition: atlstr.h:130
STDMETHODIMP SetDirectory(LPCWSTR pwzPath) override
Definition: aclistisf.cpp:407
#define END_COM_MAP()
Definition: atlcom.h:552
CStringW m_szExpand
Definition: aclistisf.h:46
WCHAR * LPWSTR
Definition: xmlstorage.h:184
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
CComPtr< IBrowserService > m_pBrowserService
Definition: aclistisf.h:51