#include <fl_AutoNum.h>
fl_AutoNum::fl_AutoNum | ( | UT_uint32 | id, | |
UT_uint32 | parent_id, | |||
FL_ListType | lType, | |||
UT_uint32 | start, | |||
const gchar * | lDelim, | |||
const gchar * | lDecimal, | |||
PD_Document * | pDoc, | |||
FV_View * | pView | |||
) |
References _setParent(), PD_Document::getListByID(), m_iParentID, m_pDoc, m_pszDecimal, m_pszDelim, and UT_ASSERT.
fl_AutoNum::~fl_AutoNum | ( | ) |
void fl_AutoNum::_calculateLabelStr | ( | UT_uint32 | depth | ) | [protected] |
void fl_AutoNum::_getLabelstr | ( | UT_UCSChar | labelStr[], | |
UT_uint32 * | insPoint, | |||
UT_uint32 | depth, | |||
const pf_Frag_Strux * | pLayout | |||
) | const [protected] |
This method recursively calculates a label based on the type of label of the AutoNum Class. This is output to the label string labelStr.
insPoint is the position in the string where the new text goes. It starts Pointing to the byte == 0 depth is the level of recursion pLayout is a pointer to the Layout item containing the current list item
References ARABICNUMBERED_LIST, ARROWHEAD_LIST, BOX_LIST, BULLETED_LIST, CONV_TO_UCS, DASHED_LIST, dec2ascii(), dec2hebrew(), dec2roman(), DIAMOND_LIST, FREEP, getParentItem(), getPositionInList(), HAND_LIST, HEART_LIST, HEBREW_LIST, IMPLIES_LIST, IS_NUMBERED_LIST_TYPE, LOWERCASE_LIST, LOWERROMAN_LIST, m_iStartValue, m_List_Type, m_pParent, m_pszDecimal, m_pszDelim, NOT_A_LIST, NUMBERED_LIST, SQUARE_LIST, STAR_LIST, TICK_LIST, TRIANGLE_LIST, UPPERCASE_LIST, UPPERROMAN_LIST, UT_ASSERT_HARMLESS, UT_DEBUGMSG, and UT_SHOULD_NOT_HAPPEN.
Referenced by getLabel().
UT_uint32 fl_AutoNum::_getLevelValue | ( | const fl_AutoNumConstPtr & | pAutoNum | ) | const [inline, protected] |
References getFirstItem().
void fl_AutoNum::_setParent | ( | const fl_AutoNumPtr & | pParent | ) | [protected] |
References fl_AutoNum::ItemStorage::at(), PD_Document::changeStruxForLists(), m_bDirty, m_iParentID, m_items, m_pDoc, m_pParent, and fl_AutoNum::ItemStorage::size().
Referenced by findAndSetParentItem(), fixHierarchy(), and fl_AutoNum().
void fl_AutoNum::_setParentID | ( | UT_uint32 | iParentID | ) | [protected] |
References m_bDirty, and m_iParentID.
Referenced by findAndSetParentItem().
bool fl_AutoNum::_updateItems | ( | UT_sint32 | start, | |
const pf_Frag_Strux * | notMe | |||
) | [protected] |
References PD_Document::areListUpdatesAllowed(), fl_AutoNum::ItemStorage::at(), PD_Document::getListsCount(), PD_Document::getNthList(), PD_Document::listUpdate(), m_bDirty, m_bUpdatingItems, m_items, m_pDoc, fl_AutoNum::ItemStorage::size(), UT_ASSERT, UT_ASSERT_HARMLESS, and UT_return_val_if_fail.
Referenced by insertFirstItem(), insertItem(), prependItem(), removeItem(), setStartValue(), and update().
void fl_AutoNum::addItem | ( | pf_Frag_Strux * | pItem | ) |
bool fl_AutoNum::checkReference | ( | const fl_AutoNum & | pAuto | ) | const |
References m_pParent.
Referenced by _getLabelstr(), and FL_DocLayout::getStringFromFootnoteVal().
void fl_AutoNum::dec2hebrew | ( | UT_UCSChar | labelStr[], | |
UT_uint32 * | insPoint, | |||
UT_sint32 | value | |||
) | [static] |
Referenced by _getLabelstr().
char * fl_AutoNum::dec2roman | ( | UT_sint32 | value, | |
bool | lower | |||
) | [static] |
References UT_String::c_str(), and UT_String::size().
Referenced by _getLabelstr(), and FL_DocLayout::getStringFromFootnoteVal().
bool fl_AutoNum::doesItemHaveLabel | ( | const fl_BlockLayout * | pItem | ) | const |
void fl_AutoNum::findAndSetParentItem | ( | void | ) |
References _setParent(), _setParentID(), fl_AutoNum::ItemStorage::empty(), fl_AutoNum::ItemStorage::front(), PD_Document::getListByID(), PD_Document::getListsCount(), PD_Document::getNthList(), PD_Document::getStruxPosition(), m_bDirty, m_iLevel, m_iParentID, m_items, m_pDoc, m_pParent, m_pParentItem, update(), and UT_ASSERT.
void fl_AutoNum::fixHierarchy | ( | void | ) |
Check that this list is not a member of another list.
References _setParent(), fl_AutoNum::ItemStorage::empty(), fl_AutoNum::ItemStorage::front(), XAP_App::getApp(), PD_Document::getAttributeFromSDH(), XAP_Frame::getCurrentView(), XAP_App::getLastFocussedFrame(), PD_Document::getListByID(), FV_View::getRevisionLevel(), FV_View::isShowRevisions(), m_bDirty, m_iID, m_iLevel, m_iParentID, m_items, m_pDoc, m_pParent, and UT_ASSERT.
void fl_AutoNum::fixListOrder | ( | void | ) |
References compareListItems(), m_bDirty, m_items, m_pDoc, and fl_AutoNum::ItemStorage::sort().
Referenced by addItem(), insertFirstItem(), insertItem(), and prependItem().
fl_AutoNumPtr fl_AutoNum::getActiveParent | ( | void | ) | const |
References m_pParent.
void fl_AutoNum::getAttributes | ( | std::vector< std::string > & | v, | |
bool | bEscapeXML | |||
) | const |
References m_iID, m_iStartValue, m_List_Type, m_pParent, m_pszDecimal, m_pszDelim, s, and UT_escapeXML().
fl_AutoNumConstPtr fl_AutoNum::getAutoNumFromSdh | ( | const pf_Frag_Strux * | sdh | ) | const |
References PD_Document::areListUpdatesAllowed(), PD_Document::getListsCount(), PD_Document::getNthList(), isItem(), and m_pDoc.
Referenced by getPositionInList(), and insertFirstItem().
const gchar * fl_AutoNum::getDecimal | ( | ) | const |
References m_pszDecimal.
const gchar * fl_AutoNum::getDelim | ( | ) | const |
References m_pszDelim.
PD_Document* fl_AutoNum::getDoc | ( | void | ) | const [inline] |
pf_Frag_Strux * fl_AutoNum::getFirstItem | ( | void | ) | const |
References fl_AutoNum::ItemStorage::empty(), fl_AutoNum::ItemStorage::front(), and m_items.
Referenced by _getLevelValue(), and update().
UT_uint32 fl_AutoNum::getID | ( | void | ) | const [inline] |
const UT_UCSChar * fl_AutoNum::getLabel | ( | const pf_Frag_Strux * | pItem | ) | const |
References _getLabelstr(), and label.
pf_Frag_Strux * fl_AutoNum::getLastItem | ( | void | ) | const |
References fl_AutoNum::ItemStorage::back(), fl_AutoNum::ItemStorage::empty(), and m_items.
pf_Frag_Strux * fl_AutoNum::getLastItemInHeiracy | ( | void | ) | const |
References PD_Document::getListsCount(), PD_Document::getNthList(), and m_pDoc.
UT_uint32 fl_AutoNum::getLevel | ( | ) | const [inline] |
pf_Frag_Strux * fl_AutoNum::getNthBlock | ( | UT_uint32 | i | ) | const |
References fl_AutoNum::ItemStorage::at(), m_items, and fl_AutoNum::ItemStorage::size().
UT_uint32 fl_AutoNum::getNumLabels | ( | ) | const |
References m_items, and fl_AutoNum::ItemStorage::size().
fl_AutoNumPtr fl_AutoNum::getParent | ( | void | ) | const [inline] |
Referenced by removeItem().
UT_uint32 fl_AutoNum::getParentID | ( | ) | const [inline] |
pf_Frag_Strux * fl_AutoNum::getParentItem | ( | ) | const |
References m_pParentItem.
Referenced by _getLabelstr(), and removeItem().
UT_sint32 fl_AutoNum::getPositionInList | ( | const pf_Frag_Strux * | pItem | ) | const |
References fl_AutoNum::ItemStorage::at(), fl_AutoNum::ItemStorage::front(), getAutoNumFromSdh(), m_bWordMultiStyle, m_items, and fl_AutoNum::ItemStorage::size().
Referenced by _getLabelstr(), and getValue().
pf_Frag_Strux * fl_AutoNum::getPrevInList | ( | const pf_Frag_Strux * | pItem | ) | const |
References fl_AutoNum::ItemStorage::at(), fl_AutoNum::ItemStorage::findItem(), and m_items.
UT_uint16 fl_AutoNum::getStartValue | ( | ) | const [inline] |
UT_uint32 fl_AutoNum::getStartValue32 | ( | ) | const |
References m_iStartValue.
FL_ListType fl_AutoNum::getType | ( | void | ) | const |
References m_List_Type.
UT_uint32 fl_AutoNum::getValue | ( | const pf_Frag_Strux * | pItem | ) | const |
References getPositionInList(), and m_iStartValue.
void fl_AutoNum::insertFirstItem | ( | pf_Frag_Strux * | pItem, | |
pf_Frag_Strux * | pLast, | |||
bool | bDoFix = true | |||
) |
void fl_AutoNum::insertItem | ( | pf_Frag_Strux * | pItem, | |
const pf_Frag_Strux * | pBefore, | |||
bool | bDoFix = true | |||
) |
bool fl_AutoNum::isContainedByList | ( | pf_Frag_Strux * | pItem | ) | const |
Returns true if item is contained or immediately adjacent to the list.
References fl_AutoNum::ItemStorage::back(), fl_AutoNum::ItemStorage::empty(), fl_AutoNum::ItemStorage::front(), PD_Document::getNextStruxOfType(), PD_Document::getPrevStruxOfType(), PD_Document::getStruxPosition(), m_items, m_pDoc, and PTX_Block.
bool fl_AutoNum::isDirty | ( | void | ) | const |
References m_bDirty.
bool fl_AutoNum::isEmpty | ( | void | ) | const |
References fl_AutoNum::ItemStorage::empty(), and m_items.
bool fl_AutoNum::isIDSomeWhere | ( | UT_uint32 | ID | ) | const |
This method returns true if the requested ID is somewhere in this List heiracy.
bool fl_AutoNum::isItem | ( | const pf_Frag_Strux * | pItem | ) | const |
References fl_AutoNum::ItemStorage::hasItem(), and m_items.
Referenced by getAutoNumFromSdh().
bool fl_AutoNum::isLastOnLevel | ( | const pf_Frag_Strux * | pItem | ) | const |
References fl_AutoNum::ItemStorage::back(), fl_AutoNum::ItemStorage::empty(), and m_items.
bool fl_AutoNum::isUpdating | ( | void | ) | const [inline] |
Referenced by update().
void fl_AutoNum::markAsDirty | ( | void | ) |
References m_bDirty.
void fl_AutoNum::prependItem | ( | pf_Frag_Strux * | pItem, | |
const pf_Frag_Strux * | pAfter, | |||
bool | bDoFix = true | |||
) |
References _updateItems(), PD_Document::areListUpdatesAllowed(), fl_AutoNum::ItemStorage::at(), fl_AutoNum::ItemStorage::findItem(), fixListOrder(), PD_Document::getListsCount(), PD_Document::getNthList(), fl_AutoNum::ItemStorage::hasItem(), fl_AutoNum::ItemStorage::insertItemAt(), m_bDirty, m_items, m_pDoc, and UT_ASSERT.
void fl_AutoNum::removeItem | ( | const pf_Frag_Strux * | pItem | ) |
References _updateItems(), PD_Document::areListUpdatesAllowed(), fl_AutoNum::ItemStorage::at(), fl_AutoNum::ItemStorage::deleteNthItem(), fl_AutoNum::ItemStorage::findItem(), PD_Document::getListsCount(), PD_Document::getNthList(), getParent(), getParentItem(), m_bDirty, m_items, m_pDoc, UT_ASSERT, UT_ASSERT_HARMLESS, and UT_SHOULD_NOT_HAPPEN.
void fl_AutoNum::setAsciiOffset | ( | UT_uint32 | new_asciioffset | ) |
References m_bDirty, and m_iAsciiOffset.
void fl_AutoNum::setDecimal | ( | const std::string & | decimal | ) | [inline] |
void fl_AutoNum::setDecimal | ( | const gchar * | pszDecimal | ) |
References m_bDirty, and m_pszDecimal.
void fl_AutoNum::setDelim | ( | const gchar * | pszDelim | ) |
References m_bDirty, and m_pszDelim.
void fl_AutoNum::setDelim | ( | const std::string & | delim | ) | [inline] |
void fl_AutoNum::setLevel | ( | UT_uint32 | level | ) | [inline] |
void fl_AutoNum::setListType | ( | FL_ListType | lType | ) |
References m_List_Type.
void fl_AutoNum::setParentItem | ( | pf_Frag_Strux * | pItem | ) |
References m_bDirty, and m_pParentItem.
void fl_AutoNum::setStartValue | ( | UT_uint32 | start | ) |
References _updateItems(), m_bDirty, and m_iStartValue.
void fl_AutoNum::update | ( | UT_uint32 | start | ) |
References _updateItems(), getFirstItem(), isUpdating(), m_iID, m_items, m_pParent, UT_return_if_fail, and xxx_UT_DEBUGMSG.
Referenced by findAndSetParentItem().
bool fl_AutoNum::m_bDirty [protected] |
bool fl_AutoNum::m_bUpdatingItems [protected] |
Referenced by _updateItems().
bool fl_AutoNum::m_bWordMultiStyle [protected] |
Referenced by getPositionInList().
UT_uint16 fl_AutoNum::m_iAsciiOffset [protected] |
Referenced by setAsciiOffset().
UT_uint32 fl_AutoNum::m_iID [protected] |
Referenced by fixHierarchy(), getAttributes(), and update().
UT_uint32 fl_AutoNum::m_iLevel [protected] |
Referenced by findAndSetParentItem(), and fixHierarchy().
UT_sint32 fl_AutoNum::m_ioffset [protected] |
UT_uint32 fl_AutoNum::m_iParentID [protected] |
Referenced by _setParent(), _setParentID(), findAndSetParentItem(), fixHierarchy(), and fl_AutoNum().
UT_uint32 fl_AutoNum::m_iStartValue [protected] |
Referenced by _getLabelstr(), getAttributes(), getStartValue32(), getValue(), and setStartValue().
ItemStorage fl_AutoNum::m_items [private] |
Referenced by _setParent(), _updateItems(), addItem(), findAndSetParentItem(), fixHierarchy(), fixListOrder(), getFirstItem(), getLastItem(), getNthBlock(), getNumLabels(), getPositionInList(), getPrevInList(), insertFirstItem(), insertItem(), isContainedByList(), isEmpty(), isItem(), isLastOnLevel(), prependItem(), removeItem(), and update().
FL_ListType fl_AutoNum::m_List_Type [protected] |
Referenced by _getLabelstr(), getAttributes(), getType(), and setListType().
PD_Document* fl_AutoNum::m_pDoc [protected] |
fl_AutoNumPtr fl_AutoNum::m_pParent [protected] |
Referenced by _getLabelstr(), _setParent(), checkReference(), findAndSetParentItem(), fixHierarchy(), getActiveParent(), getAttributes(), insertFirstItem(), and update().
pf_Frag_Strux* fl_AutoNum::m_pParentItem [protected] |
Referenced by findAndSetParentItem(), getParentItem(), insertFirstItem(), and setParentItem().
gchar fl_AutoNum::m_pszDecimal[80] [protected] |
Referenced by _getLabelstr(), fl_AutoNum(), getAttributes(), getDecimal(), and setDecimal().
gchar fl_AutoNum::m_pszDelim[80] [protected] |
Referenced by _getLabelstr(), fl_AutoNum(), getAttributes(), getDelim(), and setDelim().
gchar fl_AutoNum::m_pszIndent[80] [protected] |
FV_View* fl_AutoNum::m_pView [protected] |