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.

92 lines
4.4 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 CObjectCLSID
  25. , public IThemeScheme
  26. {
  27. public:
  28. //////////////////////////////////////////////////////
  29. // Public Interfaces
  30. //////////////////////////////////////////////////////
  31. // *** IUnknown ***
  32. virtual STDMETHODIMP QueryInterface(REFIID riid, LPVOID * ppvObj);
  33. virtual STDMETHODIMP_(ULONG) AddRef(void);
  34. virtual STDMETHODIMP_(ULONG) Release(void);
  35. // *** IThemeScheme ***
  36. virtual STDMETHODIMP get_DisplayName(OUT BSTR * pbstrDisplayName);
  37. virtual STDMETHODIMP put_DisplayName(IN BSTR bstrDisplayName) {return E_NOTIMPL;}
  38. virtual STDMETHODIMP get_Path(OUT BSTR * pbstrPath) { if (pbstrPath) {*pbstrPath = NULL;} return E_NOTIMPL;}
  39. virtual STDMETHODIMP put_Path(IN BSTR bstrPath) {return E_NOTIMPL;}
  40. virtual STDMETHODIMP get_length(OUT long * pnLength);
  41. virtual STDMETHODIMP get_item(IN VARIANT varIndex, OUT IThemeStyle ** ppThemeStyle);
  42. virtual STDMETHODIMP get_SelectedStyle(OUT IThemeStyle ** ppThemeStyle);
  43. virtual STDMETHODIMP put_SelectedStyle(IN IThemeStyle * pThemeStyle);
  44. virtual STDMETHODIMP AddStyle(OUT IThemeStyle ** ppThemeStyle) {return _AddStyle(NULL, ppThemeStyle);};
  45. // *** IDispatch ***
  46. virtual STDMETHODIMP GetTypeInfoCount(UINT *pctinfo) { return E_ACCESSDENIED; }
  47. virtual STDMETHODIMP GetTypeInfo(UINT itinfo,LCID lcid,ITypeInfo **pptinfo) { return E_ACCESSDENIED; }
  48. virtual STDMETHODIMP GetIDsOfNames(REFIID riid,OLECHAR **rgszNames,UINT cNames, LCID lcid, DISPID * rgdispid) { return E_ACCESSDENIED; }
  49. virtual STDMETHODIMP Invoke(DISPID dispidMember,REFIID riid,LCID lcid,WORD wFlags, DISPPARAMS * pdispparams, VARIANT * pvarResult, EXCEPINFO * pexcepinfo,UINT * puArgErr) { return E_ACCESSDENIED; }
  50. private:
  51. CAppearanceScheme(void);
  52. virtual ~CAppearanceScheme(void);
  53. // Private Member Variables
  54. long m_cRef;
  55. HKEY m_hKeyScheme;
  56. // Private Member Functions
  57. HRESULT _InitReg(void);
  58. HRESULT _ConvertScheme(LPCTSTR pszLegacyName, LPCTSTR pszStyleName, LPCTSTR pszSizeName, SYSTEMMETRICSALL * pState, IN enumThemeContrastLevels ContrastLevel, IN BOOL fSetAsDefault, IN BOOL fSetRegKeyTitle);
  59. HRESULT _LoadConversionMappings(void);
  60. HRESULT _CustomConvert(LPCTSTR pszSchemeName, SYSTEMMETRICSALL * pState, IN BOOL fSetAsDefault, IN BOOL fSetRegKeyTitle);
  61. HRESULT _IsLegacyUpgradeConvert(LPCTSTR pszSchemeName, SYSTEMMETRICSALL * pState, IN BOOL fSetAsDefault);
  62. HRESULT _getStyleByIndex(IN long nIndex, OUT IThemeStyle ** ppThemeStyle);
  63. HRESULT _getCurrentSettings(IN LPCWSTR pszSettings, OUT IThemeStyle ** ppThemeStyle);
  64. HRESULT _AddStyle(IN LPCWSTR pszTitle, OUT IThemeStyle ** ppThemeStyle);
  65. HRESULT _getIndex(IN IThemeStyle * pThemeStyle, IN BSTR bstrStyleDisplayName, IN long * pnStyleIndex, IN IThemeSize * pThemeSize, IN BSTR bstrSizeDisplayName, IN long * pnSizeIndex);
  66. HRESULT _getSizeIndex(IN IThemeStyle * pThemeStyle, IN IThemeSize * pThemeSize, IN BSTR bstrSizeDisplayName, IN long * pnSizeIndex);
  67. // Friend Functions
  68. friend HRESULT CAppearanceScheme_CreateInstance(IN IUnknown * punkOuter, IN REFIID riid, OUT LPVOID * ppvObj);
  69. };
  70. #endif // _FILE_H_APPSCHEME