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.

136 lines
5.9 KiB

  1. /*****************************************************************************\
  2. FILE: BaseAppearPg.h
  3. DESCRIPTION:
  4. This code will display a "Appearances" tab in the
  5. "Display Properties" dialog (the base dialog, not the advanced dlg).
  6. ??????? ?/??/1993 Created
  7. BryanSt 3/23/2000 Updated and Converted to C++
  8. Copyright (C) Microsoft Corp 1993-2000. All rights reserved.
  9. \*****************************************************************************/
  10. #ifndef _BASEAPPEAR_H
  11. #define _BASEAPPEAR_H
  12. #include <cowsite.h>
  13. #include "PreviewTh.h"
  14. class CBaseAppearancePage : public CObjectWithSite
  15. , public CObjectWindow
  16. , public CObjectCLSID
  17. , public IPropertyBag
  18. , public IPreviewSystemMetrics
  19. , public IBasePropPage
  20. {
  21. public:
  22. //////////////////////////////////////////////////////
  23. // Public Interfaces
  24. //////////////////////////////////////////////////////
  25. // *** IUnknown ***
  26. virtual STDMETHODIMP QueryInterface(REFIID riid, LPVOID * ppvObj);
  27. virtual STDMETHODIMP_(ULONG) AddRef(void);
  28. virtual STDMETHODIMP_(ULONG) Release(void);
  29. // *** IBasePropPage ***
  30. virtual STDMETHODIMP GetAdvancedDialog(OUT IAdvancedDialog ** ppAdvDialog);
  31. virtual STDMETHODIMP OnApply(IN PROPPAGEONAPPLY oaAction);
  32. // *** IShellPropSheetExt ***
  33. virtual STDMETHODIMP AddPages(IN LPFNSVADDPROPSHEETPAGE pfnAddPage, IN LPARAM lParam);
  34. virtual STDMETHODIMP ReplacePage(IN EXPPS uPageID, IN LPFNSVADDPROPSHEETPAGE pfnReplaceWith, IN LPARAM lParam) {return E_NOTIMPL;}
  35. // *** IPropertyBag ***
  36. virtual STDMETHODIMP Read(IN LPCOLESTR pszPropName, IN VARIANT * pVar, IN IErrorLog *pErrorLog);
  37. virtual STDMETHODIMP Write(IN LPCOLESTR pszPropName, IN VARIANT *pVar);
  38. // *** IObjectWithSite ***
  39. virtual STDMETHODIMP SetSite(IUnknown *punkSite);
  40. // *** IPreviewSystemMetrics ***
  41. virtual STDMETHODIMP RefreshColors(void);
  42. virtual STDMETHODIMP UpdateDPIchange(void) {return E_NOTIMPL;}
  43. virtual STDMETHODIMP UpdateCharsetChanges(void);
  44. virtual STDMETHODIMP DeskSetCurrentScheme(IN LPCWSTR pwzSchemeName);
  45. CBaseAppearancePage();
  46. protected:
  47. private:
  48. virtual ~CBaseAppearancePage(void);
  49. // Private Member Variables
  50. long m_cRef;
  51. BOOL m_fIsDirty; // We need to keep track of this in case another tab dirties out bit.
  52. BOOL m_fInitialized; // Have we been initialized yet?
  53. BOOL m_fLockVisualStylePolicyEnabled; // Do we lock visual styles because of a policy?
  54. int m_nSelectedScheme;
  55. int m_nSelectedStyle;
  56. int m_nSelectedSize;
  57. HWND m_hwndSchemeDropDown;
  58. HWND m_hwndStyleDropDown;
  59. HWND m_hwndSizeDropDown;
  60. IThemeManager * m_pThemeManager;
  61. IThemeScheme * m_pSelectedThemeScheme;
  62. IThemeStyle * m_pSelectedStyle;
  63. IThemeSize * m_pSelectedSize;
  64. IThemePreview * m_pThemePreview;
  65. LPWSTR m_pszLoadMSTheme; // When we open up, load this theme.
  66. SYSTEMMETRICSALL m_advDlgState; // This is the state we modify in the Advanced Appearance page.
  67. BOOL m_fLoadedAdvState; // Has the state been loaded?
  68. int m_nNewDPI; // This is the dirty DPI. It equals m_nAppliedDPI if it isn't dirty.
  69. int m_nAppliedDPI; // This is the currently active DPI (last applied).
  70. // Private Member Functions
  71. INT_PTR _BaseAppearanceDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
  72. HRESULT _OnInitAppearanceDlg(HWND hDlg);
  73. HRESULT _OnInitData(void);
  74. HRESULT _OnDestroy(HWND hDlg);
  75. INT_PTR _OnCommand(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
  76. HRESULT _OnSetActive(HWND hDlg);
  77. HRESULT _OnApply(HWND hDlg, LPARAM lParam);
  78. HRESULT _UpdatePreview(IN BOOL fUpdateThemePage);
  79. HRESULT _EnableAdvancedButton(void); // See if we want the Advanced button enabled.
  80. HRESULT _LoadState(void);
  81. HRESULT _SaveState(CDimmedWindow* pDimmedWindow);
  82. HRESULT _LoadLiveSettings(IN LPCWSTR pszSaveGroup);
  83. HRESULT _SaveLiveSettings(IN LPCWSTR pszSaveGroup);
  84. HRESULT _OnSchemeChange(HWND hDlg, BOOL fDisplayErrors);
  85. HRESULT _OnStyleChange(HWND hDlg);
  86. HRESULT _OnSizeChange(HWND hDlg);
  87. HRESULT _OnAdvancedOptions(HWND hDlg);
  88. HRESULT _OnEffectsOptions(HWND hDlg);
  89. HRESULT _PopulateSchemeDropdown(void);
  90. HRESULT _PopulateStyleDropdown(void);
  91. HRESULT _PopulateSizeDropdown(void);
  92. HRESULT _FreeSchemeDropdown(void);
  93. HRESULT _FreeStyleDropdown(void);
  94. HRESULT _FreeSizeDropdown(void);
  95. BOOL _IsDirty(void);
  96. HRESULT _SetScheme(IN BOOL fLoadSystemMetrics, IN BOOL fLoadLiveSettings, IN BOOL fPreviousSelectionIsVS);
  97. HRESULT _OutsideSetScheme(BSTR bstrScheme);
  98. HRESULT _SetStyle(IN BOOL fUpdateThemePage);
  99. HRESULT _OutsideSetStyle(BSTR bstrStyle);
  100. HRESULT _SetSize(IN BOOL fLoadSystemMetrics, IN BOOL fUpdateThemePage);
  101. HRESULT _OutsideSetSize(BSTR bstrSize);
  102. HRESULT _LoadVisaulStyleFile(IN LPCWSTR pszPath);
  103. HRESULT _ApplyScheme(IThemeScheme * pThemeScheme, IThemeStyle * pColorStyle, IThemeSize * pThemeSize);
  104. HRESULT _GetPageByCLSID(const GUID * pClsid, IPropertyBag ** ppPropertyBag);
  105. HRESULT _ScaleSizesSinceDPIChanged(void);
  106. static INT_PTR CALLBACK BaseAppearanceDlgProc(HWND hDlg, UINT message , WPARAM wParam, LPARAM lParam);
  107. };
  108. #endif // _BASEAPPEAR_H