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.

81 lines
1.8 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. STDMETHODIMP Init( void );
  34. STDMETHODIMP SetIFont ( LPFONT pIFont );
  35. STDMETHODIMP GetFontDisp ( IFontDisp **ppFont );
  36. STDMETHODIMP GetHFont ( HFONT *phFont );
  37. STDMETHODIMP GetHFontBold ( HFONT *phFont );
  38. STDMETHODIMP SaveToStream ( LPSTREAM pIStream, BOOL fClearDirty );
  39. STDMETHODIMP LoadFromStream ( LPSTREAM pIStream );
  40. STDMETHODIMP SaveToPropertyBag ( IPropertyBag*, BOOL fClearDirty, BOOL fSaveAllProps );
  41. STDMETHODIMP LoadFromPropertyBag ( IPropertyBag*, IErrorLog* );
  42. STDMETHODIMP_(VOID) FontChange ( DISPID DispId );
  43. private:
  44. void InitDefaultFontDesc ( FONTDESC&, INT&, WCHAR[LF_FACESIZE+1] );
  45. static const LPWSTR m_cwszDefaultFaceName;
  46. static const INT m_iDefaultTmHeight;
  47. static const INT m_iDefaultRiPxlsPerInch;
  48. static const SHORT m_iDefaultTmWeight;
  49. CSysmonControl *m_pCtrl;
  50. IFont *m_pIFont;
  51. IFont *m_pIFontBold;
  52. IConnectionPoint *m_pIConnPt;
  53. CImpIPropertyNotifySink m_NotifySink;
  54. DWORD m_dwCookie;
  55. };
  56. #endif