48858fb3635e3db9407fbafb691ce482de5e5831
[reactos.git] / reactos / dll / win32 / shell32 / CFolderItems.h
1 /*
2 * FolderItem(s) implementation
3 *
4 * Copyright 2015 Mark Jansen
5 *
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.
10 *
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.
15 *
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
19 */
20
21 #ifndef _FOLDERITEM_H_
22 #define _FOLDERITEM_H_
23
24
25 class CFolderItem:
26 public CComCoClass<CFolderItem>,
27 public CComObjectRootEx<CComMultiThreadModelNoCS>,
28 public IDispatchImpl<FolderItem, &IID_FolderItem>
29 {
30 private:
31 CComHeapPtr<ITEMIDLIST> m_idlist;
32
33 public:
34 CFolderItem();
35 ~CFolderItem();
36
37 void Init(LPITEMIDLIST idlist);
38
39
40 // *** FolderItem methods ***
41 virtual HRESULT STDMETHODCALLTYPE get_Application(IDispatch **ppid);
42 virtual HRESULT STDMETHODCALLTYPE get_Parent(IDispatch **ppid);
43 virtual HRESULT STDMETHODCALLTYPE get_Name(BSTR *pbs);
44 virtual HRESULT STDMETHODCALLTYPE put_Name(BSTR bs);
45 virtual HRESULT STDMETHODCALLTYPE get_Path(BSTR *pbs);
46 virtual HRESULT STDMETHODCALLTYPE get_GetLink(IDispatch **ppid);
47 virtual HRESULT STDMETHODCALLTYPE get_GetFolder(IDispatch **ppid);
48 virtual HRESULT STDMETHODCALLTYPE get_IsLink(VARIANT_BOOL *pb);
49 virtual HRESULT STDMETHODCALLTYPE get_IsFolder(VARIANT_BOOL *pb);
50 virtual HRESULT STDMETHODCALLTYPE get_IsFileSystem(VARIANT_BOOL *pb);
51 virtual HRESULT STDMETHODCALLTYPE get_IsBrowsable(VARIANT_BOOL *pb);
52 virtual HRESULT STDMETHODCALLTYPE get_ModifyDate(DATE *pdt);
53 virtual HRESULT STDMETHODCALLTYPE put_ModifyDate(DATE dt);
54 virtual HRESULT STDMETHODCALLTYPE get_Size(LONG *pul);
55 virtual HRESULT STDMETHODCALLTYPE get_Type(BSTR *pbs);
56 virtual HRESULT STDMETHODCALLTYPE Verbs(FolderItemVerbs **ppfic);
57 virtual HRESULT STDMETHODCALLTYPE InvokeVerb(VARIANT vVerb);
58
59
60 DECLARE_NOT_AGGREGATABLE(CFolderItem)
61 DECLARE_PROTECT_FINAL_CONSTRUCT()
62
63 BEGIN_COM_MAP(CFolderItem)
64 COM_INTERFACE_ENTRY_IID(IID_FolderItem, FolderItem)
65 COM_INTERFACE_ENTRY_IID(IID_IDispatch, IDispatch)
66 END_COM_MAP()
67 };
68
69 class CFolderItems:
70 public CComCoClass<CFolderItems>,
71 public CComObjectRootEx<CComMultiThreadModelNoCS>,
72 public IDispatchImpl<FolderItems, &IID_FolderItems>
73 {
74 private:
75
76 public:
77 CFolderItems();
78 ~CFolderItems();
79
80 // *** FolderItems methods ***
81 virtual HRESULT STDMETHODCALLTYPE get_Count(long *plCount);
82 virtual HRESULT STDMETHODCALLTYPE get_Application(IDispatch **ppid);
83 virtual HRESULT STDMETHODCALLTYPE get_Parent(IDispatch **ppid);
84 virtual HRESULT STDMETHODCALLTYPE Item(VARIANT index, FolderItem **ppid);
85 virtual HRESULT STDMETHODCALLTYPE _NewEnum(IUnknown **ppunk);
86
87 DECLARE_NOT_AGGREGATABLE(CFolderItems)
88 DECLARE_PROTECT_FINAL_CONSTRUCT()
89
90 BEGIN_COM_MAP(CFolderItems)
91 COM_INTERFACE_ENTRY_IID(IID_FolderItems, FolderItems)
92 COM_INTERFACE_ENTRY_IID(IID_IDispatch, IDispatch)
93 END_COM_MAP()
94 };
95
96 #endif