#include <fp_Run.h>
Public Member Functions | |
fp_BookmarkRun (fl_BlockLayout *pBL, UT_uint32 iOffsetFirst, UT_uint32 iLen) | |
bool | isStartOfBookmark () const |
const gchar * | getName () const |
bool | isComrade (fp_BookmarkRun *pBR) const |
virtual bool | canBreakAfter (void) const |
virtual bool | canBreakBefore (void) const |
virtual void | mapXYToPosition (UT_sint32 x, UT_sint32 y, PT_DocPosition &pos, bool &bBOL, bool &bEOL, bool &isTOC) |
virtual void | findPointCoords (UT_uint32 iOffset, UT_sint32 &x, UT_sint32 &y, UT_sint32 &x2, UT_sint32 &y2, UT_sint32 &height, bool &bDirection) |
virtual bool | hasLayoutProperties (void) const |
virtual bool | doesContainNonBlankData (void) const |
UT_uint32 | getBookmarkedDocPosition (bool bAfter) const |
Private Member Functions | |
virtual void | _lookupProperties (const PP_AttrProp *pSpanAP, const PP_AttrProp *pBlockAP, const PP_AttrProp *pSectionAP, GR_Graphics *pG=NULL) |
virtual void | _clearScreen (bool) |
virtual void | _draw (dg_DrawArgs *) |
virtual bool | _letPointPass (void) const |
virtual bool | _canContainPoint (void) const |
virtual bool | _deleteFollowingIfAtInsPoint () const |
Private Attributes | |
bool | m_bIsStart |
gchar | m_pName [BOOKMARK_NAME_SIZE+1] |
po_Bookmark * | m_pBookmark |
fp_BookmarkRun::fp_BookmarkRun | ( | fl_BlockLayout * | pBL, | |
UT_uint32 | iOffsetFirst, | |||
UT_uint32 | iLen | |||
) |
References fp_Run::_setDirection(), fp_Run::_setDirty(), fp_Run::_setRecalcWidth(), fp_Run::_setWidth(), fp_Run::getBlock(), fl_Layout::getBookmark(), po_Bookmark::getBookmarkType(), po_Bookmark::getName(), m_bIsStart, m_pBookmark, m_pName, po_Bookmark::POBOOKMARK_START, UT_ASSERT, UT_BIDI_WS, and UT_return_if_fail.
bool fp_BookmarkRun::_canContainPoint | ( | void | ) | const [private, virtual] |
Reimplemented from fp_Run.
void fp_BookmarkRun::_clearScreen | ( | bool | ) | [private, virtual] |
Implements fp_Run.
References fp_Run::_getView(), GR_Graphics::DGP_SCREEN, fp_Run::Fill(), fp_Run::getGraphics(), fp_Run::getLine(), fp_Line::getScreenOffsets(), FV_View::getShowPara(), m_bIsStart, and UT_ASSERT.
bool fp_BookmarkRun::_deleteFollowingIfAtInsPoint | ( | ) | const [private, virtual] |
Reimplemented from fp_Run.
void fp_BookmarkRun::_draw | ( | dg_DrawArgs * | pDA | ) | [private, virtual] |
bool fp_BookmarkRun::_letPointPass | ( | void | ) | const [private, virtual] |
Reimplemented from fp_Run.
void fp_BookmarkRun::_lookupProperties | ( | const PP_AttrProp * | pSpanAP, | |
const PP_AttrProp * | pBlockAP, | |||
const PP_AttrProp * | pSectionAP, | |||
GR_Graphics * | pG = NULL | |||
) | [private, virtual] |
Implements fp_Run.
bool fp_BookmarkRun::canBreakAfter | ( | void | ) | const [virtual] |
Implements fp_Run.
bool fp_BookmarkRun::canBreakBefore | ( | void | ) | const [virtual] |
Implements fp_Run.
virtual bool fp_BookmarkRun::doesContainNonBlankData | ( | void | ) | const [inline, virtual] |
Reimplemented from fp_Run.
void fp_BookmarkRun::findPointCoords | ( | UT_uint32 | iOffset, | |
UT_sint32 & | x, | |||
UT_sint32 & | y, | |||
UT_sint32 & | x2, | |||
UT_sint32 & | y2, | |||
UT_sint32 & | height, | |||
bool & | bDirection | |||
) | [virtual] |
Implements fp_Run.
References fp_Run::findPointCoords(), fp_Run::getNextRun(), and UT_ASSERT.
UT_uint32 fp_BookmarkRun::getBookmarkedDocPosition | ( | bool | bAfter | ) | const |
When working with bookmarks, the run block offset does not always adequately represent the location of the bookmark. For example, if the user bookmarks the same place in the doc with several bookmarks, the run offsets for each associated run will be different, but most of the time we are interested in the offset to the left or right of all stacked up bookmarks. Similarly, a bookmark that is immediately after a start of block needs to be treated in certain situations as if the block strux was also sellected. This function implements the necessary logic.
In general, when we jump to bookmarks, we go to the range in between the two bookmark object. However, for purposes of TOCs, we are interested in the range that is just outside the two objects.
bAfter: indicates if we want offset to the right (true) or left (false) of the bookmark
References FPRUN_BOOKMARK, FPRUN_FMTMARK, fp_Run::getBlock(), fp_Run::getBlockOffset(), fp_Run::getLength(), fp_Run::getNextRun(), fl_BlockLayout::getPosition(), fp_Run::getPrevRun(), fp_Run::getType(), and UT_ASSERT_HARMLESS.
Referenced by fl_TOCLayout::addBlock(), fl_TOCLayout::fillTOC(), and FV_View::gotoTarget().
const gchar* fp_BookmarkRun::getName | ( | void | ) | const [inline] |
virtual bool fp_BookmarkRun::hasLayoutProperties | ( | void | ) | const [inline, virtual] |
Reimplemented from fp_Run.
bool fp_BookmarkRun::isComrade | ( | fp_BookmarkRun * | pBR | ) | const |
bool fp_BookmarkRun::isStartOfBookmark | ( | ) | const [inline] |
void fp_BookmarkRun::mapXYToPosition | ( | UT_sint32 | x, | |
UT_sint32 | y, | |||
PT_DocPosition & | pos, | |||
bool & | bBOL, | |||
bool & | bEOL, | |||
bool & | isTOC | |||
) | [virtual] |
Implements fp_Run.
References fp_Run::getNextRun(), fp_Run::mapXYToPosition(), and UT_ASSERT.
bool fp_BookmarkRun::m_bIsStart [private] |
Referenced by _clearScreen(), _draw(), and fp_BookmarkRun().
po_Bookmark* fp_BookmarkRun::m_pBookmark [private] |
Referenced by fp_BookmarkRun().
gchar fp_BookmarkRun::m_pName[BOOKMARK_NAME_SIZE+1] [private] |
Referenced by fp_BookmarkRun(), and isComrade().