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.

133 lines
6.8 KiB

  1. /*****************************************************************************\
  2. FILE: AdvDlg.h
  3. DESCRIPTION:
  4. This code will display the "Advanced Display Properties" dialog.
  5. BryanSt 3/23/2000 Updated and Converted to C++
  6. Copyright (C) Microsoft Corp 2000-2000. All rights reserved.
  7. \*****************************************************************************/
  8. #ifndef _ADVDLG_H
  9. #define _ADVDLG_H
  10. #define MAX_ADVDLG_PAGES 10
  11. HRESULT CThemeManager_CreateInstance(IN IUnknown * punkOuter, IN REFIID riid, OUT LPVOID * ppvObj);
  12. HRESULT CThemeUIPages_CreateInstance(IN IUnknown * punkOuter, IN REFIID riid, OUT LPVOID * ppvObj);
  13. class CThemeManager : public IThemeUIPages
  14. , public CImpIDispatch
  15. , public CObjectWithSite
  16. , public IThemeManager
  17. , public IPropertyBag
  18. , public IPreviewSystemMetrics
  19. {
  20. public:
  21. //////////////////////////////////////////////////////
  22. // Public Interfaces
  23. //////////////////////////////////////////////////////
  24. // *** IUnknown ***
  25. virtual STDMETHODIMP QueryInterface(REFIID riid, LPVOID * ppvObj);
  26. virtual STDMETHODIMP_(ULONG) AddRef(void);
  27. virtual STDMETHODIMP_(ULONG) Release(void);
  28. // *** IThemeManager ***
  29. virtual STDMETHODIMP get_SelectedTheme(OUT ITheme ** ppTheme);
  30. virtual STDMETHODIMP put_SelectedTheme(IN ITheme * pTheme);
  31. virtual STDMETHODIMP get_SelectedScheme(OUT IThemeScheme ** ppThemeScheme);
  32. virtual STDMETHODIMP put_SelectedScheme(IN IThemeScheme * pThemeStyle);
  33. virtual STDMETHODIMP get_WebviewCSS(OUT BSTR * pbstrPath);
  34. virtual STDMETHODIMP get_length(OUT long * pnLength);
  35. virtual STDMETHODIMP get_item(IN VARIANT varIndex, OUT ITheme ** ppTheme);
  36. virtual STDMETHODIMP get_schemeLength(OUT long * pnLength);
  37. virtual STDMETHODIMP get_schemeItem(IN VARIANT varIndex, OUT IThemeScheme ** ppThemeScheme);
  38. virtual STDMETHODIMP GetSelectedSchemeProperty(IN BSTR bstrName, OUT BSTR * pbstrValue);
  39. virtual STDMETHODIMP GetSpecialTheme(IN BSTR bstrName, OUT ITheme ** ppTheme);
  40. virtual STDMETHODIMP SetSpecialTheme(IN BSTR bstrName, IN ITheme * pTheme);
  41. virtual STDMETHODIMP GetSpecialScheme(IN BSTR bstrName, OUT IThemeScheme ** ppThemeScheme, OUT IThemeStyle ** ppThemeStyle, OUT IThemeSize ** ppThemeSize);
  42. virtual STDMETHODIMP SetSpecialScheme(IN BSTR bstrName, IN IThemeScheme * pThemeScheme, IThemeStyle * pThemeStyle, IThemeSize * pThemeSize);
  43. virtual STDMETHODIMP ApplyNow(void);
  44. // *** IThemeUIPages ***
  45. virtual STDMETHODIMP AddPage(IN LPFNSVADDPROPSHEETPAGE pfnAddPage, IN LPARAM lParam, IN long nPageID);
  46. virtual STDMETHODIMP AddBasePage(IN IBasePropPage * pBasePage);
  47. virtual STDMETHODIMP ApplyPressed(IN DWORD dwFlags);
  48. virtual STDMETHODIMP GetBasePagesEnum(OUT IEnumUnknown ** ppEnumUnknown);
  49. virtual STDMETHODIMP UpdatePreview(IN DWORD dwFlags);
  50. virtual STDMETHODIMP AddFakeSettingsPage(IN LPVOID pVoid);
  51. virtual STDMETHODIMP SetExecMode(IN DWORD dwEM);
  52. virtual STDMETHODIMP GetExecMode(OUT DWORD* pdwEM);
  53. virtual STDMETHODIMP LoadMonitorBitmap(IN BOOL fFillDesktop, OUT HBITMAP* phbmMon);
  54. virtual STDMETHODIMP DisplaySaveSettings(IN PVOID pContext, IN HWND hwnd, OUT int* piRet);
  55. // *** IObjectWithSite ***
  56. virtual STDMETHODIMP SetSite(IUnknown *punkSite);
  57. // *** IPropertyBag ***
  58. virtual STDMETHODIMP Read(IN LPCOLESTR pszPropName, IN VARIANT * pVar, IN IErrorLog *pErrorLog);
  59. virtual STDMETHODIMP Write(IN LPCOLESTR pszPropName, IN VARIANT *pVar);
  60. // *** IPreviewSystemMetrics ***
  61. virtual STDMETHODIMP RefreshColors(void);
  62. virtual STDMETHODIMP UpdateDPIchange(void);
  63. virtual STDMETHODIMP UpdateCharsetChanges(void);
  64. virtual STDMETHODIMP DeskSetCurrentScheme(IN LPCWSTR pwzSchemeName);
  65. // *** IDispatch ***
  66. virtual STDMETHODIMP GetTypeInfoCount(UINT *pctinfo) { return E_NOTIMPL; }
  67. virtual STDMETHODIMP GetTypeInfo(UINT itinfo,LCID lcid,ITypeInfo **pptinfo) { return E_NOTIMPL; }
  68. virtual STDMETHODIMP GetIDsOfNames(REFIID riid,OLECHAR **rgszNames,UINT cNames, LCID lcid, DISPID * rgdispid);
  69. virtual STDMETHODIMP Invoke(DISPID dispidMember,REFIID riid,LCID lcid,WORD wFlags, DISPPARAMS * pdispparams, VARIANT * pvarResult, EXCEPINFO * pexcepinfo,UINT * puArgErr);
  70. protected:
  71. HRESULT _Initialize(void);
  72. private:
  73. CThemeManager();
  74. virtual ~CThemeManager(void);
  75. // Private Member Variables
  76. long m_cRef;
  77. HWND m_hwndParent; // hwnd of parent.
  78. IBasePropPage * m_pBasePages[MAX_ADVDLG_PAGES]; // These are the tabs on the Base dlg that want to add tabs to the Adv dlg.
  79. IThemePreview * m_pPreview1; //
  80. IThemePreview * m_pPreview2; //
  81. IThemePreview * m_pPreview3; //
  82. DWORD _dwEM; // Stores the Execution mode in a center location
  83. LPWSTR _pszSelectTheme; // This is the selected .Theme file.
  84. IThemeScheme * _pThemeSchemeSelected; // This is the selected .msstyles file.
  85. LONG m_cSpiThreads;
  86. BOOL m_fForceTimeout;
  87. HDPA m_hdpaThemeDirs; // This contains LPWSTRs that contain theme (*.theme) files.
  88. HDPA m_hdpaSkinDirs; // This contains LPWSTRs that contain skins (*.msstyles) files.
  89. // Private Member Functions
  90. HRESULT _GetPropertyBagByCLSID(IN const GUID * pClsid, IN IPropertyBag ** ppPropertyBag);
  91. HRESULT _SaveCustomValues(void);
  92. HRESULT _InitThemeDirs(void);
  93. HRESULT _AddThemesFromDir(LPCTSTR pszPath, BOOL fFirstLevel, int nInsertLoc);
  94. HRESULT _saveGetSelectedScheme(OUT IThemeScheme ** ppThemeScheme);
  95. HRESULT _InitSkinDirs(void);
  96. HRESULT _EnumSkinCB(THEMECALLBACK tcbType, LPCWSTR pszFileName, OPTIONAL LPCWSTR pszDisplayName, OPTIONAL LPCWSTR pszToolTip, OPTIONAL int iIndex);
  97. HRESULT _EnumSkinsFromKey(HKEY hKey);
  98. HRESULT _InitSelectedThemeFile(void);
  99. HRESULT _SetSelectedThemeEntree(LPCWSTR pszPath);
  100. // Friend Functions
  101. friend HRESULT CThemeManager_CreateInstance(IN IUnknown * punkOuter, IN REFIID riid, OUT LPVOID * ppvObj);
  102. friend HRESULT CThemeUIPages_CreateInstance(IN IUnknown * punkOuter, IN REFIID riid, OUT LPVOID * ppvObj);
  103. static BOOL EnumSkinCB(THEMECALLBACK tcbType, LPCWSTR pszFileName, OPTIONAL LPCWSTR pszDisplayName, OPTIONAL LPCWSTR pszToolTip, OPTIONAL int iIndex, LPARAM lParam);
  104. };
  105. #endif // _ADVDLG_H