Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

93 lines
3.6 KiB

  1. // CCaps.h : Declaration of the CClientCaps
  2. #ifndef __CCAPS_H_
  3. #define __CCAPS_H_
  4. #include "resource.h" // main symbols
  5. /////////////////////////////////////////////////////////////////////////////
  6. // CClientCaps
  7. class ATL_NO_VTABLE CClientCaps :
  8. public CComObjectRootEx<CComSingleThreadModel>,
  9. public CComCoClass<CClientCaps, &CLSID_ClientCaps>,
  10. public IDispatchImpl<IClientCaps, &IID_IClientCaps, &LIBID_IEXTagLib>,
  11. public IElementBehavior
  12. {
  13. public:
  14. CClientCaps()
  15. {
  16. m_pSite = NULL;
  17. iComponentNum = 0;
  18. iComponentCap = 0;
  19. ppwszComponents = NULL;
  20. }
  21. ~CClientCaps()
  22. {
  23. if (m_pSite)
  24. m_pSite->Release();
  25. if(ppwszComponents)
  26. {
  27. clearComponentRequest();
  28. delete [] ppwszComponents;
  29. }
  30. }
  31. DECLARE_REGISTRY_RESOURCEID(IDR_CLIENTCAPS)
  32. DECLARE_NOT_AGGREGATABLE(CClientCaps)
  33. BEGIN_COM_MAP(CClientCaps)
  34. COM_INTERFACE_ENTRY(IClientCaps)
  35. COM_INTERFACE_ENTRY(IDispatch)
  36. COM_INTERFACE_ENTRY(IElementBehavior)
  37. END_COM_MAP()
  38. // IClientCaps
  39. public:
  40. STDMETHOD(get_javaEnabled)(/*[out, retval]*/ VARIANT_BOOL *pVal);
  41. STDMETHOD(get_cookieEnabled)(/*[out, retval]*/ VARIANT_BOOL *pVal);
  42. STDMETHOD(get_cpuClass)(/*[out, retval]*/ BSTR * p);
  43. STDMETHOD(get_systemLanguage)(/*[out, retval]*/ BSTR * p);
  44. STDMETHOD(get_userLanguage)(/*[out, retval]*/ BSTR * p);
  45. STDMETHOD(get_platform)(/*[out, retval]*/ BSTR * p);
  46. STDMETHOD(get_connectionSpeed)(/*[out, retval]*/ long * p);
  47. STDMETHOD(get_onLine)(/*[out, retval]*/ VARIANT_BOOL * p);
  48. STDMETHOD(get_colorDepth)(/*[out, retval]*/ long * p);
  49. STDMETHOD(get_bufferDepth)(/*[out, retval]*/ long * p);
  50. STDMETHOD(get_width)(/*[out, retval]*/ long * p);
  51. STDMETHOD(get_height)(/*[out, retval]*/ long * p);
  52. STDMETHOD(get_availHeight)(/*[out, retval]*/ long * p);
  53. STDMETHOD(get_availWidth)(/*[out, retval]*/ long * p);
  54. STDMETHOD(get_connectionType)(/*[out, retval]*/ BSTR * p);
  55. STDMETHOD(getComponentVersion)(/*[in]*/ BSTR bstrName, /*[in]*/ BSTR bstrType, /*[out,retval]*/ BSTR *pbstrVer);
  56. STDMETHOD(isComponentInstalled)(/*[in]*/ BSTR bstrName, /*[in]*/ BSTR bstrType, /*[in,optional]*/ BSTR bStrVer, /*[out,retval]*/ VARIANT_BOOL *p);
  57. STDMETHOD(compareVersions)(/*[in]*/ BSTR bstrVer1, /*[in]*/ BSTR bstrVer2, /*[out,retval]*/long *p);
  58. STDMETHOD(addComponentRequest)(/*[in]*/ BSTR bstrName, /*[in]*/ BSTR bstrType, /*[in, optional]*/ BSTR bstrVer);
  59. STDMETHOD(doComponentRequest)(/*[out]*/ VARIANT_BOOL * pVal);
  60. STDMETHOD(clearComponentRequest)();
  61. //IHTMLPeerElement methods
  62. STDMETHOD(Init)(IElementBehaviorSite *pSite);
  63. STDMETHOD(Notify)(LONG lNotify, VARIANT * pVarNotify);
  64. STDMETHOD(Detach)() { return S_OK; };
  65. private:
  66. STDMETHOD(GetHTMLWindow)(/* out */ IHTMLWindow2 **ppWindow);
  67. STDMETHOD(GetHTMLDocument)(/* out */IHTMLDocument2 **ppDoc);
  68. STDMETHOD(GetClientInformation)(/* out */IOmNavigator **ppClientInformation);
  69. STDMETHOD(GetScreen)(/* out */ IHTMLScreen **ppScreen);
  70. STDMETHOD(GetVersion)(BSTR bstrName, BSTR bstrType, LPDWORD pdwMS, LPDWORD pdwLS);
  71. private: // helpers functions to convert between version strings and DWORD's
  72. static HRESULT GetVersionFromString(LPCOLESTR psz, LPDWORD pdwMS, LPDWORD pdwLS);
  73. static HRESULT GetStringFromVersion(DWORD dwMS, DWORD dwLS, BSTR *pbstrVersion);
  74. private:
  75. IElementBehaviorSite * m_pSite;
  76. int iComponentNum;
  77. int iComponentCap;
  78. LPWSTR * ppwszComponents;
  79. };
  80. #endif //__CCAPS_H_