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_EndnoteSectionContainer 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)
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)
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)

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_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

void fp_VerticalContainer::setWidth ( UT_sint32  iWidth  )  [virtual]

void fp_VerticalContainer::_setWidth ( UT_sint32  iWidth  )  [inline]

void fp_VerticalContainer::setHeight ( UT_sint32  iHeight  )  [virtual]

void fp_VerticalContainer::_setHeight ( UT_sint32  iHeight  )  [inline]

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]

UT_sint32 fp_VerticalContainer::getMaxHeight ( void   )  const [inline]

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

UT_sint32 fp_VerticalContainer::getX ( void   )  const [virtual]

void fp_VerticalContainer::_setX ( UT_sint32  iX  )  [inline]

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 fb_ColumnBreaker::_breakTable(), fb_ColumnBreaker::_breakTOC(), fp_TableContainer::_brokenDraw(), 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_TableContainer::adjustBrokenTables(), fp_TOCContainer::adjustBrokenTOCs(), fp_TableContainer::breakCellsAt(), fp_TOCContainer::clearScreen(), fp_CellContainer::clearScreen(), fp_AnnotationContainer::clearScreen(), fp_FootnoteContainer::clearScreen(), fp_CellContainer::doesOverlapBrokenTable(), fl_TableLayout::doSimpleChange(), fp_CellContainer::draw(), fp_Page::draw(), fp_AnnotationContainer::draw(), fp_FootnoteContainer::draw(), fp_CellContainer::drawBroken(), fp_FrameContainer::getBlocksAroundFrame(), fp_CellContainer::getBrokenTable(), fp_CellContainer::getCellY(), fp_FrameContainer::getFullY(), fp_CellContainer::getLeftTopOffsets(), getOffsets(), getScreenOffsets(), fp_CellContainer::getScreenPositions(), fp_CellContainer::getSpannedHeight(), fp_FrameContainer::getY(), fp_TableContainer::getYOfRow(), 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_CellContainer::tweakBrokenTable(), fp_TOCContainer::VBreakAt(), fp_TableContainer::VBreakAt(), fp_CellContainer::VBreakAt(), fp_TableContainer::wantVBreakAt(), and fp_CellContainer::wantVBreakAt().

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.

void fp_VerticalContainer::_setY ( UT_sint32  iY  )  [inline]

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

Get container's height

Returns:
Height

Implements fp_ContainerObject.

Reimplemented in fp_FrameContainer.

Referenced by fp_TableContainer::_brokenDraw(), fp_CellContainer::_clear(), fp_CellContainer::_drawBoundaries(), fp_Column::_drawBoundaries(), fp_Page::_reformatAnnotations(), fp_Page::_reformatColumns(), fp_Page::_reformatFootnotes(), fp_TableContainer::adjustBrokenTables(), fp_TOCContainer::adjustBrokenTOCs(), fp_TableContainer::breakCellsAt(), fp_Page::breakPage(), fb_ColumnBreaker::breakSection(), fp_Line::clearScreen(), fp_EndnoteContainer::clearScreen(), fp_AnnotationContainer::clearScreen(), fp_CellContainer::draw(), fp_Page::draw(), fp_EndnoteContainer::draw(), fp_AnnotationContainer::draw(), fp_FootnoteContainer::draw(), fp_CellContainer::drawBroken(), fp_CellContainer::drawLines(), fp_Page::getAnnotationHeight(), fp_Page::getAvailableHeight(), fp_Page::getAvailableHeightForColumn(), fp_Page::getFilledHeight(), fp_Page::getFootnoteHeight(), fp_FrameContainer::getFullHeight(), fp_TOCContainer::getHeight(), fp_TableContainer::getHeight(), fp_FrameContainer::getHeight(), 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(), fp_CellContainer::setHeight(), fp_CellContainer::setLineMarkers(), fp_TableContainer::setToAllocation(), fp_CellContainer::tweakBrokenTable(), fp_TOCContainer::VBreakAt(), fp_TableContainer::VBreakAt(), fp_CellContainer::VBreakAt(), fp_TableContainer::wantVBreakAt(), and fp_CellContainer::wantVBreakAt().

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().

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

Get container's intentionally empty flag

Returns:
Empty

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

Set container's intentionally empty flag

fp_Container * fp_VerticalContainer::getFirstContainer ( void   )  const

fp_Container * fp_VerticalContainer::getLastContainer ( void   )  const

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().

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_CONTAINER_ANNOTATION, FP_CONTAINER_LINE, fp_ContainerObject::getContainerType(), 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().

bool fp_VerticalContainer::insertContainer ( fp_Container pNewContainer  ) 

bool fp_VerticalContainer::addContainer ( fp_Container pNewContainer  ) 

void fp_VerticalContainer::removeContainer ( fp_Container pContainer,
bool  bClear = false 
)

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_TableContainer::mapXYToPosition(), and fp_Page::mapXYToPosition().

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(), FL_FRAME_WRAPPER_IMAGE, FP_CONTAINER_CELL, FP_CONTAINER_COLUMN, FP_CONTAINER_FRAME, FP_CONTAINER_LINE, FP_CONTAINER_TABLE, FP_CONTAINER_TOC, fp_Line::getBlock(), 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(), getX(), fp_ContainerObject::getX(), fp_Line::getY(), getY(), fp_ContainerObject::getY(), 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_TOCContainer::mapXYToPosition(), fp_TableContainer::mapXYToPosition(), and fp_Page::mapXYToPosition().

void fp_VerticalContainer::getOffsets ( fp_ContainerObject pContainer,
UT_sint32 xoff,
UT_sint32 yoff 
)

Get line's offsets relative to this container

Parameters:
pContainer Container
Return values:
xoff Container's X offset relative to container
yoff Container's Y offset relative to container

References FL_DocLayout::displayAnnotations(), fl_HdrFtrSectionLayout::findShadow(), FP_CONTAINER_ANNOTATION, FP_CONTAINER_CELL, FP_CONTAINER_COLUMN, FP_CONTAINER_COLUMN_SHADOW, FP_CONTAINER_FOOTNOTE, FP_CONTAINER_HDRFTR, FP_CONTAINER_TABLE, FP_CONTAINER_TOC, fp_Container::getColumn(), fp_Container::getContainer(), fp_ContainerObject::getContainerString(), fp_ContainerObject::getContainerType(), getCorrectBrokenTable(), getCorrectBrokenTOC(), fp_Page::getDocLayout(), fp_TableContainer::getFirstBrokenTable(), fp_TOCContainer::getFirstBrokenTOC(), fl_HdrFtrShadow::getFirstContainer(), fl_HdrFtrSectionLayout::getFirstShadow(), fp_TableContainer::getMasterTable(), fp_TOCContainer::getMasterTOC(), fp_Page::getNthColumnLeader(), fp_Page::getOwningSection(), fp_Column::getPage(), fp_TableContainer::getPage(), fp_Container::getPage(), fp_Page::getScreenOffsets(), fl_DocSectionLayout::getTopMargin(), getView(), FV_View::getViewMode(), fp_ContainerObject::getX(), getY(), fp_ContainerObject::getY(), getYoffsetFromTable(), fp_ContainerObject::isColumnType(), fp_TOCContainer::isThisBroken(), fp_TableContainer::isThisBroken(), VIEW_PRINT, and xxx_UT_DEBUGMSG.

Referenced by FV_View::_moveInsPtNextPrevLine(), FV_FrameEdit::getFrameStrings(), fp_Line::getOffsets(), and fl_BlockLayout::setFramesOnPage().

fp_TableContainer * fp_VerticalContainer::getCorrectBrokenTable ( fp_Container pCon  ) 

fp_TOCContainer * fp_VerticalContainer::getCorrectBrokenTOC ( fp_Container pCon  ) 

void fp_VerticalContainer::getScreenOffsets ( fp_ContainerObject pContainer,
UT_sint32 xoff,
UT_sint32 yoff 
)

Get Containers' offsets relative to the screen

Parameters:
pContainer Container which we want to find the absolute position of.
Return values:
xoff Container's X offset relative the screen
yoff Container's Y offset relative the screen

Reimplemented in fp_HdrFtrContainer.

References FP_CONTAINER_ANNOTATION, FP_CONTAINER_CELL, FP_CONTAINER_COLUMN, FP_CONTAINER_COLUMN_SHADOW, FP_CONTAINER_FOOTNOTE, FP_CONTAINER_FRAME, FP_CONTAINER_TABLE, FP_CONTAINER_TOC, fp_Container::getContainer(), fp_ContainerObject::getContainerString(), fp_ContainerObject::getContainerType(), getCorrectBrokenTable(), getCorrectBrokenTOC(), fp_TableContainer::getFirstBrokenTable(), fp_TableContainer::getMasterTable(), fp_Container::getNthCon(), fp_Page::getOwningSection(), fp_FrameContainer::getPage(), fp_AnnotationContainer::getPage(), fp_FootnoteContainer::getPage(), fp_ShadowContainer::getPage(), fp_Column::getPage(), fp_Container::getPage(), fp_Page::getScreenOffsets(), fl_DocSectionLayout::getTopMargin(), getView(), FV_View::getViewMode(), getX(), fp_ContainerObject::getX(), getY(), fp_ContainerObject::getY(), getYoffsetFromTable(), fp_ContainerObject::isColumnType(), fp_TableContainer::isThisBroken(), UT_ASSERT, UT_SHOULD_NOT_HAPPEN, VIEW_PRINT, and xxx_UT_DEBUGMSG.

Referenced by fp_Line::_doClearScreenFromRunToEnd(), fp_Line::clearScreen(), fp_EndnoteContainer::clearScreen(), fp_AnnotationContainer::clearScreen(), FV_View::convertPositionedToInLine(), fp_Line::draw(), fp_Line::getScreenOffsets(), and getScreenRect().

UT_Rect * fp_VerticalContainer::getScreenRect ( void   )  [virtual]

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::draw ( dg_DrawArgs pDA  )  [virtual]

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