svc_setup.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. #ifndef NULLSOFT_WINAMP_SETUP_SERVICE_HEADER
  2. #define NULLSOFT_WINAMP_SETUP_SERVICE_HEADER
  3. #include <bfc/dispatch.h>
  4. #include "./ifc_setuppage.h"
  5. #include "./ifc_setupjob.h"
  6. #include <windows.h>
  7. #ifdef __cplusplus
  8. extern "C" {
  9. #endif // __cplusplus
  10. #ifdef __cplusplus
  11. }
  12. #endif // __cplusplus
  13. class api_service;
  14. typedef BOOL (__cdecl *Plugin_RegisterSetup)(HINSTANCE /*hInstance*/, api_service* /*serviceApi*/);
  15. class __declspec(novtable) svc_setup : public Dispatchable
  16. {
  17. protected:
  18. svc_setup(void) {};
  19. ~svc_setup(void) {};
  20. public:
  21. HRESULT InsertPage(ifc_setuppage *pPage, int* pIndex);
  22. HRESULT RemovePage(int index);
  23. HRESULT GetPageCount(int* pCount);
  24. HRESULT GetPage(int index, ifc_setuppage **pPage);
  25. HRESULT GetActiveIndex(int*pIndex);
  26. HRESULT Start(HWND hwndWinamp);
  27. HRESULT AddJob(ifc_setupjob *pJob);
  28. HRESULT RemoveJob(ifc_setupjob *pJob);
  29. HRESULT CreateStatusWnd(HWND *phwndStatus);
  30. HRESULT Save(HWND hwndStatus);
  31. HRESULT ExecJobs(HWND hwndStatus);
  32. HRESULT GetWinampWnd(HWND *phwndWinamp); // this call will return S_OK only after setup->Start()
  33. public:
  34. DISPATCH_CODES
  35. {
  36. API_SETUP_INSERT_PAGE = 10,
  37. API_SETUP_REMOVE_PAGE = 20,
  38. API_SETUP_GET_PAGE_COUNT= 30,
  39. API_SETUP_GET_PAGE= 40,
  40. API_SETUP_GET_ACTIVE_INDEX = 50,
  41. API_SETUP_START = 60,
  42. API_SETUP_ADD_JOB = 70,
  43. API_SETUP_REMOVE_JOB = 80,
  44. API_SETUP_CREATE_STATUSWND = 90,
  45. API_SETUP_SAVE = 100,
  46. API_SETUP_EXECJOBS = 110,
  47. API_SETUP_GETWINAMPWND = 120,
  48. };
  49. };
  50. inline HRESULT svc_setup::InsertPage(ifc_setuppage *pPage, int* pIndex)
  51. {
  52. return _call(API_SETUP_INSERT_PAGE, E_NOTIMPL, pPage, pIndex);
  53. }
  54. inline HRESULT svc_setup::RemovePage(int index)
  55. {
  56. return _call(API_SETUP_REMOVE_PAGE, E_NOTIMPL, index);
  57. }
  58. inline HRESULT svc_setup::GetPageCount(int* pCount)
  59. {
  60. return _call(API_SETUP_GET_PAGE_COUNT, E_NOTIMPL, pCount);
  61. }
  62. inline HRESULT svc_setup::GetPage(int index, ifc_setuppage **pPage)
  63. {
  64. return _call(API_SETUP_GET_PAGE, E_NOTIMPL, index, pPage);
  65. }
  66. inline HRESULT svc_setup::GetActiveIndex(int*pIndex)
  67. {
  68. return _call(API_SETUP_GET_ACTIVE_INDEX, E_NOTIMPL, pIndex);
  69. }
  70. inline HRESULT svc_setup::Start(HWND hwndWinamp)
  71. {
  72. return _call(API_SETUP_START, E_NOTIMPL, hwndWinamp);
  73. }
  74. inline HRESULT svc_setup::AddJob(ifc_setupjob *pJob)
  75. {
  76. return _call(API_SETUP_ADD_JOB, E_NOTIMPL, pJob);
  77. }
  78. inline HRESULT svc_setup::RemoveJob(ifc_setupjob *pJob)
  79. {
  80. return _call(API_SETUP_REMOVE_JOB, E_NOTIMPL, pJob);
  81. }
  82. inline HRESULT svc_setup::CreateStatusWnd(HWND *phwndStatus)
  83. {
  84. return _call(API_SETUP_CREATE_STATUSWND, E_NOTIMPL, phwndStatus);
  85. }
  86. inline HRESULT svc_setup::Save(HWND hwndStatus)
  87. {
  88. return _call(API_SETUP_SAVE, E_NOTIMPL, hwndStatus);
  89. }
  90. inline HRESULT svc_setup::ExecJobs(HWND hwndStatus)
  91. {
  92. return _call(API_SETUP_EXECJOBS, E_NOTIMPL, hwndStatus);
  93. }
  94. inline HRESULT svc_setup::GetWinampWnd(HWND *phwndWinamp)
  95. {
  96. return _call(API_SETUP_GETWINAMPWND, E_NOTIMPL, phwndWinamp);
  97. }
  98. // {A7281DEB-9DA8-4ee9-93A8-2E0B8F5F1805}
  99. static const GUID UID_SVC_SETUP = { 0xa7281deb, 0x9da8, 0x4ee9, { 0x93, 0xa8, 0x2e, 0xb, 0x8f, 0x5f, 0x18, 0x5 } };
  100. #endif //NULLSOFT_WINAMP_SETUP_SERVICE_HEADER