mirror of
https://github.com/reactos/reactos.git
synced 2024-12-29 10:35:28 +00:00
bb297bc351
For simplicity and short typing. JIRA issue: CORE-19469 - Replace "virtual HRESULT STDMETHODCALLTYPE m" with "STDMETHOD(m)" (m is a method name). - Replace "virtual t STDMETHODCALLTYPE m" with "STDMETHOD_(t, m)" (t is a type. m is a method name). - Use "override" keyword as possible.
129 lines
5.4 KiB
C++
129 lines
5.4 KiB
C++
/*
|
|
* ReactOS Explorer
|
|
*
|
|
* Copyright 2009 Andrew Hill <ash77@reactos.org>
|
|
*
|
|
* This library is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
* License as published by the Free Software Foundation; either
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
*
|
|
* This library is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
* License along with this library; if not, write to the Free Software
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
class CBrandBand :
|
|
public CWindowImpl<CBrandBand, CWindow, CControlWinTraits>,
|
|
public CComCoClass<CBrandBand, &CLSID_BrandBand>,
|
|
public CComObjectRootEx<CComMultiThreadModelNoCS>,
|
|
public IDeskBand,
|
|
public IObjectWithSite,
|
|
public IInputObject,
|
|
public IPersistStream,
|
|
public IOleCommandTarget,
|
|
public IServiceProvider,
|
|
public IWinEventHandler,
|
|
public IDispatch
|
|
{
|
|
private:
|
|
CComPtr<IDockingWindowSite> fSite;
|
|
DWORD fProfferCookie;
|
|
int fCurrentFrame;
|
|
int fMaxFrameCount;
|
|
HBITMAP fImageBitmap;
|
|
int fBitmapSize;
|
|
DWORD fAdviseCookie;
|
|
public:
|
|
CBrandBand();
|
|
~CBrandBand();
|
|
void StartAnimation();
|
|
void StopAnimation();
|
|
void SelectImage();
|
|
public:
|
|
// *** IDeskBand methods ***
|
|
STDMETHOD(GetBandInfo)(DWORD dwBandID, DWORD dwViewMode, DESKBANDINFO* pdbi) override;
|
|
|
|
// *** IObjectWithSite methods ***
|
|
STDMETHOD(SetSite)(IUnknown* pUnkSite) override;
|
|
STDMETHOD(GetSite)(REFIID riid, void **ppvSite) override;
|
|
|
|
// *** IOleWindow methods ***
|
|
STDMETHOD(GetWindow)(HWND *lphwnd) override;
|
|
STDMETHOD(ContextSensitiveHelp)(BOOL fEnterMode) override;
|
|
|
|
// *** IDockingWindow methods ***
|
|
STDMETHOD(CloseDW)(DWORD dwReserved) override;
|
|
STDMETHOD(ResizeBorderDW)(const RECT* prcBorder, IUnknown* punkToolbarSite, BOOL fReserved) override;
|
|
STDMETHOD(ShowDW)(BOOL fShow) override;
|
|
|
|
// *** IInputObject methods ***
|
|
STDMETHOD(HasFocusIO)() override;
|
|
STDMETHOD(TranslateAcceleratorIO)(LPMSG lpMsg) override;
|
|
STDMETHOD(UIActivateIO)(BOOL fActivate, LPMSG lpMsg) override;
|
|
|
|
// *** IPersist methods ***
|
|
STDMETHOD(GetClassID)(CLSID *pClassID) override;
|
|
|
|
// *** IPersistStream methods ***
|
|
STDMETHOD(IsDirty)() override;
|
|
STDMETHOD(Load)(IStream *pStm) override;
|
|
STDMETHOD(Save)(IStream *pStm, BOOL fClearDirty) override;
|
|
STDMETHOD(GetSizeMax)(ULARGE_INTEGER *pcbSize) override;
|
|
|
|
// *** IWinEventHandler methods ***
|
|
STDMETHOD(OnWinEvent)(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *theResult) override;
|
|
STDMETHOD(IsWindowOwner)(HWND hWnd) override;
|
|
|
|
// *** IOleCommandTarget methods ***
|
|
STDMETHOD(QueryStatus)(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[ ], OLECMDTEXT *pCmdText) override;
|
|
STDMETHOD(Exec)(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut) override;
|
|
|
|
// *** IServiceProvider methods ***
|
|
STDMETHOD(QueryService)(REFGUID guidService, REFIID riid, void **ppvObject) override;
|
|
|
|
// *** IDispatch methods ***
|
|
STDMETHOD(GetTypeInfoCount)(UINT *pctinfo) override;
|
|
STDMETHOD(GetTypeInfo)(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) override;
|
|
STDMETHOD(GetIDsOfNames)(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) override;
|
|
STDMETHOD(Invoke)(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) override;
|
|
|
|
// message handlers
|
|
LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
|
|
LRESULT OnEraseBkgnd(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
|
|
LRESULT OnPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
|
|
LRESULT OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
|
|
|
|
BEGIN_MSG_MAP(CBrandBand)
|
|
// MESSAGE_HANDLER(WM_SIZE, OnSize)
|
|
MESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBkgnd)
|
|
MESSAGE_HANDLER(WM_PAINT, OnPaint)
|
|
MESSAGE_HANDLER(WM_TIMER, OnTimer)
|
|
END_MSG_MAP()
|
|
|
|
DECLARE_REGISTRY_RESOURCEID(IDR_BRANDBAND)
|
|
DECLARE_NOT_AGGREGATABLE(CBrandBand)
|
|
|
|
DECLARE_PROTECT_FINAL_CONSTRUCT()
|
|
|
|
BEGIN_COM_MAP(CBrandBand)
|
|
COM_INTERFACE_ENTRY_IID(IID_IDeskBand, IDeskBand)
|
|
COM_INTERFACE_ENTRY_IID(IID_IObjectWithSite, IObjectWithSite)
|
|
COM_INTERFACE_ENTRY_IID(IID_IOleWindow, IOleWindow)
|
|
COM_INTERFACE_ENTRY_IID(IID_IDockingWindow, IDockingWindow)
|
|
COM_INTERFACE_ENTRY_IID(IID_IInputObject, IInputObject)
|
|
COM_INTERFACE_ENTRY_IID(IID_IPersist, IPersist)
|
|
COM_INTERFACE_ENTRY_IID(IID_IPersistStream, IPersistStream)
|
|
COM_INTERFACE_ENTRY_IID(IID_IWinEventHandler, IWinEventHandler)
|
|
COM_INTERFACE_ENTRY_IID(IID_IOleCommandTarget, IOleCommandTarget)
|
|
COM_INTERFACE_ENTRY_IID(IID_IServiceProvider, IServiceProvider)
|
|
COM_INTERFACE_ENTRY_IID(IID_IDispatch, IDispatch)
|
|
END_COM_MAP()
|
|
};
|