wac_browser_factory.cpp 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. #include "wac_browser_factory.h"
  2. #include <QtGlobal>
  3. static const std::string _serviceName = "Embedded Browser";
  4. static const std::string _testString = "wac_browser";
  5. // {2E0F69D7-1DA4-4207-97A4-B8B084776B9C} // It's the UUID of the project itself like indicated into the vcxproj
  6. static const GUID api_wac_browser_GUID = { 0x2e0f69d7, 0x1da4, 0x4207, { 0x97, 0xa4, 0xb8, 0xb0, 0x84, 0x77, 0x6b, 0x9c } };
  7. FOURCC wa::Components::WAC_BrowserFactory::GetServiceType()
  8. {
  9. return WaSvc::UNIQUE;
  10. }
  11. const char *wa::Components::WAC_BrowserFactory::GetServiceName()
  12. {
  13. return _serviceName.c_str();
  14. }
  15. const char *wa::Components::WAC_BrowserFactory::GetTestString()
  16. {
  17. return _testString.c_str();;
  18. }
  19. GUID wa::Components::WAC_BrowserFactory::GetGUID()
  20. {
  21. return api_wac_browser_GUID;
  22. }
  23. void *wa::Components::WAC_BrowserFactory::GetInterface( int p_global_lock )
  24. {
  25. Q_UNUSED( p_global_lock )
  26. //OmBrowserObject *browserObject = NULL;
  27. //HRESULT hr = OmBrowserObject::CreateInstance( &browserObject );
  28. //if ( FAILED( hr ) )
  29. // browserObject = NULL;
  30. //return browserObject;
  31. return NULL;
  32. }
  33. int wa::Components::WAC_BrowserFactory::ReleaseInterface( void *p_ifc )
  34. {
  35. //obj_ombrowser *object = (obj_ombrowser *)ifc;
  36. //if ( object != NULL )
  37. // object->Release();
  38. return 1;
  39. }
  40. int wa::Components::WAC_BrowserFactory::SupportNonLockingInterface()
  41. {
  42. return 1;
  43. }
  44. int wa::Components::WAC_BrowserFactory::ServiceNotify( int p_msg, int p_param1, int p_param2 )
  45. {
  46. Q_UNUSED( p_msg )
  47. Q_UNUSED( p_param1 )
  48. Q_UNUSED( p_param2 )
  49. return 1;
  50. }
  51. HRESULT wa::Components::WAC_BrowserFactory::Register( api_service *p_service )
  52. {
  53. if ( p_service == NULL )
  54. return E_INVALIDARG;
  55. p_service->service_register( this );
  56. return S_OK;
  57. }
  58. HRESULT wa::Components::WAC_BrowserFactory::Unregister( api_service *p_service )
  59. {
  60. if ( p_service == NULL )
  61. return E_INVALIDARG;
  62. p_service->service_deregister( this );
  63. return S_OK;
  64. }
  65. #ifdef CBCLASS
  66. #undef CBCLASS
  67. #endif
  68. #define CBCLASS wa::Components::WAC_BrowserFactory
  69. START_DISPATCH;
  70. CB( WASERVICEFACTORY_GETSERVICETYPE, GetServiceType )
  71. CB( WASERVICEFACTORY_GETSERVICENAME, GetServiceName )
  72. CB( WASERVICEFACTORY_GETGUID, GetGUID )
  73. CB( WASERVICEFACTORY_GETINTERFACE, GetInterface )
  74. CB( WASERVICEFACTORY_SUPPORTNONLOCKINGGETINTERFACE, SupportNonLockingInterface )
  75. CB( WASERVICEFACTORY_RELEASEINTERFACE, ReleaseInterface )
  76. CB( WASERVICEFACTORY_GETTESTSTRING, GetTestString )
  77. CB( WASERVICEFACTORY_SERVICENOTIFY, ServiceNotify )
  78. END_DISPATCH;
  79. #undef CBCLASS