123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- #ifndef _VIEW_MB_H_
- #define _VIEW_MB_H_
- #include "main.h"
- #include "contnr.h"
- #include "evntsink.h"
- #include "childwnd.h"
- #include "resource.h"
- #include "..\winamp\wa_dlg.h"
- #include <shlobj.h>
- #include "mbutil.h"
- #include "config.h"
- extern void gracenoteCancelRequest();
- class viewMBHandler
- {
- public:
-
- friend BOOL view_mbDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
- private:
-
-
-
- viewMBHandler ()
- : m_hwnd (0),
- m_pweb (0),
- m_contnr (0),
- m_event (0),
- m_eventCookie (0),
- m_defurl (1),
- m_tmpurl (0),
- loc_oldWndProc (0)
- {
- }
-
-
-
- ~viewMBHandler ()
- {
-
- gracenoteCancelRequest ();
-
- if (m_contnr != 0)
- {
- destroyIEControl ();
- }
- if (m_tmpurl)
- {
- free (m_tmpurl);
- m_tmpurl = 0;
- }
- m_hwnd = 0;
- }
- public:
-
- static void Refresh (int defurl);
-
- static void SetDesc (char *desc);
-
- static void Navigate (char *s);
-
- static void navigateGracenoteTuid ();
-
-
-
- static BOOL CALLBACK DialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
-
- static BOOL CALLBACK newWndProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
-
- static void ContextMenu (HWND parent);
-
- static viewMBHandler &getInstance ()
- {
- if (0 == pVmb)
- {
- pVmb = new viewMBHandler;
- }
- return *pVmb;
- }
- protected:
-
- IConnectionPoint *GetConnectionPoint(REFIID riid);
-
- void ConnectEvents ();
-
-
-
- void createIEControl ();
-
-
-
- void destroyIEControl ();
-
- void NavigateToName (LPCTSTR pszUrl);
- private:
-
- IWebBrowser2 *m_pweb;
- HWND m_hwnd;
- CContainer *m_contnr;
- CEventSink *m_event;
- DWORD m_eventCookie;
- int m_defurl;
- char *m_tmpurl;
- WNDPROC loc_oldWndProc;
- static viewMBHandler *pVmb;
- };
- #endif
|