Source code of Windows XP (NT5)
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.

88 lines
4.8 KiB

  1. /*****************************************************************************\
  2. FILE: thSize.h
  3. DESCRIPTION:
  4. This is the Autmation Object to theme size object. This one will be
  5. for the Skin objects.
  6. BryanSt 5/13/2000 (Bryan Starbuck)
  7. Copyright (C) Microsoft Corp 2000-2000. All rights reserved.
  8. \*****************************************************************************/
  9. #ifndef _FILE_H_THSIZE
  10. #define _FILE_H_THSIZE
  11. #include <cowsite.h>
  12. #include <atlbase.h>
  13. HRESULT CSkinSize_CreateInstance(IN LPCWSTR pszFilename, IN LPCWSTR pszStyleName, IN LPCWSTR pszSizeName, IN LPCWSTR pszDisplayName, OUT IThemeSize ** ppThemeSize);
  14. HRESULT CSkinSize_CreateInstance(IN LPCWSTR pszFilename, IN LPCWSTR pszStyleName, IN LPCWSTR pszSizeName, OUT IThemeSize ** ppThemeSize);
  15. class CSkinSize : public CImpIDispatch
  16. , public IThemeSize
  17. , public IPropertyBag
  18. {
  19. public:
  20. //////////////////////////////////////////////////////
  21. // Public Interfaces
  22. //////////////////////////////////////////////////////
  23. // *** IUnknown ***
  24. virtual STDMETHODIMP QueryInterface(REFIID riid, LPVOID * ppvObj);
  25. virtual STDMETHODIMP_(ULONG) AddRef(void);
  26. virtual STDMETHODIMP_(ULONG) Release(void);
  27. // *** IThemeSize ***
  28. virtual STDMETHODIMP get_DisplayName(OUT BSTR * pbstrDisplayName);
  29. virtual STDMETHODIMP put_DisplayName(IN BSTR bstrDisplayName);
  30. virtual STDMETHODIMP get_Name(OUT BSTR * pbstrName);
  31. virtual STDMETHODIMP put_Name(IN BSTR bstrName);
  32. virtual STDMETHODIMP get_SystemMetricColor(IN int nSysColorIndex, OUT COLORREF * pColorRef);
  33. virtual STDMETHODIMP put_SystemMetricColor(IN int nSysColorIndex, IN COLORREF ColorRef) {return E_NOTIMPL;}
  34. virtual STDMETHODIMP get_SystemMetricSize(IN enumSystemMetricSize nSystemMetricIndex, OUT int * pnSize);
  35. virtual STDMETHODIMP put_SystemMetricSize(IN enumSystemMetricSize nSystemMetricIndex, IN int nSize) {return E_NOTIMPL;}
  36. virtual STDMETHODIMP get_WebviewCSS(OUT BSTR * pbstrPath);
  37. virtual STDMETHODIMP get_ContrastLevel(OUT enumThemeContrastLevels * pContrastLevel) {if (pContrastLevel) {*pContrastLevel = CONTRAST_NORMAL;} return S_OK;}
  38. virtual STDMETHODIMP put_ContrastLevel(IN enumThemeContrastLevels ContrastLevel) {return E_NOTIMPL;}
  39. virtual STDMETHODIMP GetSystemMetricFont(IN enumSystemMetricFont nSPIFontIndex, IN LOGFONTW * pParamW);
  40. virtual STDMETHODIMP PutSystemMetricFont(IN enumSystemMetricFont nSPIFontIndex, IN LOGFONTW * pParamW) {return E_NOTIMPL;}
  41. // *** IPropertyBag ***
  42. virtual STDMETHODIMP Read(IN LPCOLESTR pszPropName, IN VARIANT * pVar, IN IErrorLog *pErrorLog);
  43. virtual STDMETHODIMP Write(IN LPCOLESTR pszPropName, IN VARIANT *pVar) {return E_NOTIMPL;}
  44. // *** IDispatch ***
  45. virtual STDMETHODIMP GetTypeInfoCount(UINT *pctinfo) { return CImpIDispatch::GetTypeInfoCount(pctinfo); }
  46. virtual STDMETHODIMP GetTypeInfo(UINT itinfo,LCID lcid,ITypeInfo **pptinfo) { return CImpIDispatch::GetTypeInfo(itinfo, lcid, pptinfo); }
  47. virtual STDMETHODIMP GetIDsOfNames(REFIID riid,OLECHAR **rgszNames,UINT cNames, LCID lcid, DISPID * rgdispid) { return CImpIDispatch::GetIDsOfNames(riid, rgszNames, cNames, lcid, rgdispid); }
  48. virtual STDMETHODIMP Invoke(DISPID dispidMember,REFIID riid,LCID lcid,WORD wFlags, DISPPARAMS * pdispparams, VARIANT * pvarResult, EXCEPINFO * pexcepinfo,UINT * puArgErr) { return CImpIDispatch::Invoke(dispidMember, riid, lcid, wFlags, pdispparams, pvarResult, pexcepinfo, puArgErr); }
  49. private:
  50. CSkinSize(IN LPCWSTR pszFilename, IN LPCWSTR pszStyleName, IN LPCWSTR pszSizeName, IN LPCWSTR pszDisplayName);
  51. virtual ~CSkinSize(void);
  52. // Private Member Variables
  53. long m_cRef;
  54. LPWSTR m_pszFilename; // This is the full path to the ".thx" file
  55. LPWSTR m_pszStyleName; // This is the canonical name of the color style
  56. LPWSTR m_pszSizeName; // This is the canonical name of the size
  57. LPWSTR m_pszDisplayName; // This is the display name of the size
  58. HTHEME m_hTheme; // This is the Theme we represent.
  59. BOOL m_fFontsLoaded; // Have we loaded the fonts yet?
  60. SYSTEMMETRICSALL m_sysMetrics; // The loaded fonts
  61. // Private Methods
  62. HRESULT _InitVisualStyle(void);
  63. // Friend Functions
  64. friend HRESULT CSkinSize_CreateInstance(IN LPCWSTR pszFilename, IN LPCWSTR pszStyleName, IN LPCWSTR pszSizeName, IN LPCWSTR pszDisplayName, OUT IThemeSize ** ppThemeSize);
  65. friend HRESULT CSkinSize_CreateInstance(IN LPCWSTR pszFilename, IN LPCWSTR pszStyleName, IN LPCWSTR pszSizeName, OUT IThemeSize ** ppThemeSize);
  66. };
  67. #endif // _FILE_H_THSIZE