[QCKLNCH] Implement the quick launch shell extension including the CISFBand
[reactos.git] / dll / shellext / qcklnch / CISFBand.h
1 /*
2 * PROJECT: ReactOS shell extensions
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: dll/shellext/qcklnch/CISFBand.h
5 * PURPOSE: Quick Launch Toolbar (Taskbar Shell Extension)
6 * PROGRAMMERS: Shriraj Sawant a.k.a SR13 <sr.official@hotmail.com>
7 */
8 #pragma once
9
10 // COM class for cisfband
11 class CISFBand :
12 public CWindow,
13 public CComCoClass<CISFBand>,
14 public CComObjectRootEx<CComMultiThreadModelNoCS>,
15 public IObjectWithSite,
16 public IDeskBand,
17 public IPersistStream,
18 public IWinEventHandler,
19 public IOleCommandTarget,
20 public IShellFolderBand,
21 public IContextMenu
22 {
23 // Band
24 DWORD m_BandID;
25 CComPtr<IUnknown> m_Site;
26
27 // Toolbar
28 CComPtr<IShellFolder> m_pISF;
29 PCIDLIST_ABSOLUTE m_pidl;
30
31 // Menu
32 BOOL m_textFlag;
33 BOOL m_iconFlag;
34
35 public:
36
37 CISFBand();
38 virtual ~CISFBand();
39
40 // Personal Methods
41 HRESULT CreateSimpleToolbar(HWND hWndParent);
42
43 // IObjectWithSite
44
45 virtual STDMETHODIMP GetSite(
46 IN REFIID riid,
47 OUT void **ppvSite
48 );
49
50 virtual STDMETHODIMP SetSite(
51 IN IUnknown *pUnkSite
52 );
53
54 // IDeskBand
55
56 virtual STDMETHODIMP GetWindow(
57 OUT HWND *phwnd
58 );
59
60 virtual STDMETHODIMP ContextSensitiveHelp(
61 IN BOOL fEnterMode
62 );
63
64 virtual STDMETHODIMP ShowDW(
65 IN BOOL bShow
66 );
67
68 virtual STDMETHODIMP CloseDW(
69 IN DWORD dwReserved
70 );
71
72 virtual STDMETHODIMP ResizeBorderDW(
73 LPCRECT prcBorder,
74 IUnknown *punkToolbarSite,
75 BOOL fReserved
76 );
77
78 virtual STDMETHODIMP GetBandInfo(
79 IN DWORD dwBandID,
80 IN DWORD dwViewMode,
81 IN OUT DESKBANDINFO *pdbi
82 );
83
84 // IPersistStream
85
86 virtual STDMETHODIMP GetClassID(
87 OUT CLSID *pClassID
88 );
89
90 virtual STDMETHODIMP GetSizeMax(
91 OUT ULARGE_INTEGER *pcbSize
92 );
93
94 virtual STDMETHODIMP IsDirty();
95
96 virtual STDMETHODIMP Load(
97 IN IStream *pStm
98 );
99
100 virtual STDMETHODIMP Save(
101 IN IStream *pStm,
102 IN BOOL fClearDirty
103 );
104
105 // IWinEventHandler
106
107 virtual STDMETHODIMP ContainsWindow(
108 IN HWND hWnd
109 );
110
111 virtual STDMETHODIMP OnWinEvent(
112 HWND hWnd,
113 UINT uMsg,
114 WPARAM wParam,
115 LPARAM lParam,
116 LRESULT *theResult
117 );
118
119 virtual STDMETHODIMP IsWindowOwner(
120 HWND hWnd
121 );
122
123 // IOleCommandTarget
124
125 virtual STDMETHODIMP Exec(
126 IN const GUID *pguidCmdGroup,
127 IN DWORD nCmdID,
128 IN DWORD nCmdexecopt,
129 IN VARIANT *pvaIn,
130 IN OUT VARIANT *pvaOut
131 );
132
133 virtual STDMETHODIMP QueryStatus(
134 IN const GUID *pguidCmdGroup,
135 IN ULONG cCmds,
136 IN OUT OLECMD prgCmds[],
137 IN OUT OLECMDTEXT *pCmdText
138 );
139
140 // IShellFolderBand
141 virtual STDMETHODIMP GetBandInfoSFB(
142 PBANDINFOSFB pbi
143 );
144
145 virtual STDMETHODIMP InitializeSFB(
146 IShellFolder *psf,
147 PCIDLIST_ABSOLUTE pidl
148 );
149
150 virtual STDMETHODIMP SetBandInfoSFB(
151 PBANDINFOSFB pbi
152 );
153
154 // IContextMenu
155 virtual STDMETHODIMP GetCommandString(
156 UINT_PTR idCmd,
157 UINT uFlags,
158 UINT *pwReserved,
159 LPSTR pszName,
160 UINT cchMax
161 );
162
163 virtual STDMETHODIMP InvokeCommand(
164 LPCMINVOKECOMMANDINFO pici
165 );
166
167 virtual STDMETHODIMP QueryContextMenu(
168 HMENU hmenu,
169 UINT indexMenu,
170 UINT idCmdFirst,
171 UINT idCmdLast,
172 UINT uFlags
173 );
174
175 //*****************************************************************************************************
176
177 DECLARE_NOT_AGGREGATABLE(CISFBand)
178 DECLARE_PROTECT_FINAL_CONSTRUCT()
179
180 BEGIN_COM_MAP(CISFBand)
181 COM_INTERFACE_ENTRY2_IID(IID_IOleWindow, IOleWindow, IDeskBand)
182 COM_INTERFACE_ENTRY2_IID(IID_IDockingWindow, IDockingWindow, IDeskBand)
183 COM_INTERFACE_ENTRY_IID(IID_IDeskBand, IDeskBand)
184 COM_INTERFACE_ENTRY_IID(IID_IObjectWithSite, IObjectWithSite)
185 COM_INTERFACE_ENTRY_IID(IID_IPersist, IPersist)
186 COM_INTERFACE_ENTRY_IID(IID_IPersistStream, IPersistStream)
187 COM_INTERFACE_ENTRY_IID(IID_IWinEventHandler, IWinEventHandler)
188 COM_INTERFACE_ENTRY_IID(IID_IOleCommandTarget, IOleCommandTarget)
189 COM_INTERFACE_ENTRY_IID(IID_IShellFolderBand, IShellFolderBand)
190 COM_INTERFACE_ENTRY_IID(IID_IContextMenu, IContextMenu)
191 END_COM_MAP()
192 };
193
194 // C Constructor
195 extern "C"
196 HRESULT WINAPI CISFBand_CreateInstance(REFIID riid, void** ppv);