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.

116 lines
2.7 KiB

  1. /*
  2. * _DISPML.H
  3. *
  4. * Purpose:
  5. * CDisplaySL class. Single-line display.
  6. *
  7. * Authors:
  8. * Eric Vasilik
  9. */
  10. #ifndef _DISPSL_H
  11. #define _DISPSL_H
  12. #include "_disp.h"
  13. // Forward declaration
  14. class CTxtSelection;
  15. class CDisplaySL : public CDisplay, private CLine
  16. {
  17. public:
  18. CDisplaySL ( CTxtEdit* ped );
  19. protected:
  20. // The following are pure functions from the base
  21. // Helpers
  22. virtual BOOL Init();
  23. void InitVars();
  24. // Line breaking
  25. BOOL RecalcLine();
  26. // Rendering
  27. virtual VOID Render(const RECTUV &rcView, const RECTUV &rcRender);
  28. // Scrolling and scroller bars
  29. virtual BOOL UpdateScrollBar(INT nBar, BOOL fUpdateRange = FALSE);
  30. virtual LONG GetScrollRange(INT nBar) const;
  31. // Getting properties
  32. virtual void InitLinePtr ( CLinePtr & plp );
  33. virtual BOOL IsMain() const;
  34. //Get width of widest line
  35. virtual LONG GetDupLineMax() const;
  36. // Width, height and line count (of all text)
  37. virtual LONG GetHeight() const;
  38. virtual LONG GetResizeHeight() const;
  39. virtual LONG LineCount() const;
  40. // Visible view properties
  41. virtual LONG GetCliVisible(
  42. LONG *pcpMostVisible = NULL,
  43. BOOL fLastCharOfLastVisible = FALSE) const;
  44. virtual LONG GetFirstVisibleLine() const;
  45. // Line info
  46. virtual LONG GetLineText(LONG ili, TCHAR *pchBuff, LONG cchMost);
  47. virtual LONG CpFromLine(LONG ili, LONG *pdvpLine = NULL);
  48. virtual LONG LineFromCp(LONG cp, BOOL fAtEnd);
  49. // Point <-> cp conversion
  50. virtual LONG CpFromPoint(
  51. POINTUV pt,
  52. const RECTUV *prcClient,
  53. CRchTxtPtr * const ptp,
  54. CLinePtr * const prp,
  55. BOOL fAllowEOL,
  56. HITTEST *pHit = NULL,
  57. CDispDim *pdispdim = 0,
  58. LONG *pcpActual = NULL,
  59. CLine *pliParent = NULL);
  60. virtual LONG PointFromTp (
  61. const CRchTxtPtr &tp,
  62. const RECTUV *prcClient,
  63. BOOL fAtEnd,
  64. POINTUV &pt,
  65. CLinePtr * const prp,
  66. UINT taMode,
  67. CDispDim *pdispdim = 0);
  68. // Line break recalc
  69. virtual BOOL RecalcView(BOOL fUpdateScrollBars, RECTUV* prc = NULL);
  70. virtual BOOL WaitForRecalcIli(LONG ili);
  71. // Complete updating (recalc + rendering)
  72. virtual BOOL UpdateView(CRchTxtPtr &tpFirst, LONG cchOld, LONG cchNew);
  73. // Scrolling
  74. virtual BOOL ScrollView(LONG upScroll, LONG vpScroll, BOOL fTracking, BOOL fFractionalScroll);
  75. // Selection
  76. virtual BOOL InvertRange(LONG cp, LONG cch, SELDISPLAYACTION selAction);
  77. // Natural size calculation
  78. virtual HRESULT GetNaturalSize(
  79. HDC hdcDraw,
  80. HDC hicTarget,
  81. DWORD dwMode,
  82. LONG *pwidth,
  83. LONG *pheight);
  84. virtual BOOL GetWordWrap() const;
  85. virtual CDisplay *Clone() const;
  86. virtual LONG GetMaxUScroll() const;
  87. };
  88. #endif