ReactOS 0.4.15-dev-8219-ge8b88cf
CBandSite.h
Go to the documentation of this file.
1/*
2 * Rebar band site
3 *
4 * Copyright 2007 Hervé Poussineau
5 * Copyright 2009 Andrew Hill
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
24extern inline BOOL _ILIsDesktop(LPCITEMIDLIST pidl)
25{
26 return (pidl == NULL || pidl->mkid.cb == 0);
27}
28
30 public CComObjectRootEx<CComMultiThreadModelNoCS>,
31 public IBandSite,
32 public IInputObjectSite,
33 public IInputObject,
34 public IDeskBarClient,
35 public IWinEventHandler,
36 public IPersistStream,
37 public IDropTarget,
38 public IServiceProvider,
39 public IBandSiteHelper,
41{
42private:
44 {
47 IWinEventHandler *WndEvtHandler;
50 };
51
56 CComPtr<IOleWindow> m_site;
57 DWORD m_dwState; /* BSSF_ flags */
58 DWORD m_dwStyle; /* BSIS_ flags */
59public:
62
63 // *** IBandSite methods ***
64 STDMETHOD(AddBand)(IUnknown *punk) override;
65 STDMETHOD(EnumBands)(UINT uBand, DWORD *pdwBandID) override;
66 STDMETHOD(QueryBand)(DWORD dwBandID, IDeskBand **ppstb, DWORD *pdwState, LPWSTR pszName, int cchName) override;
67 STDMETHOD(SetBandState)(DWORD dwBandID, DWORD dwMask, DWORD dwState) override;
68 STDMETHOD(RemoveBand)(DWORD dwBandID) override;
69 STDMETHOD(GetBandObject)(DWORD dwBandID, REFIID riid, void **ppv) override;
70 STDMETHOD(SetBandSiteInfo)(const BANDSITEINFO *pbsinfo) override;
71 STDMETHOD(GetBandSiteInfo)(BANDSITEINFO *pbsinfo) override;
72
73 // *** IWinEventHandler methods ***
74 STDMETHOD(OnWinEvent)(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *theResult) override;
76
77 // *** IOleWindow methods ***
78 STDMETHOD(GetWindow)(HWND *lphwnd) override;
79 STDMETHOD(ContextSensitiveHelp)(BOOL fEnterMode) override;
80
81 // *** IDeskBarClient methods ***
82 STDMETHOD(SetDeskBarSite)(IUnknown *punkSite) override;
83 STDMETHOD(SetModeDBC)(DWORD dwMode) override;
84 STDMETHOD(UIActivateDBC)(DWORD dwState) override;
85 STDMETHOD(GetSize)(DWORD dwWhich, LPRECT prc) override;
86
87 // *** IOleCommandTarget methods ***
88 STDMETHOD(QueryStatus)(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[ ], OLECMDTEXT *pCmdText) override;
89 STDMETHOD(Exec)(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut) override;
90
91 // *** IInputObject methods ***
92 STDMETHOD(UIActivateIO)(BOOL fActivate, LPMSG lpMsg) override;
93 STDMETHOD(HasFocusIO)() override;
94 STDMETHOD(TranslateAcceleratorIO)(LPMSG lpMsg) override;
95
96 // *** IInputObjectSite methods ***
97 STDMETHOD(OnFocusChangeIS)(struct IUnknown *paramC, int param10) override;
98
99 // *** IServiceProvider methods ***
100 STDMETHOD(QueryService)(REFGUID guidService, REFIID riid, void **ppvObject) override;
101
102 // *** IPersist methods ***
103 STDMETHOD(GetClassID)(CLSID *pClassID) override;
104
105 // *** IPersistStream methods ***
106 STDMETHOD(IsDirty)() override;
107 STDMETHOD(Load)(IStream *pStm) override;
108 STDMETHOD(Save)(IStream *pStm, BOOL fClearDirty) override;
109 STDMETHOD(GetSizeMax)(ULARGE_INTEGER *pcbSize) override;
110
111 // *** IDropTarget methods ***
112 STDMETHOD(DragEnter)(IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect) override;
113 STDMETHOD(DragOver)(DWORD grfKeyState, POINTL pt, DWORD *pdwEffect) override;
114 STDMETHOD(DragLeave)() override;
115 STDMETHOD(Drop)(IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect) override;
116
117 // *** IBandSiteHelper methods ***
118 STDMETHOD(LoadFromStreamBS)(IStream *, const GUID &, void **) override;
120
121private:
122 UINT _GetBandID(struct BandObject *Band);
123 struct BandObject *_GetBandByID(DWORD dwBandID);
124 void _FreeBand(struct BandObject *Band);
126 VOID _BuildBandInfo(struct BandObject *Band, REBARBANDINFOW *prbi);
127 HRESULT _UpdateBand(struct BandObject *Band);
129 HRESULT _UpdateBand(DWORD dwBandID);
133
135 COM_INTERFACE_ENTRY_IID(IID_IBandSite, IBandSite)
136 COM_INTERFACE_ENTRY_IID(IID_IWinEventHandler, IWinEventHandler)
138 COM_INTERFACE_ENTRY_IID(IID_IDeskBarClient, IDeskBarClient)
139 COM_INTERFACE_ENTRY_IID(IID_IOleCommandTarget, IOleCommandTarget)
140 COM_INTERFACE_ENTRY_IID(IID_IInputObject, IInputObject)
141 COM_INTERFACE_ENTRY_IID(IID_IInputObjectSite, IInputObjectSite)
142 COM_INTERFACE_ENTRY_IID(IID_IServiceProvider, IServiceProvider)
145 COM_INTERFACE_ENTRY_IID(IID_IDropTarget, IDropTarget)
146 COM_INTERFACE_ENTRY_IID(IID_IBandSiteHelper, IBandSiteHelper)
148};
149
151 public CComCoClass<CBandSite, &CLSID_RebarBandSite>,
152 public CBandSiteBase
153{
154public:
155
158
160};
BOOL _ILIsDesktop(LPCITEMIDLIST pidl)
Definition: CBandSite.h:24
HWND hWnd
Definition: settings.c:17
#define STDMETHOD(m)
Definition: basetyps.h:62
STDMETHOD() Drop(IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect) override
Definition: CBandSite.cpp:993
UINT _GetBandID(struct BandObject *Band)
Definition: CBandSite.cpp:49
STDMETHOD() LoadFromStreamBS(IStream *, const GUID &, void **) override
Definition: CBandSite.cpp:998
HRESULT _IsBandDeletable(DWORD dwBandID)
Definition: CBandSite.cpp:241
STDMETHOD() GetBandObject(DWORD dwBandID, REFIID riid, void **ppv) override
Definition: CBandSite.cpp:662
STDMETHOD() Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut) override
Definition: CBandSite.cpp:884
VOID _BuildBandInfo(struct BandObject *Band, REBARBANDINFOW *prbi)
Definition: CBandSite.cpp:90
STDMETHOD() SetBandState(DWORD dwBandID, DWORD dwMask, DWORD dwState) override
Definition: CBandSite.cpp:619
STDMETHOD() SaveToStreamBS(IUnknown *, IStream *) override
Definition: CBandSite.cpp:1003
STDMETHOD() TranslateAcceleratorIO(LPMSG lpMsg) override
Definition: CBandSite.cpp:937
STDMETHOD() QueryService(REFGUID guidService, REFIID riid, void **ppvObject) override
Definition: CBandSite.cpp:947
STDMETHOD() GetSizeMax(ULARGE_INTEGER *pcbSize) override
Definition: CBandSite.cpp:972
STDMETHOD() IsDirty() override
Definition: CBandSite.cpp:957
STDMETHOD() QueryBand(DWORD dwBandID, IDeskBand **ppstb, DWORD *pdwState, LPWSTR pszName, int cchName) override
Definition: CBandSite.cpp:588
DWORD _GetViewMode()
Definition: CBandSite.cpp:77
STDMETHOD() OnFocusChangeIS(struct IUnknown *paramC, int param10) override
Definition: CBandSite.cpp:942
STDMETHOD() DragEnter(IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect) override
Definition: CBandSite.cpp:977
DWORD m_dwStyle
Definition: CBandSite.h:58
CComPtr< IOleWindow > m_site
Definition: CBandSite.h:56
STDMETHOD() DragLeave() override
Definition: CBandSite.cpp:988
STDMETHOD() GetClassID(CLSID *pClassID) override
Definition: CBandSite.cpp:952
STDMETHOD() OnWinEvent(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *theResult) override
Definition: CBandSite.cpp:705
STDMETHOD() SetModeDBC(DWORD dwMode) override
Definition: CBandSite.cpp:834
STDMETHOD() UIActivateIO(BOOL fActivate, LPMSG lpMsg) override
Definition: CBandSite.cpp:927
STDMETHOD() AddBand(IUnknown *punk) override
Definition: CBandSite.cpp:402
struct BandObject * _GetBandFromHwnd(HWND hwnd)
Definition: CBandSite.cpp:357
STDMETHOD() Load(IStream *pStm) override
Definition: CBandSite.cpp:962
struct BandObject * m_bands
Definition: CBandSite.h:54
LONG m_cBands
Definition: CBandSite.h:52
STDMETHOD() GetSize(DWORD dwWhich, LPRECT prc) override
Definition: CBandSite.cpp:871
void _FreeBand(struct BandObject *Band)
Definition: CBandSite.cpp:65
STDMETHOD() Save(IStream *pStm, BOOL fClearDirty) override
Definition: CBandSite.cpp:967
STDMETHOD() IsWindowOwner(HWND hWnd) override
Definition: CBandSite.cpp:761
STDMETHOD() UIActivateDBC(DWORD dwState) override
Definition: CBandSite.cpp:859
LONG m_cBandsAllocated
Definition: CBandSite.h:53
HRESULT _OnContextMenu(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *plrResult)
Definition: CBandSite.cpp:258
STDMETHOD() EnumBands(UINT uBand, DWORD *pdwBandID) override
Definition: CBandSite.cpp:559
STDMETHOD() DragOver(DWORD grfKeyState, POINTL pt, DWORD *pdwEffect) override
Definition: CBandSite.cpp:983
DWORD m_dwState
Definition: CBandSite.h:57
STDMETHOD() RemoveBand(DWORD dwBandID) override
Definition: CBandSite.cpp:633
STDMETHOD() ContextSensitiveHelp(BOOL fEnterMode) override
Definition: CBandSite.cpp:788
STDMETHOD() SetDeskBarSite(IUnknown *punkSite) override
Definition: CBandSite.cpp:794
STDMETHOD() QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText) override
Definition: CBandSite.cpp:877
STDMETHOD() GetWindow(HWND *lphwnd) override
Definition: CBandSite.cpp:777
STDMETHOD() HasFocusIO() override
Definition: CBandSite.cpp:932
HWND m_hwndRebar
Definition: CBandSite.h:55
HRESULT _UpdateAllBands()
Definition: CBandSite.cpp:212
struct BandObject * _GetBandByID(DWORD dwBandID)
Definition: CBandSite.cpp:54
STDMETHOD() SetBandSiteInfo(const BANDSITEINFO *pbsinfo) override
Definition: CBandSite.cpp:678
HRESULT _UpdateBand(struct BandObject *Band)
Definition: CBandSite.cpp:172
STDMETHOD() GetBandSiteInfo(BANDSITEINFO *pbsinfo) override
Definition: CBandSite.cpp:692
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define NULL
Definition: types.h:112
#define IDR_BANDSITE
Definition: resource.h:94
#define pt(x, y)
Definition: drawing.c:79
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define BEGIN_COM_MAP(x)
Definition: atlcom.h:581
#define COM_INTERFACE_ENTRY_IID(iid, x)
Definition: atlcom.h:601
#define DECLARE_PROTECT_FINAL_CONSTRUCT()
Definition: atlcom.h:679
#define DECLARE_AGGREGATABLE(x)
Definition: atlcom.h:655
#define DECLARE_REGISTRY_RESOURCEID(x)
Definition: atlcom.h:645
#define END_COM_MAP()
Definition: atlcom.h:592
unsigned int UINT
Definition: ndis.h:50
_Out_ LPRECT prc
Definition: ntgdi.h:1658
const GUID IID_IOleWindow
long LONG
Definition: pedump.c:60
const GUID IID_IPersist
Definition: proxy.cpp:14
const GUID IID_IPersistStream
Definition: proxy.cpp:13
#define REFIID
Definition: guiddef.h:118
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
IOleWindow * OleWindow
Definition: CBandSite.h:46
IWinEventHandler * WndEvtHandler
Definition: CBandSite.h:47
Definition: scsiwmi.h:51
uint32_t ULONG
Definition: typedefs.h:59
_In_ PSID _Out_writes_to_opt_ cchName LPSTR _Inout_ LPDWORD cchName
Definition: winbase.h:2767
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
WCHAR * LPWSTR
Definition: xmlstorage.h:184