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.

49 lines
1.6 KiB

  1. /*************************************************************************/
  2. /* Copyright (C) 1999 Microsoft Corporation */
  3. /* File: ctext.h */
  4. /* Description: header file for class CText. */
  5. /* Author: phillu */
  6. /* Date: 10/06/99 */
  7. /*************************************************************************/
  8. #ifndef __CTEXT_H_
  9. #define __CTEXT_H_
  10. // font style flags for internal use
  11. #define FS_NORMAL 0x00
  12. #define FS_BOLD 0x01
  13. #define FS_ITALIC 0x02
  14. #define FS_UNDERLINE 0x04
  15. #define FS_STRIKEOUT 0x08
  16. class CText
  17. {
  18. public:
  19. CText();
  20. ~CText();
  21. void SetTextAlignment(BSTR pwszAlignment);
  22. void SetTextColor(COLORREF clrColor);
  23. void SetFontStyle(BSTR pwszFontStyle);
  24. void SetFontFace(BSTR pwszFontFace);
  25. void SetFontSize(long lSize);
  26. void SetFixedSizeFont(bool fFixed);
  27. HRESULT RealizeFont(HDC hdc);
  28. HRESULT Write(HDC hdc, const RECT & rc, const WCHAR * pwszText);
  29. HRESULT GetTextWidth(HDC hdc, const WCHAR * pwszText, SIZE *pSize);
  30. private:
  31. HFONT m_hFont;
  32. bool m_fDirty; //true when we need to recalc font and bounding rect
  33. UINT m_uiState;
  34. CComBSTR m_bstrFontFace;
  35. CComBSTR m_bstrFontStyle;
  36. UINT m_uiFontSize;
  37. UINT m_uiAlignment;
  38. COLORREF m_clrTextColor;
  39. BYTE m_fFontStyleFlags;
  40. bool m_fFixedSizeFont;
  41. };
  42. #endif //__CTEXT_H_