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.

93 lines
4.6 KiB

  1. /*****************************************************************************\
  2. FILE: appScheme.h
  3. DESCRIPTION:
  4. This is the Autmation Object to theme scheme object.
  5. BryanSt 4/3/2000 (Bryan Starbuck)
  6. Copyright (C) Microsoft Corp 2000-2000. All rights reserved.
  7. \*****************************************************************************/
  8. #ifndef _FILE_H_APPSCHEME
  9. #define _FILE_H_APPSCHEME
  10. #include <cowsite.h>
  11. #include <atlbase.h>
  12. static const GUID CLSID_LegacyAppearanceScheme = { 0xb41910f6, 0xab9f, 0x4768, { 0x94, 0x5c, 0x3c, 0x42, 0x37, 0xf2, 0xe2, 0x5c } };// {B41910F6-AB9F-4768-945C-3C4237F2E25C}
  13. HRESULT CAppearanceScheme_CreateInstance(IN IUnknown * punkOuter, IN REFIID riid, OUT LPVOID * ppvObj);
  14. HRESULT LoadConversionMappings(void);
  15. HRESULT MapLegacyAppearanceSchemeToIndex(LPCTSTR pszOldSchemeName, int * pnIndex);
  16. typedef struct
  17. {
  18. TCHAR szLegacyName[MAX_PATH];
  19. TCHAR szNewColorSchemeName[MAX_PATH];
  20. TCHAR szNewSizeName[MAX_PATH];
  21. enumThemeContrastLevels ContrastLevel;
  22. } APPEARANCESCHEME_UPGRADE_MAPPINGS;
  23. extern APPEARANCESCHEME_UPGRADE_MAPPINGS g_UpgradeMapping[MAX_LEGACY_UPGRADE_SCENARIOS];
  24. class CAppearanceScheme : public CImpIDispatch
  25. , public CObjectCLSID
  26. , public IThemeScheme
  27. {
  28. public:
  29. //////////////////////////////////////////////////////
  30. // Public Interfaces
  31. //////////////////////////////////////////////////////
  32. // *** IUnknown ***
  33. virtual STDMETHODIMP QueryInterface(REFIID riid, LPVOID * ppvObj);
  34. virtual STDMETHODIMP_(ULONG) AddRef(void);
  35. virtual STDMETHODIMP_(ULONG) Release(void);
  36. // *** IThemeScheme ***
  37. virtual STDMETHODIMP get_DisplayName(OUT BSTR * pbstrDisplayName);
  38. virtual STDMETHODIMP put_DisplayName(IN BSTR bstrDisplayName) {return E_NOTIMPL;}
  39. virtual STDMETHODIMP get_Path(OUT BSTR * pbstrPath) { if (pbstrPath) {*pbstrPath = NULL;} return E_NOTIMPL;}
  40. virtual STDMETHODIMP put_Path(IN BSTR bstrPath) {return E_NOTIMPL;}
  41. virtual STDMETHODIMP get_length(OUT long * pnLength);
  42. virtual STDMETHODIMP get_item(IN VARIANT varIndex, OUT IThemeStyle ** ppThemeStyle);
  43. virtual STDMETHODIMP get_SelectedStyle(OUT IThemeStyle ** ppThemeStyle);
  44. virtual STDMETHODIMP put_SelectedStyle(IN IThemeStyle * pThemeStyle);
  45. virtual STDMETHODIMP AddStyle(OUT IThemeStyle ** ppThemeStyle) {return _AddStyle(NULL, ppThemeStyle);};
  46. // *** IDispatch ***
  47. virtual STDMETHODIMP GetTypeInfoCount(UINT *pctinfo) { return CImpIDispatch::GetTypeInfoCount(pctinfo); }
  48. virtual STDMETHODIMP GetTypeInfo(UINT itinfo,LCID lcid,ITypeInfo **pptinfo) { return CImpIDispatch::GetTypeInfo(itinfo, lcid, pptinfo); }
  49. virtual STDMETHODIMP GetIDsOfNames(REFIID riid,OLECHAR **rgszNames,UINT cNames, LCID lcid, DISPID * rgdispid) { return CImpIDispatch::GetIDsOfNames(riid, rgszNames, cNames, lcid, rgdispid); }
  50. 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); }
  51. private:
  52. CAppearanceScheme(void);
  53. virtual ~CAppearanceScheme(void);
  54. // Private Member Variables
  55. long m_cRef;
  56. HKEY m_hKeyScheme;
  57. // Private Member Functions
  58. HRESULT _InitReg(void);
  59. HRESULT _ConvertScheme(LPCTSTR pszLegacyName, LPCTSTR pszStyleName, LPCTSTR pszSizeName, SYSTEMMETRICSALL * pState, IN enumThemeContrastLevels ContrastLevel, IN BOOL fSetAsDefault, IN BOOL fSetRegKeyTitle);
  60. HRESULT _LoadConversionMappings(void);
  61. HRESULT _CustomConvert(LPCTSTR pszSchemeName, SYSTEMMETRICSALL * pState, IN BOOL fSetAsDefault, IN BOOL fSetRegKeyTitle);
  62. HRESULT _IsLegacyUpgradeConvert(LPCTSTR pszSchemeName, SYSTEMMETRICSALL * pState, IN BOOL fSetAsDefault);
  63. HRESULT _getStyleByIndex(IN long nIndex, OUT IThemeStyle ** ppThemeStyle);
  64. HRESULT _getCurrentSettings(IN LPCWSTR pszSettings, OUT IThemeStyle ** ppThemeStyle);
  65. HRESULT _AddStyle(IN LPCWSTR pszTitle, OUT IThemeStyle ** ppThemeStyle);
  66. HRESULT _getIndex(IN IThemeStyle * pThemeStyle, IN BSTR bstrStyleDisplayName, IN long * pnStyleIndex, IN IThemeSize * pThemeSize, IN BSTR bstrSizeDisplayName, IN long * pnSizeIndex);
  67. HRESULT _getSizeIndex(IN IThemeStyle * pThemeStyle, IN IThemeSize * pThemeSize, IN BSTR bstrSizeDisplayName, IN long * pnSizeIndex);
  68. // Friend Functions
  69. friend HRESULT CAppearanceScheme_CreateInstance(IN IUnknown * punkOuter, IN REFIID riid, OUT LPVOID * ppvObj);
  70. };
  71. #endif // _FILE_H_APPSCHEME