Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes

fp_VerticalContainer Class Reference

#include <fp_Column.h>

Inheritance diagram for fp_VerticalContainer:
fp_Container fp_ContainerObject fp_AnnotationContainer fp_CellContainer fp_Column fp_EndnoteContainer fp_FootnoteContainer fp_FrameContainer fp_HdrFtrContainer fp_ShadowContainer fp_TableContainer fp_TOCContainer

List of all members.

Public Member Functions

 fp_VerticalContainer (FP_ContainerType iType, fl_SectionLayout *pSectionLayout)
virtual ~fp_VerticalContainer ()
virtual void setWidth (UT_sint32)
void _setWidth (UT_sint32 iWidth)
virtual void setHeight (UT_sint32)
void _setHeight (UT_sint32 iHeight)
virtual void setMaxHeight (UT_sint32)
virtual void setX (UT_sint32, bool bDontClearIfNeeded=false)
virtual void setY (UT_sint32)
UT_sint32 getMaxHeight (void) const
virtual UT_sint32 getWidth (void) const
virtual UT_sint32 getX (void) const
void _setX (UT_sint32 iX)
virtual UT_sint32 getY (void) const
UT_sint32 getY (GR_Graphics *pG) const
void _setY (UT_sint32 iY)
virtual UT_sint32 getHeight (void) const
UT_sint32 getColumnGap (void) const
bool getIntentionallyEmpty (void) const
void setIntentionallyEmpty (bool b)
fp_ContainergetFirstContainer (void) const
fp_ContainergetLastContainer (void) const
UT_sint32 getYoffsetFromTable (fp_Container *pT, fp_Container *pCell, fp_ContainerObject *pCon)
bool insertContainerAfter (fp_Container *pNewContainer, fp_Container *pAfterContainer)
bool insertContainer (fp_Container *)
bool addContainer (fp_Container *)
void removeContainer (fp_Container *pContainer, bool bClear=false)
void removeAll (void)
virtual UT_uint32 distanceFromPoint (UT_sint32 x, UT_sint32 y)
virtual void mapXYToPosition (UT_sint32 xPos, UT_sint32 yPos, PT_DocPosition &pos, bool &bBOL, bool &bEOL, bool &isTOC)
void getOffsets (fp_ContainerObject *pContainer, UT_sint32 &xoff, UT_sint32 &yoff)
fp_TableContainergetCorrectBrokenTable (fp_Container *pLine)
fp_TOCContainergetCorrectBrokenTOC (fp_Container *pLine)
void getScreenOffsets (fp_ContainerObject *pContainer, UT_sint32 &xoff, UT_sint32 &yoff)
virtual UT_RectgetScreenRect ()
virtual void markDirtyOverlappingRuns (UT_Rect &recScreen)
UT_sint32 countWrapped (void)
virtual void draw (dg_DrawArgs *)
virtual void draw (GR_Graphics *)
void clearScreen (void)
void bumpContainers (fp_ContainerObject *pLastContainerToKeep)
virtual bool isVBreakable (void)
virtual bool isHBreakable (void)
virtual UT_sint32 wantVBreakAt (UT_sint32)
virtual UT_sint32 wantHBreakAt (UT_sint32)
virtual fp_ContainerObjectVBreakAt (UT_sint32)
virtual fp_ContainerObjectHBreakAt (UT_sint32)
void recalcMaxWidth (bool bDontClearIfNeeded=false)
virtual UT_sint32 getMarginBefore (void) const
virtual UT_sint32 getMarginAfter (void) const
virtual void setAssignedScreenHeight (UT_sint32)
virtual fp_ContainergetNextContainerInSection (void) const
virtual fp_ContainergetPrevContainerInSection (void) const
bool validate (void)
FV_ViewgetView (void) const
UT_sint32 getNumWrapped (void) const
void addWrappedLine (fp_Line *pLine)
void clearWrappedLines (void)
fp_LinegetNthWrappedLine (UT_sint32 i)
virtual fp_ContainergetFirstBrokenContainer () const
virtual UT_sint32 getLastWantedVBreak (void) const
virtual void setLastWantedVBreak (UT_sint32)
virtual void deleteBrokenAfter (bool)

Protected Member Functions

void _setMaxContainerHeight (UT_sint32 iContainerHeight)
UT_sint32 _getMaxContainerHeight (void) const
virtual void _drawBoundaries (dg_DrawArgs *pDA)

Protected Attributes

UT_sint32 m_iRedrawHeight

Private Attributes

UT_sint32 m_iWidth
UT_sint32 m_iHeight
UT_sint32 m_iMaxHeight
UT_sint32 m_iX
UT_sint32 m_iY
bool m_bIntentionallyEmpty
UT_sint32 m_imaxContainerHeight
UT_GenericVector< fp_Line * > m_vecWrappedLines

Constructor & Destructor Documentation

fp_VerticalContainer::fp_VerticalContainer ( FP_ContainerType  iType,
fl_SectionLayout pSectionLayout 
)

Create container

Parameters:
iType Container type
pSectionLayout Section layout type used for this container

References clearWrappedLines(), fp_ContainerObject::getDocSectionLayout(), and UT_ASSERT.

fp_VerticalContainer::~fp_VerticalContainer (  )  [virtual]

Destruct container

Note:
The Containers in vector of the container are not destructed. They are owned by the logical hierarchy (i.e., the fl_Container classes like fl_BlockLayout), not the physical hierarchy.

Member Function Documentation

UT_sint32 fp_VerticalContainer::_getMaxContainerHeight ( void   )  const [protected]

Returns the maximum line height as determined from the layout method This used by the draw method to determine if a line should be drawn in a clipping rectangle

References m_imaxContainerHeight.

Referenced by fp_CellContainer::draw(), draw(), fp_CellContainer::drawBroken(), fp_TOCContainer::layout(), fp_CellContainer::layout(), fp_FrameContainer::layout(), fp_EndnoteContainer::layout(), fp_AnnotationContainer::layout(), fp_FootnoteContainer::layout(), and fp_Column::layout().

void fp_VerticalContainer::_setHeight ( UT_sint32  iHeight  )  [inline]
void fp_VerticalContainer::_setMaxContainerHeight ( UT_sint32  iLineHeight  )  [protected]

Set the maximum line Height

Parameters:
UT_sint32 iLineHeight the largest line height yet found.

References m_imaxContainerHeight.

Referenced by fp_TOCContainer::layout(), fp_CellContainer::layout(), fp_FrameContainer::layout(), fp_EndnoteContainer::layout(), fp_AnnotationContainer::layout(), fp_FootnoteContainer::layout(), and fp_Column::layout().

void fp_VerticalContainer::_setWidth ( UT_sint32  iWidth  )  [inline]
void fp_VerticalContainer::addWrappedLine ( fp_Line pLine  )  [inline]

Referenced by fp_Column::layout().

void fp_VerticalContainer::clearWrappedLines ( void   )  [inline]
virtual void fp_VerticalContainer::deleteBrokenAfter ( bool   )  [inline, virtual]
UT_uint32 fp_VerticalContainer::distanceFromPoint ( UT_sint32  x,
UT_sint32  y 
) [virtual]

Compute the distance from point to the container's circumference

Parameters:
x X coordinate of point
y Y coordinate of point
Returns:
Distance between container's circumference and point

Implements fp_Container.

References fp_ContainerObject::getGraphics(), m_iHeight, m_iWidth, m_iX, m_iY, and GR_Graphics::tlu().

Referenced by fp_Page::mapXYToPosition().

virtual void fp_VerticalContainer::draw ( GR_Graphics  )  [inline, virtual]
UT_sint32 fp_VerticalContainer::getColumnGap ( void   )  const

Get column gap from page the container is located on

Returns:
Column gap

References fp_Container::getColumn(), fp_Page::getColumnGap(), and fp_Container::getPage().

fp_TOCContainer * fp_VerticalContainer::getCorrectBrokenTOC ( fp_Container pCon  ) 
virtual fp_Container* fp_VerticalContainer::getFirstBrokenContainer (  )  const [inline, virtual]
virtual UT_sint32 fp_VerticalContainer::getHeight ( void   )  const [inline, virtual]

Get container's height

Returns:
Height

Implements fp_ContainerObject.

Reimplemented in fp_FrameContainer, fp_TableContainer, and fp_TOCContainer.

Referenced by fb_ColumnBreaker::_breakSection(), fb_ColumnBreaker::_checkVBreakableContainer(), fp_CellContainer::_clear(), fp_CellContainer::_drawBoundaries(), fp_Column::_drawBoundaries(), fp_Page::_reformatAnnotations(), fp_Page::_reformatColumns(), fp_Page::_reformatFootnotes(), fp_TableContainer::breakCellsAt(), fp_Page::breakPage(), fp_Line::clearScreen(), fp_EndnoteContainer::clearScreen(), fp_AnnotationContainer::clearScreen(), fp_TableContainer::containsAnnotations(), fp_CellContainer::containsAnnotations(), fp_TableContainer::containsFootnoteReference(), fp_CellContainer::containsFootnoteReference(), fp_TableContainer::deleteBrokenAfter(), fp_CellContainer::doVertAlign(), fp_CellContainer::draw(), fp_Page::draw(), fp_EndnoteContainer::draw(), fp_AnnotationContainer::draw(), fp_FootnoteContainer::draw(), fp_CellContainer::drawBroken(), fp_CellContainer::drawLines(), fp_TableContainer::getAnnotationContainers(), fp_CellContainer::getAnnotationContainers(), fp_Page::getAnnotationHeight(), fp_Page::getAvailableHeight(), fp_Page::getAvailableHeightForColumn(), fp_Page::getFilledHeight(), fp_TableContainer::getFootnoteContainers(), fp_CellContainer::getFootnoteContainers(), fp_Page::getFootnoteHeight(), getScreenRect(), fp_CellContainer::getSpannedHeight(), fp_TOCContainer::layout(), fp_CellContainer::layout(), fp_EndnoteContainer::layout(), fp_AnnotationContainer::layout(), fp_FootnoteContainer::layout(), fp_HdrFtrContainer::layout(), fp_ShadowContainer::layout(), fp_Column::layout(), fp_Page::mapXYToPosition(), fb_ColumnBreaker::needsRebreak(), fp_CellContainer::setHeight(), fp_TableContainer::setToAllocation(), fp_TableContainer::sumFootnoteHeight(), fp_TOCContainer::VBreakAt(), fp_CellContainer::VBreakAt(), and fp_TableContainer::wantVBreakAtNoFootnotes().

bool fp_VerticalContainer::getIntentionallyEmpty ( void   )  const [inline]

Get container's intentionally empty flag

Returns:
Empty
fp_Container * fp_VerticalContainer::getLastContainer ( void   )  const
virtual UT_sint32 fp_VerticalContainer::getLastWantedVBreak ( void   )  const [inline, virtual]
virtual UT_sint32 fp_VerticalContainer::getMarginAfter ( void   )  const [inline, virtual]

Implements fp_Container.

Reimplemented in fp_TableContainer.

virtual UT_sint32 fp_VerticalContainer::getMarginBefore ( void   )  const [inline, virtual]

Implements fp_Container.

Reimplemented in fp_TableContainer.

UT_sint32 fp_VerticalContainer::getMaxHeight ( void   )  const [inline]
virtual fp_Container* fp_VerticalContainer::getNextContainerInSection ( void   )  const [inline, virtual]
fp_Line* fp_VerticalContainer::getNthWrappedLine ( UT_sint32  i  )  [inline]
UT_sint32 fp_VerticalContainer::getNumWrapped ( void   )  const [inline]
virtual fp_Container* fp_VerticalContainer::getPrevContainerInSection ( void   )  const [inline, virtual]
UT_sint32 fp_VerticalContainer::getY ( void   )  const [virtual]

Get container's Y position.

Returns:
Y position

Implements fp_ContainerObject.

Reimplemented in fp_EndnoteContainer, and fp_FrameContainer.

References FL_CONTAINER_DOCSECTION, fl_ContainerLayout::getContainerType(), fp_ContainerObject::getContainerType(), fl_ContainerLayout::getDocSectionLayout(), fp_ContainerObject::getSectionLayout(), fl_DocSectionLayout::getTopMargin(), getView(), m_iY, and VIEW_PRINT.

Referenced by fp_CellContainer::_clear(), fp_TableContainer::_drawBoundaries(), fp_CellContainer::_drawBoundaries(), fp_TableContainer::_drawBrokenBoundaries(), fp_CellContainer::_getBrokenRect(), AP_LeftRuler::_getCellMarkerRects(), FV_View::_getMouseContext(), FV_View::_moveInsPtNextPrevLine(), fp_TOCContainer::adjustBrokenTOCs(), fp_TableContainer::breakCellsAt(), fp_TOCContainer::clearScreen(), fp_CellContainer::clearScreen(), fp_AnnotationContainer::clearScreen(), fp_FootnoteContainer::clearScreen(), fp_TableContainer::containsAnnotations(), fp_CellContainer::containsAnnotations(), fp_TableContainer::containsFootnoteReference(), fp_CellContainer::containsFootnoteReference(), fp_TableContainer::deleteBrokenAfter(), fp_CellContainer::deleteBrokenAfter(), fp_CellContainer::doesOverlapBrokenTable(), fl_TableLayout::doSimpleChange(), fp_CellContainer::doVertAlign(), fp_CellContainer::draw(), fp_Page::draw(), fp_AnnotationContainer::draw(), fp_FootnoteContainer::draw(), fp_CellContainer::drawBroken(), fp_TableContainer::getAnnotationContainers(), fp_CellContainer::getAnnotationContainers(), fp_FrameContainer::getBlocksAroundFrame(), fp_CellContainer::getBrokenTable(), fp_CellContainer::getCellY(), fp_TableContainer::getFootnoteContainers(), fp_CellContainer::getFootnoteContainers(), fp_CellContainer::getLeftTopOffsets(), getOffsets(), getScreenOffsets(), fp_CellContainer::getScreenPositions(), fp_CellContainer::getSpannedHeight(), fp_TableContainer::isInBrokenTable(), fp_TableContainer::layout(), fp_CellContainer::layout(), fp_Column::layout(), fp_TableContainer::mapXYToPosition(), fp_Page::mapXYToPosition(), mapXYToPosition(), fp_TOCContainer::setY(), fp_TableContainer::setY(), fp_TOCContainer::VBreakAt(), fp_TableContainer::VBreakAt(), fp_CellContainer::VBreakAt(), fp_CellContainer::wantCellVBreakAt(), and fp_TableContainer::wantVBreakAtNoFootnotes().

UT_sint32 fp_VerticalContainer::getY ( GR_Graphics pG  )  const

Get container's Y position. This version checks for a mismatch between view mode and if we're printing.

Returns:
Y position

References GR_Graphics::DGP_SCREEN, fp_ContainerObject::getSectionLayout(), getView(), m_iY, GR_Graphics::queryProperties(), and VIEW_PRINT.

UT_sint32 fp_VerticalContainer::getYoffsetFromTable ( fp_Container pT,
fp_Container pCell,
fp_ContainerObject pCon 
)

This method returns the vertical offset due to a table broken across more than 1 page.

References fp_Container::getNext(), fp_TableContainer::getYBreak(), and fp_TableContainer::isInBrokenTable().

Referenced by getOffsets(), and getScreenOffsets().

virtual fp_ContainerObject* fp_VerticalContainer::HBreakAt ( UT_sint32   )  [inline, virtual]
bool fp_VerticalContainer::insertContainerAfter ( fp_Container pNewContainer,
fp_Container pAfterContainer 
)

Insert line in container after specified line

Parameters:
pNewContainer Container to be inserted
pAfterContainer After this line
Todo:
This function has been hacked to handle the case where pAfterContainer is NULL. That case should not happen. Bad callers should be identified and fixed, and this function should be cleaned up.

References fp_Container::addCon(), fp_ContainerObject::clearScreen(), fp_Container::countCons(), fp_Container::findCon(), fp_ContainerObject::getContainerType(), fp_ContainerObject::getDocSectionLayout(), fp_Container::insertConAt(), fp_Container::recalcMaxWidth(), fp_Container::setContainer(), UT_ASSERT, and UT_return_val_if_fail.

Referenced by fl_BlockLayout::getNewContainer(), fl_BlockLayout::getNextWrappedLine(), and FL_DocLayout::insertEndnoteContainer().

virtual bool fp_VerticalContainer::isHBreakable ( void   )  [inline, virtual]
virtual bool fp_VerticalContainer::isVBreakable ( void   )  [inline, virtual]
void fp_VerticalContainer::mapXYToPosition ( UT_sint32  x,
UT_sint32  y,
PT_DocPosition pos,
bool &  bBOL,
bool &  bEOL,
bool &  isTOC 
) [virtual]

Find document position from X and Y coordinates

Parameters:
x X coordinate
y Y coordinate
Return values:
pos Document position
bBOL True if position is at begining of line, otherwise false
bEOL True if position is at end of line, otherwise false

Implements fp_ContainerObject.

Reimplemented in fp_TableContainer, and fp_TOCContainer.

References fl_ContainerLayout::canContainPoint(), fp_Line::canContainPoint(), fp_Container::countCons(), FP_CONTAINER_CELL, FP_CONTAINER_COLUMN, FP_CONTAINER_TABLE, FP_CONTAINER_TOC, fp_Line::getBlock(), fp_CellContainer::getBrokenTable(), fp_Container::getContainer(), fp_ContainerObject::getContainerType(), fp_Page::getDocLayout(), fl_SectionLayout::getFirstBlock(), fl_BlockLayout::getFirstRun(), FL_DocLayout::getFirstSection(), fl_FrameLayout::getFrameType(), fp_ContainerObject::getHeight(), fp_CellContainer::getLeftAttach(), fp_Run::getLine(), fp_Line::getMaxWidth(), fp_Container::getNext(), fl_ContainerLayout::getNextBlockInDocument(), fp_Container::getNthCon(), fp_Container::getPage(), fl_ContainerLayout::getPosition(), fl_ContainerLayout::getPrevBlockInDocument(), fp_ContainerObject::getSectionLayout(), fp_Line::getX(), fp_ContainerObject::getX(), getX(), fp_Line::getY(), getY(), fp_ContainerObject::getY(), fp_TableContainer::getYBottom(), fp_Line::isSameYAsPrevious(), fp_Line::isWrapped(), fp_Line::mapXYToPosition(), fp_ContainerObject::mapXYToPosition(), fp_TableContainer::mapXYToPosition(), UT_ASSERT_HARMLESS, UT_MIN, UT_return_if_fail, UT_SHOULD_NOT_HAPPEN, and xxx_UT_DEBUGMSG.

Referenced by fp_TableContainer::mapXYToPosition(), and fp_Page::mapXYToPosition().

void fp_VerticalContainer::markDirtyOverlappingRuns ( UT_Rect recScreen  )  [virtual]

Marks Dirty any runs that overlap the supplied rectangle. This rectangle is relative to the screen.

Implements fp_ContainerObject.

References fp_Container::countCons(), DELETEP, fp_Container::getNthCon(), getScreenRect(), UT_Rect::intersectsRect(), and fp_ContainerObject::markDirtyOverlappingRuns().

Referenced by fp_Page::markDirtyOverlappingRuns().

void fp_VerticalContainer::recalcMaxWidth ( bool  bDontClearIfNeeded = false  )  [inline, virtual]

Implements fp_Container.

Reimplemented in fp_CellContainer.

References UT_UNUSED.

void fp_VerticalContainer::removeAll ( void   ) 

remove all contains from this.

References fp_Container::countCons(), and fp_Container::deleteNthCon().

Referenced by fl_DocSectionLayout::format().

void fp_VerticalContainer::removeContainer ( fp_Container pContainer,
bool  bClear = false 
)
virtual void fp_VerticalContainer::setAssignedScreenHeight ( UT_sint32   )  [inline, virtual]

Implements fp_Container.

Reimplemented in fp_CellContainer.

void fp_VerticalContainer::setIntentionallyEmpty ( bool  b  )  [inline]

Set container's intentionally empty flag

virtual void fp_VerticalContainer::setLastWantedVBreak ( UT_sint32   )  [inline, virtual]
void fp_VerticalContainer::setMaxHeight ( UT_sint32  iMaxHeight  )  [virtual]
void fp_VerticalContainer::setX ( UT_sint32  iX,
bool  bDontClearIfNeeded = false 
) [virtual]

Set X position of container

Parameters:
iX New X position

Before the postition of the container is changed, its content is first cleared from the screen.

Implements fp_ContainerObject.

References clearScreen(), and m_iX.

Referenced by fp_Page::_reformatAnnotations(), fp_Page::_reformatColumns(), fp_Page::_reformatFootnotes(), fp_TableContainer::layout(), fl_BlockLayout::setFramesOnPage(), fp_CellContainer::setToAllocation(), and fp_Page::updateColumnX().

void fp_VerticalContainer::setY ( UT_sint32  iY  )  [virtual]

Set Y position of container

Parameters:
iY New Y position

Before the postition of the container is changed, its content is first cleared from the screen.

Implements fp_ContainerObject.

Reimplemented in fp_AnnotationContainer, fp_EndnoteContainer, fp_TableContainer, and fp_TOCContainer.

References clearScreen(), and m_iY.

Referenced by fp_Page::_reformatColumns(), fp_Page::_reformatFootnotes(), fl_TableLayout::doSimpleChange(), fp_CellContainer::doVertAlign(), fp_CellContainer::layout(), fl_BlockLayout::setFramesOnPage(), fp_Page::TopBotMarginChanged(), and fp_CellContainer::VBreakAt().

virtual fp_ContainerObject* fp_VerticalContainer::VBreakAt ( UT_sint32   )  [inline, virtual]
virtual UT_sint32 fp_VerticalContainer::wantHBreakAt ( UT_sint32   )  [inline, virtual]
virtual UT_sint32 fp_VerticalContainer::wantVBreakAt ( UT_sint32   )  [inline, virtual]

Member Data Documentation

Set if this container is intentionally left empty

The breakSection function that does page layout sometimes decides to leave sections empty for one reason or another. This needs to be flagged, or fl_DocSectionLayout::deleteEmptyColumns will delete the container.

Maximum height of the container

Referenced by _drawBoundaries(), and setMaxHeight().

X coordinate of container

Referenced by distanceFromPoint(), getX(), and setX().

Y coordinate of container

Reimplemented in fp_EndnoteContainer.

Referenced by distanceFromPoint(), getY(), and setY().


The documentation for this class was generated from the following files: