ReactOS  0.4.15-dev-1397-g19779b3
brandband.h
Go to the documentation of this file.
1 /*
2  * ReactOS Explorer
3  *
4  * Copyright 2009 Andrew Hill <ash77@reactos.org>
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  */
20 
21 #pragma once
22 
23 class CBrandBand :
24  public CWindowImpl<CBrandBand, CWindow, CControlWinTraits>,
25  public CComCoClass<CBrandBand, &CLSID_BrandBand>,
26  public CComObjectRootEx<CComMultiThreadModelNoCS>,
27  public IDeskBand,
28  public IObjectWithSite,
29  public IInputObject,
30  public IPersistStream,
31  public IOleCommandTarget,
32  public IServiceProvider,
33  public IWinEventHandler,
34  public IDispatch
35 {
36 private:
37  CComPtr<IDockingWindowSite> fSite;
44 public:
45  CBrandBand();
46  ~CBrandBand();
47  void StartAnimation();
48  void StopAnimation();
49  void SelectImage();
50 public:
51  // *** IDeskBand methods ***
52  virtual HRESULT STDMETHODCALLTYPE GetBandInfo(DWORD dwBandID, DWORD dwViewMode, DESKBANDINFO* pdbi);
53 
54  // *** IObjectWithSite methods ***
55  virtual HRESULT STDMETHODCALLTYPE SetSite(IUnknown* pUnkSite);
56  virtual HRESULT STDMETHODCALLTYPE GetSite(REFIID riid, void **ppvSite);
57 
58  // *** IOleWindow methods ***
59  virtual HRESULT STDMETHODCALLTYPE GetWindow(HWND *lphwnd);
61 
62  // *** IDockingWindow methods ***
64  virtual HRESULT STDMETHODCALLTYPE ResizeBorderDW(const RECT* prcBorder, IUnknown* punkToolbarSite, BOOL fReserved);
65  virtual HRESULT STDMETHODCALLTYPE ShowDW(BOOL fShow);
66 
67  // *** IInputObject methods ***
70  virtual HRESULT STDMETHODCALLTYPE UIActivateIO(BOOL fActivate, LPMSG lpMsg);
71 
72  // *** IPersist methods ***
73  virtual HRESULT STDMETHODCALLTYPE GetClassID(CLSID *pClassID);
74 
75  // *** IPersistStream methods ***
77  virtual HRESULT STDMETHODCALLTYPE Load(IStream *pStm);
78  virtual HRESULT STDMETHODCALLTYPE Save(IStream *pStm, BOOL fClearDirty);
80 
81  // *** IWinEventHandler methods ***
84 
85  // *** IOleCommandTarget methods ***
86  virtual HRESULT STDMETHODCALLTYPE QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[ ], OLECMDTEXT *pCmdText);
87  virtual HRESULT STDMETHODCALLTYPE Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut);
88 
89  // *** IServiceProvider methods ***
90  virtual HRESULT STDMETHODCALLTYPE QueryService(REFGUID guidService, REFIID riid, void **ppvObject);
91 
92  // *** IDispatch methods ***
94  virtual HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo);
95  virtual HRESULT STDMETHODCALLTYPE GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId);
96  virtual HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr);
97 
98  // message handlers
99  LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
100  LRESULT OnEraseBkgnd(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
101  LRESULT OnPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
102  LRESULT OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
103 
105  // MESSAGE_HANDLER(WM_SIZE, OnSize)
109  END_MSG_MAP()
110 
113 
115 
117  COM_INTERFACE_ENTRY_IID(IID_IDeskBand, IDeskBand)
120  COM_INTERFACE_ENTRY_IID(IID_IDockingWindow, IDockingWindow)
121  COM_INTERFACE_ENTRY_IID(IID_IInputObject, IInputObject)
124  COM_INTERFACE_ENTRY_IID(IID_IWinEventHandler, IWinEventHandler)
125  COM_INTERFACE_ENTRY_IID(IID_IOleCommandTarget, IOleCommandTarget)
126  COM_INTERFACE_ENTRY_IID(IID_IServiceProvider, IServiceProvider)
128  END_COM_MAP()
129 };
DBIM_BKCOLOR struct tagDESKBANDINFO DESKBANDINFO
CComPtr< IDockingWindowSite > fSite
Definition: brandband.h:37
virtual HRESULT STDMETHODCALLTYPE QueryService(REFGUID guidService, REFIID riid, void **ppvObject)
Definition: brandband.cpp:338
#define REFIID
Definition: guiddef.h:118
DWORD fProfferCookie
Definition: brandband.h:38
Definition: scsiwmi.h:51
LRESULT OnPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: brandband.cpp:395
REFIID riid
Definition: precomp.h:44
const GUID IID_IPersist
Definition: proxy.cpp:14
HBITMAP fImageBitmap
Definition: brandband.h:41
HWND hWnd
Definition: settings.c:17
#define DECLARE_NOT_AGGREGATABLE(x)
Definition: atlcom.h:611
void SelectImage()
Definition: brandband.cpp:81
DWORD LCID
Definition: nls.h:13
UINT_PTR WPARAM
Definition: windef.h:207
static LPOLESTR
Definition: stg_prop.c:27
WPARAM wParam
Definition: combotst.c:138
virtual HRESULT STDMETHODCALLTYPE GetSizeMax(ULARGE_INTEGER *pcbSize)
Definition: brandband.cpp:293
virtual HRESULT STDMETHODCALLTYPE HasFocusIO()
Definition: brandband.cpp:253
virtual HRESULT STDMETHODCALLTYPE ShowDW(BOOL fShow)
Definition: brandband.cpp:241
int fMaxFrameCount
Definition: brandband.h:40
void StopAnimation()
Definition: brandband.cpp:74
virtual HRESULT STDMETHODCALLTYPE TranslateAcceleratorIO(LPMSG lpMsg)
Definition: brandband.cpp:260
virtual HRESULT STDMETHODCALLTYPE UIActivateIO(BOOL fActivate, LPMSG lpMsg)
Definition: brandband.cpp:265
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:90
unsigned int BOOL
Definition: ntddk_ex.h:94
virtual HRESULT STDMETHODCALLTYPE Save(IStream *pStm, BOOL fClearDirty)
Definition: brandband.cpp:288
virtual HRESULT STDMETHODCALLTYPE Load(IStream *pStm)
Definition: brandband.cpp:283
LONG_PTR LPARAM
Definition: windef.h:208
virtual HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: brandband.cpp:367
virtual HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: brandband.cpp:356
LRESULT OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: brandband.cpp:449
#define BEGIN_COM_MAP(x)
Definition: atlcom.h:541
virtual HRESULT STDMETHODCALLTYPE GetWindow(HWND *lphwnd)
Definition: brandband.cpp:210
virtual HRESULT STDMETHODCALLTYPE CloseDW(DWORD dwReserved)
Definition: brandband.cpp:223
virtual HRESULT STDMETHODCALLTYPE QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText)
Definition: brandband.cpp:311
LONG HRESULT
Definition: typedefs.h:79
#define END_MSG_MAP()
Definition: atlwin.h:1799
DWORD fAdviseCookie
Definition: brandband.h:43
#define WM_TIMER
Definition: winuser.h:1724
void StartAnimation()
Definition: brandband.cpp:68
virtual HRESULT STDMETHODCALLTYPE OnWinEvent(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *theResult)
Definition: brandband.cpp:298
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
const IID IID_IObjectWithSite
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
int fBitmapSize
Definition: brandband.h:42
int fCurrentFrame
Definition: brandband.h:39
const GUID IID_IPersistStream
Definition: proxy.cpp:13
#define WM_PAINT
Definition: winuser.h:1602
const GUID IID_IDispatch
REFIID LPVOID * ppvObject
Definition: precomp.h:44
#define DECLARE_REGISTRY_RESOURCEID(x)
Definition: atlcom.h:605
virtual HRESULT STDMETHODCALLTYPE GetTypeInfoCount(UINT *pctinfo)
Definition: brandband.cpp:351
virtual HRESULT STDMETHODCALLTYPE ResizeBorderDW(const RECT *prcBorder, IUnknown *punkToolbarSite, BOOL fReserved)
Definition: brandband.cpp:235
virtual HRESULT STDMETHODCALLTYPE GetSite(REFIID riid, void **ppvSite)
Definition: brandband.cpp:198
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:534
struct stdole::EXCEPINFO EXCEPINFO
static VARIANTARG static DISPID
Definition: ordinal.c:49
virtual HRESULT STDMETHODCALLTYPE ContextSensitiveHelp(BOOL fEnterMode)
Definition: brandband.cpp:218
#define COM_INTERFACE_ENTRY_IID(iid, x)
Definition: atlcom.h:561
virtual HRESULT STDMETHODCALLTYPE SetSite(IUnknown *pUnkSite)
Definition: brandband.cpp:141
unsigned int UINT
Definition: ndis.h:50
virtual HRESULT STDMETHODCALLTYPE Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
Definition: brandband.cpp:317
LRESULT OnEraseBkgnd(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: brandband.cpp:390
#define BEGIN_MSG_MAP(theClass)
Definition: atlwin.h:1780
#define DECLARE_PROTECT_FINAL_CONSTRUCT()
Definition: atlcom.h:639
#define MESSAGE_HANDLER(msg, func)
Definition: atlwin.h:1808
LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: brandband.cpp:384
struct stdole::DISPPARAMS DISPPARAMS
const GUID IID_IOleWindow
unsigned int ULONG
Definition: retypes.h:1
static HBITMAP
Definition: button.c:44
#define IDR_BRANDBAND
Definition: resource.h:96
virtual HRESULT STDMETHODCALLTYPE GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: brandband.cpp:361
#define END_COM_MAP()
Definition: atlcom.h:552
#define WM_ERASEBKGND
Definition: winuser.h:1607
LONG_PTR LRESULT
Definition: windef.h:209
virtual HRESULT STDMETHODCALLTYPE IsWindowOwner(HWND hWnd)
Definition: brandband.cpp:304
virtual HRESULT STDMETHODCALLTYPE GetBandInfo(DWORD dwBandID, DWORD dwViewMode, DESKBANDINFO *pdbi)
Definition: brandband.cpp:110
virtual HRESULT STDMETHODCALLTYPE IsDirty()
Definition: brandband.cpp:278
virtual HRESULT STDMETHODCALLTYPE GetClassID(CLSID *pClassID)
Definition: brandband.cpp:270
LPARAM lParam
Definition: combotst.c:139