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.

84 lines
2.0 KiB

  1. /*++
  2. Copyright (C) 1996-1999 Microsoft Corporation
  3. Module Name:
  4. colefont.h
  5. Abstract:
  6. <abstract>
  7. --*/
  8. #ifndef _COLEFONT_H_
  9. #define _COLEFONT_H_
  10. class COleFont;
  11. class CImpIPropertyNotifySink : public IPropertyNotifySink
  12. {
  13. public:
  14. CImpIPropertyNotifySink(COleFont* pOleFont);
  15. ~CImpIPropertyNotifySink(void);
  16. //IUnknown members
  17. STDMETHODIMP QueryInterface(REFIID, PPVOID);
  18. STDMETHODIMP_(ULONG) AddRef(void);
  19. STDMETHODIMP_(ULONG) Release(void);
  20. //Property sink methods
  21. STDMETHODIMP OnChanged( DISPID DispId );
  22. STDMETHODIMP OnRequestEdit( DISPID );
  23. private:
  24. COleFont* m_pOleFont;
  25. ULONG m_cRef;
  26. };
  27. class CSysmonControl;
  28. class COleFont
  29. {
  30. public:
  31. COleFont ( CSysmonControl *pCtrl );
  32. ~COleFont( void );
  33. //
  34. // The following functions are not method of a interface
  35. // It is better to change the STDMETHODIMP into HRESULT
  36. //
  37. STDMETHODIMP Init( void );
  38. STDMETHODIMP SetIFont ( LPFONT pIFont );
  39. STDMETHODIMP GetFontDisp ( IFontDisp **ppFont );
  40. STDMETHODIMP GetHFont ( HFONT *phFont );
  41. STDMETHODIMP GetHFontBold ( HFONT *phFont );
  42. STDMETHODIMP SaveToStream ( LPSTREAM pIStream, BOOL fClearDirty );
  43. STDMETHODIMP LoadFromStream ( LPSTREAM pIStream );
  44. STDMETHODIMP SaveToPropertyBag ( IPropertyBag*, BOOL fClearDirty, BOOL fSaveAllProps );
  45. STDMETHODIMP LoadFromPropertyBag ( IPropertyBag*, IErrorLog* );
  46. STDMETHODIMP_(VOID) FontChange ( DISPID DispId );
  47. private:
  48. void InitDefaultFontDesc ( FONTDESC&, INT&, WCHAR[LF_FACESIZE+1] );
  49. static const LPWSTR m_cwszDefaultFaceName;
  50. static const INT m_iDefaultTmHeight;
  51. static const INT m_iDefaultRiPxlsPerInch;
  52. static const SHORT m_iDefaultTmWeight;
  53. CSysmonControl *m_pCtrl;
  54. IFont *m_pIFont;
  55. IFont *m_pIFontBold;
  56. IConnectionPoint *m_pIConnPt;
  57. CImpIPropertyNotifySink m_NotifySink;
  58. DWORD m_dwCookie;
  59. };
  60. #endif