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.

71 lines
2.7 KiB

  1. /*
  2. * _LAYOUT.H
  3. *
  4. * Purpose:
  5. * CLayout class
  6. *
  7. * Owner:<nl>
  8. * Murray Sargent: Initial table implementation
  9. * Keith Curtis: Factored into a separate class for
  10. * performance, simplicity
  11. *
  12. * Copyright (c) 1999-2000, Microsoft Corporation. All rights reserved.
  13. */
  14. #ifndef _LAYOUT_H
  15. #define _LAYOUT_H
  16. #include "_format.h"
  17. // ========================== CLayout ===================================
  18. // Holds an array of lines and has the ability to do rich layout.
  19. class CLayout : public CLineArray //CLayout *plo;
  20. {
  21. public:
  22. CLayout() {_iCFCells = -1; _iPFCells = -1;}
  23. ~CLayout() {DeleteSubLayouts(0, -1); ReleaseFormats(_iCFCells, _iPFCells);}
  24. void DeleteSubLayouts(LONG ili, LONG cLine);
  25. virtual BOOL IsNestedLayout() const {return TRUE;}
  26. BOOL IsTableRow() {return _iPFCells >= 0;}
  27. //Helper routines
  28. LONG LineFromVpos (CDisplayML *pdp, LONG vPos, LONG *pdvpLine, LONG *pcpFirst);
  29. LONG VposFromLine (CDisplayML *pdp, LONG ili);
  30. const CCharFormat *GetCFCells();
  31. const CParaFormat *GetPFCells() const;
  32. static const CLayout *GetLORowAbove(CLine *pli, LONG ili,
  33. CLine *pliMain = NULL, LONG iliMain = 0);
  34. TFLOW GetTflow() const {return _tflow;}
  35. void SetTflow(TFLOW tflow) {_tflow = tflow;}
  36. static CLine * FindTopCell(LONG &cch, CLine *pli, LONG &ili, LONG dul, LONG &dy,
  37. LONG *pdyHeight, CLine *pliMain, LONG iliMain, LONG *pcLine);
  38. CLine * FindTopRow(CLine *pliStart, LONG ili, CLine *pliMain, LONG iliMain, const CParaFormat *pPF);
  39. LONG GetVertAlignShift(LONG uCell, LONG dypText);
  40. //The Big 4 methods
  41. BOOL Measure (CMeasurer& me, CLine *pli, LONG ili, UINT uiFlags,
  42. CLine *pliTarget = NULL, LONG iliMain = 0, CLine *pliMain = NULL, LONG *pdvpMax = NULL);
  43. BOOL Render(CRenderer &re, CLine *pli, const RECTUV *prcView, BOOL fLastLine, LONG ili, LONG cLine);
  44. LONG CpFromPoint(CMeasurer &me, POINTUV pt, const RECTUV *prcClient,
  45. CRchTxtPtr * const ptp, CLinePtr * const prp, BOOL fAllowEOL,
  46. HITTEST *pHit, CDispDim *pdispdim, LONG *pcpActual,
  47. CLine *pliParent = NULL, LONG iliParent = 0);
  48. LONG PointFromTp (CMeasurer &me, const CRchTxtPtr &tp, const RECTUV *prcClient, BOOL fAtEnd,
  49. POINTUV &pt, CLinePtr * const prp, UINT taMode, CDispDim *pdispdim = NULL);
  50. LONG _dvp; // The height of the array
  51. protected:
  52. LONG _cpMin; // First character in layout
  53. // REVIEW: _tflow and _dvlBrdrTop can be BYTEs
  54. LONG _tflow; // Textflow for layout
  55. WORD _dvpBrdrTop; // Max table row top border
  56. WORD _dvpBrdrBot; // Max table row bottom border
  57. SHORT _iCFCells; // iCF for CLines representing table-row cells
  58. SHORT _iPFCells; // iPF for CLines representing table-row cells
  59. };
  60. #endif //_LAYOUT_H