ReactOS 0.4.15-dev-5666-gc548b97
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 ***
65 virtual HRESULT STDMETHODCALLTYPE EnumBands(UINT uBand, DWORD *pdwBandID);
66 virtual HRESULT STDMETHODCALLTYPE QueryBand(DWORD dwBandID, IDeskBand **ppstb, DWORD *pdwState, LPWSTR pszName, int cchName);
67 virtual HRESULT STDMETHODCALLTYPE SetBandState(DWORD dwBandID, DWORD dwMask, DWORD dwState);
68 virtual HRESULT STDMETHODCALLTYPE RemoveBand(DWORD dwBandID);
69 virtual HRESULT STDMETHODCALLTYPE GetBandObject(DWORD dwBandID, REFIID riid, void **ppv);
72
73 // *** IWinEventHandler methods ***
76
77 // *** IOleWindow methods ***
78 virtual HRESULT STDMETHODCALLTYPE GetWindow(HWND *lphwnd);
80
81 // *** IDeskBarClient methods ***
86
87 // *** IOleCommandTarget methods ***
88 virtual HRESULT STDMETHODCALLTYPE QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[ ], OLECMDTEXT *pCmdText);
89 virtual HRESULT STDMETHODCALLTYPE Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut);
90
91 // *** IInputObject methods ***
92 virtual HRESULT STDMETHODCALLTYPE UIActivateIO(BOOL fActivate, LPMSG lpMsg);
95
96 // *** IInputObjectSite methods ***
97 virtual HRESULT STDMETHODCALLTYPE OnFocusChangeIS(struct IUnknown *paramC, int param10);
98
99 // *** IServiceProvider methods ***
100 virtual HRESULT STDMETHODCALLTYPE QueryService(REFGUID guidService, REFIID riid, void **ppvObject);
101
102 // *** IPersist methods ***
103 virtual HRESULT STDMETHODCALLTYPE GetClassID(CLSID *pClassID);
104
105 // *** IPersistStream methods ***
107 virtual HRESULT STDMETHODCALLTYPE Load(IStream *pStm);
108 virtual HRESULT STDMETHODCALLTYPE Save(IStream *pStm, BOOL fClearDirty);
110
111 // *** IDropTarget methods ***
112 virtual HRESULT STDMETHODCALLTYPE DragEnter(IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect);
113 virtual HRESULT STDMETHODCALLTYPE DragOver(DWORD grfKeyState, POINTL pt, DWORD *pdwEffect);
115 virtual HRESULT STDMETHODCALLTYPE Drop(IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect);
116
117 // *** IBandSiteHelper methods ***
118 virtual HRESULT STDMETHODCALLTYPE LoadFromStreamBS(IStream *, const GUID &, void **);
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 STDMETHODCALLTYPE
Definition: bdasup.h:9
virtual HRESULT STDMETHODCALLTYPE GetBandSiteInfo(BANDSITEINFO *pbsinfo)
Definition: CBandSite.cpp:692
UINT _GetBandID(struct BandObject *Band)
Definition: CBandSite.cpp:49
HRESULT _IsBandDeletable(DWORD dwBandID)
Definition: CBandSite.cpp:241
VOID _BuildBandInfo(struct BandObject *Band, REBARBANDINFOW *prbi)
Definition: CBandSite.cpp:90
virtual HRESULT STDMETHODCALLTYPE RemoveBand(DWORD dwBandID)
Definition: CBandSite.cpp:633
virtual HRESULT STDMETHODCALLTYPE EnumBands(UINT uBand, DWORD *pdwBandID)
Definition: CBandSite.cpp:559
virtual HRESULT STDMETHODCALLTYPE SaveToStreamBS(IUnknown *, IStream *)
Definition: CBandSite.cpp:1003
virtual HRESULT STDMETHODCALLTYPE GetSize(DWORD dwWhich, LPRECT prc)
Definition: CBandSite.cpp:871
virtual HRESULT STDMETHODCALLTYPE Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
Definition: CBandSite.cpp:884
virtual HRESULT STDMETHODCALLTYPE AddBand(IUnknown *punk)
Definition: CBandSite.cpp:402
virtual HRESULT STDMETHODCALLTYPE DragOver(DWORD grfKeyState, POINTL pt, DWORD *pdwEffect)
Definition: CBandSite.cpp:983
virtual HRESULT STDMETHODCALLTYPE DragEnter(IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect)
Definition: CBandSite.cpp:977
virtual HRESULT STDMETHODCALLTYPE ContextSensitiveHelp(BOOL fEnterMode)
Definition: CBandSite.cpp:788
DWORD _GetViewMode()
Definition: CBandSite.cpp:77
virtual HRESULT STDMETHODCALLTYPE UIActivateDBC(DWORD dwState)
Definition: CBandSite.cpp:859
virtual HRESULT STDMETHODCALLTYPE LoadFromStreamBS(IStream *, const GUID &, void **)
Definition: CBandSite.cpp:998
virtual HRESULT STDMETHODCALLTYPE SetDeskBarSite(IUnknown *punkSite)
Definition: CBandSite.cpp:794
virtual HRESULT STDMETHODCALLTYPE GetClassID(CLSID *pClassID)
Definition: CBandSite.cpp:952
virtual HRESULT STDMETHODCALLTYPE HasFocusIO()
Definition: CBandSite.cpp:932
DWORD m_dwStyle
Definition: CBandSite.h:58
virtual HRESULT STDMETHODCALLTYPE QueryBand(DWORD dwBandID, IDeskBand **ppstb, DWORD *pdwState, LPWSTR pszName, int cchName)
Definition: CBandSite.cpp:588
virtual HRESULT STDMETHODCALLTYPE OnWinEvent(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *theResult)
Definition: CBandSite.cpp:705
CComPtr< IOleWindow > m_site
Definition: CBandSite.h:56
virtual HRESULT STDMETHODCALLTYPE QueryService(REFGUID guidService, REFIID riid, void **ppvObject)
Definition: CBandSite.cpp:947
virtual HRESULT STDMETHODCALLTYPE GetSizeMax(ULARGE_INTEGER *pcbSize)
Definition: CBandSite.cpp:972
struct BandObject * _GetBandFromHwnd(HWND hwnd)
Definition: CBandSite.cpp:357
struct BandObject * m_bands
Definition: CBandSite.h:54
LONG m_cBands
Definition: CBandSite.h:52
virtual HRESULT STDMETHODCALLTYPE SetBandState(DWORD dwBandID, DWORD dwMask, DWORD dwState)
Definition: CBandSite.cpp:619
virtual HRESULT STDMETHODCALLTYPE Save(IStream *pStm, BOOL fClearDirty)
Definition: CBandSite.cpp:967
virtual HRESULT STDMETHODCALLTYPE GetBandObject(DWORD dwBandID, REFIID riid, void **ppv)
Definition: CBandSite.cpp:662
void _FreeBand(struct BandObject *Band)
Definition: CBandSite.cpp:65
virtual HRESULT STDMETHODCALLTYPE DragLeave()
Definition: CBandSite.cpp:988
LONG m_cBandsAllocated
Definition: CBandSite.h:53
HRESULT _OnContextMenu(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *plrResult)
Definition: CBandSite.cpp:258
DWORD m_dwState
Definition: CBandSite.h:57
virtual HRESULT STDMETHODCALLTYPE IsDirty()
Definition: CBandSite.cpp:957
virtual HRESULT STDMETHODCALLTYPE TranslateAcceleratorIO(LPMSG lpMsg)
Definition: CBandSite.cpp:937
virtual HRESULT STDMETHODCALLTYPE IsWindowOwner(HWND hWnd)
Definition: CBandSite.cpp:761
virtual HRESULT STDMETHODCALLTYPE Drop(IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect)
Definition: CBandSite.cpp:993
virtual HRESULT STDMETHODCALLTYPE OnFocusChangeIS(struct IUnknown *paramC, int param10)
Definition: CBandSite.cpp:942
virtual HRESULT STDMETHODCALLTYPE Load(IStream *pStm)
Definition: CBandSite.cpp:962
virtual HRESULT STDMETHODCALLTYPE SetModeDBC(DWORD dwMode)
Definition: CBandSite.cpp:834
HWND m_hwndRebar
Definition: CBandSite.h:55
virtual HRESULT STDMETHODCALLTYPE UIActivateIO(BOOL fActivate, LPMSG lpMsg)
Definition: CBandSite.cpp:927
HRESULT _UpdateAllBands()
Definition: CBandSite.cpp:212
virtual HRESULT STDMETHODCALLTYPE QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText)
Definition: CBandSite.cpp:877
struct BandObject * _GetBandByID(DWORD dwBandID)
Definition: CBandSite.cpp:54
HRESULT _UpdateBand(struct BandObject *Band)
Definition: CBandSite.cpp:172
virtual HRESULT STDMETHODCALLTYPE GetWindow(HWND *lphwnd)
Definition: CBandSite.cpp:777
virtual HRESULT STDMETHODCALLTYPE SetBandSiteInfo(const BANDSITEINFO *pbsinfo)
Definition: CBandSite.cpp:678
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:542
#define COM_INTERFACE_ENTRY_IID(iid, x)
Definition: atlcom.h:562
#define DECLARE_PROTECT_FINAL_CONSTRUCT()
Definition: atlcom.h:640
#define DECLARE_AGGREGATABLE(x)
Definition: atlcom.h:616
#define DECLARE_REGISTRY_RESOURCEID(x)
Definition: atlcom.h:606
#define END_COM_MAP()
Definition: atlcom.h:553
unsigned int ULONG
Definition: retypes.h:1
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
_In_ PSID _Out_writes_to_opt_ cchName LPSTR _Inout_ LPDWORD cchName
Definition: winbase.h:2754
_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