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.

119 lines
2.9 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 RECT &rcView, const RECT &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. // maximum height and width
  35. virtual LONG GetMaxWidth() const;
  36. virtual LONG GetMaxHeight() const;
  37. virtual LONG GetMaxPixelWidth() const;
  38. // Width, height and line count (of all text)
  39. virtual LONG GetWidth() const;
  40. virtual LONG GetHeight() const;
  41. virtual LONG GetResizeHeight() const;
  42. virtual LONG LineCount() const;
  43. // Visible view properties
  44. virtual LONG GetCliVisible(
  45. LONG *pcpMostVisible = NULL,
  46. BOOL fLastCharOfLastVisible = FALSE) const;
  47. virtual LONG GetFirstVisibleLine() const;
  48. // Line info
  49. virtual LONG GetLineText(LONG ili, TCHAR *pchBuff, LONG cchMost);
  50. virtual LONG CpFromLine(LONG ili, LONG *pyLine = NULL);
  51. virtual LONG LineFromCp(LONG cp, BOOL fAtEnd);
  52. // Point <-> cp conversion
  53. virtual LONG CpFromPoint(
  54. POINT pt,
  55. const RECT *prcClient,
  56. CRchTxtPtr * const ptp,
  57. CLinePtr * const prp,
  58. BOOL fAllowEOL,
  59. HITTEST *pHit = NULL,
  60. CDispDim *pdispdim = 0,
  61. LONG *pcpActual = NULL);
  62. virtual LONG PointFromTp (
  63. const CRchTxtPtr &tp,
  64. const RECT *prcClient,
  65. BOOL fAtEnd,
  66. POINT &pt,
  67. CLinePtr * const prp,
  68. UINT taMode,
  69. CDispDim *pdispdim = 0);
  70. // Line break recalc
  71. virtual BOOL RecalcView(BOOL fUpdateScrollBars, RECT* prc = NULL);
  72. virtual BOOL WaitForRecalcIli(LONG ili);
  73. // Complete updating (recalc + rendering)
  74. virtual BOOL UpdateView(const CRchTxtPtr &tpFirst, LONG cchOld, LONG cchNew);
  75. // Scrolling
  76. virtual BOOL ScrollView(LONG xScroll, LONG yScroll, BOOL fTracking, BOOL fFractionalScroll);
  77. // Selection
  78. virtual BOOL InvertRange(LONG cp, LONG cch, SELDISPLAYACTION selAction);
  79. // Natural size calculation
  80. virtual HRESULT GetNaturalSize(
  81. HDC hdcDraw,
  82. HDC hicTarget,
  83. DWORD dwMode,
  84. LONG *pwidth,
  85. LONG *pheight);
  86. virtual BOOL GetWordWrap() const;
  87. virtual CDisplay *Clone() const;
  88. virtual LONG GetMaxXScroll() const;
  89. };
  90. #endif