|
1 /**************************************************************************** |
|
2 ** |
|
3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
4 ** All rights reserved. |
|
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
|
6 ** |
|
7 ** This file is part of the Qt Mobility Components. |
|
8 ** |
|
9 ** $QT_BEGIN_LICENSE:LGPL$ |
|
10 ** No Commercial Usage |
|
11 ** This file contains pre-release code and may not be distributed. |
|
12 ** You may use this file in accordance with the terms and conditions |
|
13 ** contained in the Technology Preview License Agreement accompanying |
|
14 ** this package. |
|
15 ** |
|
16 ** GNU Lesser General Public License Usage |
|
17 ** Alternatively, this file may be used under the terms of the GNU Lesser |
|
18 ** General Public License version 2.1 as published by the Free Software |
|
19 ** Foundation and appearing in the file LICENSE.LGPL included in the |
|
20 ** packaging of this file. Please review the following information to |
|
21 ** ensure the GNU Lesser General Public License version 2.1 requirements |
|
22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
|
23 ** |
|
24 ** In addition, as a special exception, Nokia gives you certain additional |
|
25 ** rights. These rights are described in the Nokia Qt LGPL Exception |
|
26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
|
27 ** |
|
28 ** If you have questions regarding the use of this file, please contact |
|
29 ** Nokia at qt-info@nokia.com. |
|
30 ** |
|
31 ** |
|
32 ** |
|
33 ** |
|
34 ** |
|
35 ** |
|
36 ** |
|
37 ** |
|
38 ** $QT_END_LICENSE$ |
|
39 ** |
|
40 ****************************************************************************/ |
|
41 |
|
42 #ifndef QWMPEVENTS_H |
|
43 #define QWMPEVENTS_H |
|
44 |
|
45 #include <QtCore/qobject.h> |
|
46 |
|
47 #include <wmp.h> |
|
48 |
|
49 class QWmpEvents : public QObject, public IWMPEvents3 |
|
50 { |
|
51 Q_OBJECT |
|
52 public: |
|
53 QWmpEvents(IUnknown *source, QObject *parent = 0); |
|
54 ~QWmpEvents(); |
|
55 |
|
56 // IUnknown |
|
57 HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppvObject); |
|
58 ULONG STDMETHODCALLTYPE AddRef(); |
|
59 ULONG STDMETHODCALLTYPE Release(); |
|
60 |
|
61 Q_SIGNALS: |
|
62 |
|
63 #ifndef Q_MOC_RUN |
|
64 // IWMPEvents |
|
65 void STDMETHODCALLTYPE OpenStateChange(long NewState); |
|
66 void STDMETHODCALLTYPE PlayStateChange(long NewState); |
|
67 void STDMETHODCALLTYPE AudioLanguageChange(long LangID); |
|
68 void STDMETHODCALLTYPE StatusChange(); |
|
69 void STDMETHODCALLTYPE ScriptCommand(BSTR scType, BSTR Param); |
|
70 void STDMETHODCALLTYPE NewStream(); |
|
71 void STDMETHODCALLTYPE Disconnect(long Result); |
|
72 void STDMETHODCALLTYPE Buffering(VARIANT_BOOL Start); |
|
73 void STDMETHODCALLTYPE Error(); |
|
74 void STDMETHODCALLTYPE Warning(long WarningType, long Param, BSTR Description); |
|
75 void STDMETHODCALLTYPE EndOfStream(long Result); |
|
76 void STDMETHODCALLTYPE PositionChange(double oldPosition, double newPosition); |
|
77 void STDMETHODCALLTYPE MarkerHit(long MarkerNum); |
|
78 void STDMETHODCALLTYPE DurationUnitChange(long NewDurationUnit); |
|
79 void STDMETHODCALLTYPE CdromMediaChange(long CdromNum); |
|
80 void STDMETHODCALLTYPE PlaylistChange(IDispatch *Playlist, WMPPlaylistChangeEventType change); |
|
81 void STDMETHODCALLTYPE CurrentPlaylistChange(WMPPlaylistChangeEventType change); |
|
82 void STDMETHODCALLTYPE CurrentPlaylistItemAvailable(BSTR bstrItemName); |
|
83 void STDMETHODCALLTYPE MediaChange(IDispatch *Item); |
|
84 void STDMETHODCALLTYPE CurrentMediaItemAvailable(BSTR bstrItemName); |
|
85 void STDMETHODCALLTYPE CurrentItemChange(IDispatch *pdispMedia); |
|
86 void STDMETHODCALLTYPE MediaCollectionChange(); |
|
87 void STDMETHODCALLTYPE MediaCollectionAttributeStringAdded( |
|
88 BSTR bstrAttribName, BSTR bstrAttribVal); |
|
89 void STDMETHODCALLTYPE MediaCollectionAttributeStringRemoved( |
|
90 BSTR bstrAttribName, BSTR bstrAttribVal); |
|
91 void STDMETHODCALLTYPE MediaCollectionAttributeStringChanged( |
|
92 BSTR bstrAttribName, BSTR bstrOldAttribVal, BSTR bstrNewAttribVal); |
|
93 void STDMETHODCALLTYPE PlaylistCollectionChange(); |
|
94 void STDMETHODCALLTYPE PlaylistCollectionPlaylistAdded(BSTR bstrPlaylistName); |
|
95 void STDMETHODCALLTYPE PlaylistCollectionPlaylistRemoved(BSTR bstrPlaylistName); |
|
96 void STDMETHODCALLTYPE PlaylistCollectionPlaylistSetAsDeleted( |
|
97 BSTR bstrPlaylistName, VARIANT_BOOL varfIsDeleted); |
|
98 void STDMETHODCALLTYPE ModeChange(BSTR ModeName, VARIANT_BOOL NewValue); |
|
99 void STDMETHODCALLTYPE MediaError(IDispatch *pMediaObject); |
|
100 void STDMETHODCALLTYPE OpenPlaylistSwitch(IDispatch *pItem); |
|
101 void STDMETHODCALLTYPE DomainChange(BSTR strDomain); |
|
102 void STDMETHODCALLTYPE SwitchedToPlayerApplication(); |
|
103 void STDMETHODCALLTYPE SwitchedToControl(); |
|
104 void STDMETHODCALLTYPE PlayerDockedStateChange(); |
|
105 void STDMETHODCALLTYPE PlayerReconnect(); |
|
106 void STDMETHODCALLTYPE Click(short nButton, short nShiftState, long fX, long fY); |
|
107 void STDMETHODCALLTYPE DoubleClick(short nButton, short nShiftState, long fX, long fY); |
|
108 void STDMETHODCALLTYPE KeyDown(short nKeyCode, short nShiftState); |
|
109 void STDMETHODCALLTYPE KeyPress(short nKeyAscii); |
|
110 void STDMETHODCALLTYPE KeyUp(short nKeyCode, short nShiftState); |
|
111 void STDMETHODCALLTYPE MouseDown(short nButton, short nShiftState, long fX, long fY); |
|
112 void STDMETHODCALLTYPE MouseMove(short nButton, short nShiftState, long fX, long fY); |
|
113 void STDMETHODCALLTYPE MouseUp(short nButton, short nShiftState, long fX, long fY); |
|
114 |
|
115 // IWMPEvents2 |
|
116 void STDMETHODCALLTYPE DeviceConnect(IWMPSyncDevice *pDevice); |
|
117 void STDMETHODCALLTYPE DeviceDisconnect(IWMPSyncDevice *pDevice); |
|
118 void STDMETHODCALLTYPE DeviceStatusChange(IWMPSyncDevice *pDevice, WMPDeviceStatus NewStatus); |
|
119 void STDMETHODCALLTYPE DeviceSyncStateChange(IWMPSyncDevice *pDevice, WMPSyncState NewState); |
|
120 void STDMETHODCALLTYPE DeviceSyncError(IWMPSyncDevice *pDevice, IDispatch *pMedia); |
|
121 void STDMETHODCALLTYPE CreatePartnershipComplete(IWMPSyncDevice *pDevice, HRESULT hrResult); |
|
122 |
|
123 // IWMPEvents3 |
|
124 void STDMETHODCALLTYPE CdromRipStateChange(IWMPCdromRip *pCdromRip, WMPRipState wmprs); |
|
125 void STDMETHODCALLTYPE CdromRipMediaError(IWMPCdromRip *pCdromRip, IDispatch *pMedia); |
|
126 void STDMETHODCALLTYPE CdromBurnStateChange(IWMPCdromBurn *pCdromBurn, WMPBurnState wmpbs); |
|
127 void STDMETHODCALLTYPE CdromBurnMediaError(IWMPCdromBurn *pCdromBurn, IDispatch *pMedia); |
|
128 void STDMETHODCALLTYPE CdromBurnError(IWMPCdromBurn *pCdromBurn, HRESULT hrError); |
|
129 void STDMETHODCALLTYPE LibraryConnect(IWMPLibrary *pLibrary); |
|
130 void STDMETHODCALLTYPE LibraryDisconnect(IWMPLibrary *pLibrary); |
|
131 void STDMETHODCALLTYPE FolderScanStateChange(WMPFolderScanState wmpfss); |
|
132 void STDMETHODCALLTYPE StringCollectionChange( |
|
133 IDispatch *pdispStringCollection, |
|
134 WMPStringCollectionChangeEventType change, |
|
135 long lCollectionIndex); |
|
136 void STDMETHODCALLTYPE MediaCollectionMediaAdded(IDispatch *pdispMedia); |
|
137 void STDMETHODCALLTYPE MediaCollectionMediaRemoved(IDispatch *pdispMedia); |
|
138 #else |
|
139 // Declare again without STDMETHODCALLTYPE for moc's benefit. |
|
140 |
|
141 // IWMPEvents |
|
142 void OpenStateChange(long NewState); |
|
143 void PlayStateChange(long NewState); |
|
144 void AudioLanguageChange(long LangID); |
|
145 void StatusChange(); |
|
146 void ScriptCommand(BSTR scType, BSTR Param); |
|
147 void NewStream(); |
|
148 void Disconnect(long Result); |
|
149 void Buffering(VARIANT_BOOL Start); |
|
150 void Error(); |
|
151 void Warning(long WarningType, long Param, BSTR Description); |
|
152 void EndOfStream(long Result); |
|
153 void PositionChange(double oldPosition, double newPosition); |
|
154 void MarkerHit(long MarkerNum); |
|
155 void DurationUnitChange(long NewDurationUnit); |
|
156 void CdromMediaChange(long CdromNum); |
|
157 void PlaylistChange(IDispatch *Playlist, WMPPlaylistChangeEventType change); |
|
158 void CurrentPlaylistChange(WMPPlaylistChangeEventType change); |
|
159 void CurrentPlaylistItemAvailable(BSTR bstrItemName); |
|
160 void MediaChange(IDispatch *Item); |
|
161 void CurrentMediaItemAvailable(BSTR bstrItemName); |
|
162 void CurrentItemChange(IDispatch *pdispMedia); |
|
163 void MediaCollectionChange(); |
|
164 void MediaCollectionAttributeStringAdded( |
|
165 BSTR bstrAttribName, BSTR bstrAttribVal); |
|
166 void MediaCollectionAttributeStringRemoved( |
|
167 BSTR bstrAttribName, BSTR bstrAttribVal); |
|
168 void MediaCollectionAttributeStringChanged( |
|
169 BSTR bstrAttribName, BSTR bstrOldAttribVal, BSTR bstrNewAttribVal); |
|
170 void PlaylistCollectionChange(); |
|
171 void PlaylistCollectionPlaylistAdded(BSTR bstrPlaylistName); |
|
172 void PlaylistCollectionPlaylistRemoved(BSTR bstrPlaylistName); |
|
173 void PlaylistCollectionPlaylistSetAsDeleted( |
|
174 BSTR bstrPlaylistName, VARIANT_BOOL varfIsDeleted); |
|
175 void ModeChange(BSTR ModeName, VARIANT_BOOL NewValue); |
|
176 void MediaError(IDispatch *pMediaObject); |
|
177 void OpenPlaylistSwitch(IDispatch *pItem); |
|
178 void DomainChange(BSTR strDomain); |
|
179 void SwitchedToPlayerApplication(); |
|
180 void SwitchedToControl(); |
|
181 void PlayerDockedStateChange(); |
|
182 void PlayerReconnect(); |
|
183 void Click(short nButton, short nShiftState, long fX, long fY); |
|
184 void DoubleClick(short nButton, short nShiftState, long fX, long fY); |
|
185 void KeyDown(short nKeyCode, short nShiftState); |
|
186 void KeyPress(short nKeyAscii); |
|
187 void KeyUp(short nKeyCode, short nShiftState); |
|
188 void MouseDown(short nButton, short nShiftState, long fX, long fY); |
|
189 void MouseMove(short nButton, short nShiftState, long fX, long fY); |
|
190 void MouseUp(short nButton, short nShiftState, long fX, long fY); |
|
191 |
|
192 // IWMPEvents2 |
|
193 void DeviceConnect(IWMPSyncDevice *pDevice); |
|
194 void DeviceDisconnect(IWMPSyncDevice *pDevice); |
|
195 void DeviceStatusChange(IWMPSyncDevice *pDevice, WMPDeviceStatus NewStatus); |
|
196 void DeviceSyncStateChange(IWMPSyncDevice *pDevice, WMPSyncState NewState); |
|
197 void DeviceSyncError(IWMPSyncDevice *pDevice, IDispatch *pMedia); |
|
198 void CreatePartnershipComplete(IWMPSyncDevice *pDevice, HRESULT hrResult); |
|
199 |
|
200 // IWMPEvents3 |
|
201 void CdromRipStateChange(IWMPCdromRip *pCdromRip, WMPRipState wmprs); |
|
202 void CdromRipMediaError(IWMPCdromRip *pCdromRip, IDispatch *pMedia); |
|
203 void CdromBurnStateChange(IWMPCdromBurn *pCdromBurn, WMPBurnState wmpbs); |
|
204 void CdromBurnMediaError(IWMPCdromBurn *pCdromBurn, IDispatch *pMedia); |
|
205 void CdromBurnError(IWMPCdromBurn *pCdromBurn, HRESULT hrError); |
|
206 void LibraryConnect(IWMPLibrary *pLibrary); |
|
207 void LibraryDisconnect(IWMPLibrary *pLibrary); |
|
208 void FolderScanStateChange(WMPFolderScanState wmpfss); |
|
209 void StringCollectionChange( |
|
210 IDispatch *pdispStringCollection, |
|
211 WMPStringCollectionChangeEventType change, |
|
212 long lCollectionIndex); |
|
213 void MediaCollectionMediaAdded(IDispatch *pdispMedia); |
|
214 void MediaCollectionMediaRemoved(IDispatch *pdispMedia); |
|
215 #endif |
|
216 private: |
|
217 volatile LONG m_ref; |
|
218 IConnectionPoint *m_connectionPoint; |
|
219 DWORD m_adviseCookie; |
|
220 }; |
|
221 |
|
222 #endif |