2 * FolderItem(s) implementation
4 * Copyright 2015 Mark Jansen
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #ifndef _FOLDERITEM_H_
22 #define _FOLDERITEM_H_
26 public CComCoClass
<CFolderItem
>,
27 public CComObjectRootEx
<CComMultiThreadModelNoCS
>,
28 public IDispatchImpl
<FolderItem
, &IID_FolderItem
>
31 CComHeapPtr
<ITEMIDLIST
> m_idlist
;
37 // Please note: CFolderItem takes ownership of idlist.
38 void Init(LPITEMIDLIST idlist
);
41 // *** FolderItem methods ***
42 virtual HRESULT STDMETHODCALLTYPE
get_Application(IDispatch
**ppid
);
43 virtual HRESULT STDMETHODCALLTYPE
get_Parent(IDispatch
**ppid
);
44 virtual HRESULT STDMETHODCALLTYPE
get_Name(BSTR
*pbs
);
45 virtual HRESULT STDMETHODCALLTYPE
put_Name(BSTR bs
);
46 virtual HRESULT STDMETHODCALLTYPE
get_Path(BSTR
*pbs
);
47 virtual HRESULT STDMETHODCALLTYPE
get_GetLink(IDispatch
**ppid
);
48 virtual HRESULT STDMETHODCALLTYPE
get_GetFolder(IDispatch
**ppid
);
49 virtual HRESULT STDMETHODCALLTYPE
get_IsLink(VARIANT_BOOL
*pb
);
50 virtual HRESULT STDMETHODCALLTYPE
get_IsFolder(VARIANT_BOOL
*pb
);
51 virtual HRESULT STDMETHODCALLTYPE
get_IsFileSystem(VARIANT_BOOL
*pb
);
52 virtual HRESULT STDMETHODCALLTYPE
get_IsBrowsable(VARIANT_BOOL
*pb
);
53 virtual HRESULT STDMETHODCALLTYPE
get_ModifyDate(DATE
*pdt
);
54 virtual HRESULT STDMETHODCALLTYPE
put_ModifyDate(DATE dt
);
55 virtual HRESULT STDMETHODCALLTYPE
get_Size(LONG
*pul
);
56 virtual HRESULT STDMETHODCALLTYPE
get_Type(BSTR
*pbs
);
57 virtual HRESULT STDMETHODCALLTYPE
Verbs(FolderItemVerbs
**ppfic
);
58 virtual HRESULT STDMETHODCALLTYPE
InvokeVerb(VARIANT vVerb
);
61 DECLARE_NOT_AGGREGATABLE(CFolderItem
)
62 DECLARE_PROTECT_FINAL_CONSTRUCT()
64 BEGIN_COM_MAP(CFolderItem
)
65 COM_INTERFACE_ENTRY_IID(IID_FolderItem
, FolderItem
)
66 COM_INTERFACE_ENTRY_IID(IID_IDispatch
, IDispatch
)
71 public CComCoClass
<CFolderItems
>,
72 public CComObjectRootEx
<CComMultiThreadModelNoCS
>,
73 public IDispatchImpl
<FolderItems
, &IID_FolderItems
>
76 CComHeapPtr
<ITEMIDLIST
> m_idlist
;
77 CComPtr
<IEnumIDList
> m_EnumIDList
;
84 // Please note: CFolderItems takes ownership of idlist.
85 HRESULT
Init(LPITEMIDLIST idlist
);
87 // *** FolderItems methods ***
88 virtual HRESULT STDMETHODCALLTYPE
get_Count(long *plCount
);
89 virtual HRESULT STDMETHODCALLTYPE
get_Application(IDispatch
**ppid
);
90 virtual HRESULT STDMETHODCALLTYPE
get_Parent(IDispatch
**ppid
);
91 virtual HRESULT STDMETHODCALLTYPE
Item(VARIANT index
, FolderItem
**ppid
);
92 virtual HRESULT STDMETHODCALLTYPE
_NewEnum(IUnknown
**ppunk
);
94 DECLARE_NOT_AGGREGATABLE(CFolderItems
)
95 DECLARE_PROTECT_FINAL_CONSTRUCT()
97 BEGIN_COM_MAP(CFolderItems
)
98 COM_INTERFACE_ENTRY_IID(IID_FolderItems
, FolderItems
)
99 COM_INTERFACE_ENTRY_IID(IID_IDispatch
, IDispatch
)