xref: /reactos/dll/win32/shdocvw/CFavBand.h (revision 7ede5349)
1 /*
2  * PROJECT:     ReactOS shdocvw
3  * LICENSE:     LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
4  * PURPOSE:     Favorites bar
5  * COPYRIGHT:   Copyright 2024 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
6  */
7 
8 #pragma once
9 
10 #ifdef __cplusplus
11 
12 #include "CNSCBand.h"
13 
14 class CFavBand
15     : public CNSCBand
16     , public CComCoClass<CFavBand, &CLSID_SH_FavBand>
17     , public CComObjectRootEx<CComMultiThreadModelNoCS>
18 {
19 public:
20     CFavBand();
21     virtual ~CFavBand();
22 
23     STDMETHODIMP GetClassID(CLSID *pClassID) override;
24     STDMETHODIMP OnSelectionChanged(_In_ PCIDLIST_ABSOLUTE pidl);
25 
26     DECLARE_REGISTRY_RESOURCEID(IDR_FAVBAND)
27     DECLARE_NOT_AGGREGATABLE(CFavBand)
28     DECLARE_PROTECT_FINAL_CONSTRUCT()
29 
30     BEGIN_COM_MAP(CFavBand)
31         COM_INTERFACE_ENTRY_IID(IID_IDeskBand, IDeskBand)
32         COM_INTERFACE_ENTRY2_IID(IID_IDockingWindow, IDockingWindow, IDeskBand)
33         COM_INTERFACE_ENTRY2_IID(IID_IOleWindow, IOleWindow, IDeskBand)
34         COM_INTERFACE_ENTRY_IID(IID_IObjectWithSite, IObjectWithSite)
35         COM_INTERFACE_ENTRY_IID(IID_IInputObject, IInputObject)
36         COM_INTERFACE_ENTRY_IID(IID_IPersistStream, IPersistStream)
37         COM_INTERFACE_ENTRY2_IID(IID_IPersist, IPersist, IPersistStream)
38         COM_INTERFACE_ENTRY_IID(IID_IOleCommandTarget, IOleCommandTarget)
39         COM_INTERFACE_ENTRY_IID(IID_IServiceProvider, IServiceProvider)
40         COM_INTERFACE_ENTRY_IID(IID_IContextMenu, IContextMenu)
41         COM_INTERFACE_ENTRY2_IID(IID_IUnknown, IUnknown, IContextMenu)
42         COM_INTERFACE_ENTRY_IID(IID_IBandNavigate, IBandNavigate)
43         COM_INTERFACE_ENTRY_IID(IID_IWinEventHandler, IWinEventHandler)
44         COM_INTERFACE_ENTRY_IID(IID_INamespaceProxy, INamespaceProxy)
45     END_COM_MAP()
46 
47 protected:
48     INT _GetRootCsidl() override;
49     DWORD _GetTVStyle() override;
50     DWORD _GetTVExStyle() override;
51     DWORD _GetEnumFlags() override;
52     BOOL _GetTitle(LPWSTR pszTitle, INT cchTitle) override;
53     HRESULT _CreateTreeView(HWND hwndParent) override;
54     HRESULT _CreateToolbar(HWND hwndParent) override;
55     BOOL _WantsRootItem() override;
56     void _SortItems(HTREEITEM hParent) override;
57 };
58 
59 #endif // def __cplusplus
60