#include <pd_Style.h>
Public Member Functions | |
PD_Style (pt_PieceTable *pPT, PT_AttrPropIndex indexAP, const char *szName=NULL, bool bDisplayed=true) | |
virtual | ~PD_Style () |
PT_AttrPropIndex | getIndexAP (void) const |
bool | setIndexAP (PT_AttrPropIndex indexAP) |
bool | getProperty (const gchar *szName, const gchar *&szValue) const |
std::unique_ptr< PP_PropertyType > | getPropertyType (const gchar *szName, tProperty_type Type) const |
bool | getAttribute (const gchar *szName, const gchar *&szValue) const |
bool | getPropertyExpand (const gchar *szName, const gchar *&szValue) const |
bool | getAttributeExpand (const gchar *szName, const gchar *&szValue) const |
PD_Style * | getBasedOn (void) const |
PD_Style * | getFollowedBy (void) const |
virtual bool | isUserDefined (void) const |
void | used (UT_sint32 count) |
bool | isUsed (void) const |
bool | isCharStyle (void) const |
bool | isList (void) const |
bool | isDisplayed (void) const |
bool | addProperty (const gchar *szName, const gchar *szValue) |
bool | addProperties (const PP_PropertyVector &pProperties) |
bool | setAllAttributes (const PP_PropertyVector &atts) |
bool | addAttributes (const PP_PropertyVector &pAtts) |
bool | getAllProperties (UT_Vector *vProps, UT_sint32 depth) const |
bool | getAllAttributes (UT_Vector *vAttribs, UT_sint32 depth) const |
size_t | getPropertyCount (void) const |
size_t | getAttributeCount (void) const |
bool | getNthProperty (int ndx, const gchar *&szName, const gchar *&szValue) const |
bool | getNthAttribute (int ndx, const gchar *&szName, const gchar *&szValue) const |
const char * | getName (void) const |
Protected Member Functions | |
bool | _getPropertyExpand (const gchar *szName, const gchar *&szValue, UT_sint32 iDepth) const |
bool | _getAttributeExpand (const gchar *szName, const gchar *&szValue, UT_sint32 iDepth) const |
Protected Attributes | |
pt_PieceTable * | m_pPT |
PT_AttrPropIndex | m_indexAP |
char * | m_szName |
bool | m_bDisplayed |
UT_sint32 | m_iUsed |
PD_Style * | m_pBasedOn |
PD_Style * | m_pFollowedBy |
PD_Style::PD_Style | ( | pt_PieceTable * | pPT, | |
PT_AttrPropIndex | indexAP, | |||
const char * | szName = NULL , |
|||
bool | bDisplayed = true | |||
) |
References m_szName.
bool PD_Style::_getAttributeExpand | ( | const gchar * | szName, | |
const gchar *& | szValue, | |||
UT_sint32 | iDepth | |||
) | const [protected] |
References _getAttributeExpand(), PP_AttrProp::getAttribute(), pt_PieceTable::getAttrProp(), getBasedOn(), m_indexAP, m_pPT, and pp_BASEDON_DEPTH_LIMIT.
Referenced by _getAttributeExpand(), and getAttributeExpand().
bool PD_Style::_getPropertyExpand | ( | const gchar * | szName, | |
const gchar *& | szValue, | |||
UT_sint32 | iDepth | |||
) | const [protected] |
References _getPropertyExpand(), pt_PieceTable::getAttrProp(), getBasedOn(), PP_AttrProp::getProperty(), m_indexAP, m_pPT, and pp_BASEDON_DEPTH_LIMIT.
Referenced by _getPropertyExpand(), and getPropertyExpand().
bool PD_Style::addAttributes | ( | const PP_PropertyVector & | pAtts | ) |
References pt_VarSet::addIfUniqueAP(), PP_AttrProp::areAlreadyPresent(), PP_AttrProp::cloneWithReplacements(), pt_PieceTable::getAttrProp(), pt_PieceTable::getVarSet(), m_indexAP, m_pBasedOn, m_pFollowedBy, m_pPT, PP_AttrProp::markReadOnly(), and UT_return_val_if_fail.
Referenced by IE_Imp_MsWord_97::_handleStyleSheet(), IE_Imp_RTF::HandleStyleDefinition(), PD_Document::removeStyle(), and IE_Imp_AbiWord_1::startElement().
bool PD_Style::addProperties | ( | const PP_PropertyVector & | pProperties | ) |
This method adds the properties defined in pProperties to the already defined set. If a property already exists in the definition, its value is replaced.
const | gchar ** pProperties string of properties |
References pt_VarSet::addIfUniqueAP(), PP_AttrProp::cloneWithReplacements(), pt_PieceTable::getAttrProp(), pt_PieceTable::getVarSet(), m_indexAP, m_pPT, and PP_AttrProp::markReadOnly().
bool PD_Style::addProperty | ( | const gchar * | szName, | |
const gchar * | szValue | |||
) |
Add a property to the style definition.
References pt_VarSet::addIfUniqueAP(), PP_AttrProp::cloneWithReplacements(), pt_PieceTable::getAttrProp(), pt_PieceTable::getVarSet(), m_indexAP, m_pPT, and PP_AttrProp::markReadOnly().
This method fills a vector structure with all the attributes defined in this style, including the basedon style.
vProps | the vector containing const gchar * (name,value) pairs |
References UT_GenericVector< T >::addItem(), gchar, getAllAttributes(), getAttributeCount(), getBasedOn(), UT_GenericVector< T >::getItemCount(), getNthAttribute(), UT_GenericVector< T >::getNthItem(), pp_BASEDON_DEPTH_LIMIT, and szName.
Referenced by PP_AttrProp::explodeStyle(), getAllAttributes(), and pt_VarSet::mergeAP().
This method fills a vector structure with all the properties defined in this style, including the basedon style.
vProps | the vector containing const gchar * (name,value) pairs |
References UT_GenericVector< T >::addItem(), gchar, getAllProperties(), getBasedOn(), UT_GenericVector< T >::getItemCount(), UT_GenericVector< T >::getNthItem(), getNthProperty(), getPropertyCount(), pp_BASEDON_DEPTH_LIMIT, and szName.
Referenced by pt_PieceTable::_realChangeSpanFmt(), pt_PieceTable::_realChangeStruxFmt(), PP_AttrProp::explodeStyle(), getAllProperties(), pt_VarSet::mergeAP(), and AP_Dialog_Styles::updateCurrentStyle().
bool PD_Style::getAttribute | ( | const gchar * | szName, | |
const gchar *& | szValue | |||
) | const |
References PP_AttrProp::getAttribute(), pt_PieceTable::getAttrProp(), m_indexAP, and m_pPT.
Referenced by IE_Exp_HTML_StyleTree::add(), IE_Exp_HTML_StyleTree::find(), s_RTF_AttrPropAdapter_Style::getAttribute(), getBasedOn(), getFollowedBy(), FV_View::insertParagraphBreak(), isCharStyle(), and PD_Document::removeStyle().
size_t PD_Style::getAttributeCount | ( | void | ) | const |
References PP_AttrProp::getAttributeCount(), pt_PieceTable::getAttrProp(), m_indexAP, and m_pPT.
Referenced by getAllAttributes().
bool PD_Style::getAttributeExpand | ( | const gchar * | szName, | |
const gchar *& | szValue | |||
) | const |
References _getAttributeExpand(), PP_AttrProp::getAttribute(), pt_PieceTable::getAttrProp(), getBasedOn(), m_indexAP, and m_pPT.
Referenced by AP_Dialog_Styles::fillVecWithProps().
PD_Style * PD_Style::getBasedOn | ( | void | ) | const |
References gchar, getAttribute(), pt_PieceTable::getStyle(), m_pBasedOn, m_pPT, and PT_BASEDON_ATTRIBUTE_NAME.
Referenced by _getAttributeExpand(), _getPropertyExpand(), IE_Imp_MsWord_97::_handleStyleSheet(), fl_TOCLayout::_isStyleInTOC(), AP_Win32Dialog_Styles::_onInitDialog(), AP_UnixDialog_Styles::_populateModify(), PL_Psion_Listener::_setStyleLayout(), s_WML_Listener::_styleDescendsFrom(), IE_TOCHelper::_tocNameLevelHelper(), IE_Exp_RTF::_write_stylesheets(), IE_Exp_HTML_StyleTree::add(), IE_Exp_OpenXML_Listener::addDocumentStyles(), PD_Document::addStyleAttributes(), fl_BlockLayout::fl_BlockLayout(), getAllAttributes(), getAllProperties(), PD_Document::getAllUsedStyles(), getAttributeExpand(), PD_Document::getPrevNumberedHeadingStyle(), getPropertyExpand(), IE_Imp_RTF::HandleStyleDefinition(), Stylist_tree::isFootnote(), Stylist_tree::isHeading(), Stylist_tree::isList(), FV_View::isNumberedHeadingHere(), PP_evalPropertyType(), PD_Document::removeStyle(), s_evalProperty(), PD_Document::setAllStyleAttributes(), FV_View::setStyleAtPos(), IE_Imp_AbiWord_1::startElement(), and PD_Document::updateDocForStyleChange().
PD_Style * PD_Style::getFollowedBy | ( | void | ) | const |
References gchar, getAttribute(), pt_PieceTable::getStyle(), m_pFollowedBy, m_pPT, and PT_FOLLOWEDBY_ATTRIBUTE_NAME.
Referenced by IE_Imp_MsWord_97::_handleStyleSheet(), AP_Win32Dialog_Styles::_onInitDialog(), AP_UnixDialog_Styles::_populateModify(), IE_Exp_RTF::_write_stylesheets(), IE_Exp_OpenXML_Listener::addDocumentStyles(), PD_Document::addStyleAttributes(), PD_Document::getAllUsedStyles(), IE_Imp_RTF::HandleStyleDefinition(), FV_View::insertParagraphBreak(), PD_Document::removeStyle(), PD_Document::setAllStyleAttributes(), and IE_Imp_AbiWord_1::startElement().
PT_AttrPropIndex PD_Style::getIndexAP | ( | void | ) | const [inline] |
Referenced by IE_Exp_HTML::_buildStyleTree(), s_AbiWord_1_Listener::_handleStyles(), PL_Psion_Listener::_setStyleLayout(), ODe_Styles::addStyle(), PD_Document::areDocumentStylesheetsEqual(), ODe_Styles::fetchRegularStyleStyles(), fl_TOCLayout::fillTOC(), IE_Exp_DocRangeListener::IE_Exp_DocRangeListener(), fl_TOCListener::populateStrux(), PD_Document::removeStyle(), and OO_StylesWriter::writeStyles().
const char* PD_Style::getName | ( | void | ) | const [inline] |
Referenced by IE_Exp_HTML::_buildStyleTree(), IE_Exp_RTF::_getStyleNumber(), ABI_Collab_Import::_import(), fl_TOCLayout::_isStyleInTOC(), AP_Win32Dialog_Styles::_onInitDialog(), AP_Win32Dialog_Styles::_populateCList(), AP_UnixDialog_Styles::_populateCList(), AP_UnixDialog_Styles::_populateModify(), PL_Psion_Listener::_processStyles(), IE_Exp_RTF::_selectStyles(), s_WML_Listener::_styleDescendsFrom(), IE_TOCHelper::_tocNameLevelHelper(), IE_Exp_RTF::_write_stylesheets(), IE_Exp_HTML_StyleTree::add(), IE_Exp_OpenXML_Listener::addDocumentStyles(), Stylist_tree::buildStyles(), pt_PieceTable::enumStyles(), PD_Document::getPrevNumberedHeadingStyle(), PD_Document::importStyles(), Stylist_tree::isFootnote(), Stylist_tree::isHeading(), Stylist_tree::isList(), FV_View::isNumberedHeadingHere(), AP_Win32Toolbar_StyleCombo::populate(), AP_UnixToolbar_StyleCombo::populate(), AP_QtToolbar_StyleCombo::populate(), AP_CocoaToolbar_StyleCombo::populate(), AP_Win32Toolbar_StyleCombo::repopulate(), AP_UnixToolbar_StyleCombo::repopulate(), AP_QtToolbar_StyleCombo::repopulate(), AP_CocoaToolbar_StyleCombo::repopulate(), and FV_View::setStyleAtPos().
bool PD_Style::getNthAttribute | ( | int | ndx, | |
const gchar *& | szName, | |||
const gchar *& | szValue | |||
) | const |
References pt_PieceTable::getAttrProp(), PP_AttrProp::getNthAttribute(), m_indexAP, and m_pPT.
Referenced by getAllAttributes().
bool PD_Style::getNthProperty | ( | int | ndx, | |
const gchar *& | szName, | |||
const gchar *& | szValue | |||
) | const |
References pt_PieceTable::getAttrProp(), PP_AttrProp::getNthProperty(), m_indexAP, and m_pPT.
Referenced by IE_Exp_HTML_Listener::_makeStylesheet(), IE_Exp_OpenXML_Listener::addDocumentStyles(), getAllProperties(), IE_Exp_HTML_StyleTree::IE_Exp_HTML_StyleTree(), and XAP_PaletteProperties_Level::initWithStyle:levelName:.
bool PD_Style::getProperty | ( | const gchar * | szName, | |
const gchar *& | szValue | |||
) | const |
References pt_PieceTable::getAttrProp(), PP_AttrProp::getProperty(), m_indexAP, and m_pPT.
Referenced by AP_Dialog_Styles::_populatePreviews(), IE_Exp_RTF::_write_prop_ifnotdefault(), IE_Exp_RTF::_write_prop_ifyes(), IE_Exp_RTF::_write_style_fmt(), AP_Dialog_Styles::fillVecWithProps(), s_RTF_AttrPropAdapter_Style::getProperty(), FV_View::insertParagraphBreak(), OO_Style::parse(), PP_evalProperty(), s_evalProperty(), s_LaTeX_Listener::s_LaTeX_Listener(), FV_View::setStyleAtPos(), fl_BlockLayout::StartList(), and fl_BlockLayout::StopListInBlock().
size_t PD_Style::getPropertyCount | ( | void | ) | const |
bool PD_Style::getPropertyExpand | ( | const gchar * | szName, | |
const gchar *& | szValue | |||
) | const |
References _getPropertyExpand(), pt_PieceTable::getAttrProp(), getBasedOn(), PP_AttrProp::getProperty(), m_indexAP, and m_pPT.
Referenced by AP_Dialog_Styles::_populatePreviews(), AP_UnixToolbar_StyleCombo::getPangoAttrs(), and isList().
std::unique_ptr< PP_PropertyType > PD_Style::getPropertyType | ( | const gchar * | szName, | |
tProperty_type | Type | |||
) | const |
References pt_PieceTable::getAttrProp(), PP_AttrProp::getPropertyType(), m_indexAP, and m_pPT.
Referenced by PP_evalPropertyType().
bool PD_Style::isCharStyle | ( | void | ) | const |
bool PD_Style::isDisplayed | ( | void | ) | const [inline] |
bool PD_Style::isList | ( | void | ) | const |
References getPropertyExpand().
Referenced by pt_VarSet::mergeAP(), AP_UnixToolbar_StyleCombo::repopulate(), and AP_QtToolbar_StyleCombo::repopulate().
bool PD_Style::isUsed | ( | void | ) | const |
virtual bool PD_Style::isUserDefined | ( | void | ) | const [inline, virtual] |
Reimplemented in PD_BuiltinStyle.
Referenced by s_AbiWord_1_Listener::_handleStyles(), AP_Win32Dialog_Styles::_populateCList(), AP_UnixDialog_Styles::_populateCList(), pt_PieceTable::appendStyle(), AP_UnixDialog_Styles::event_ModifyClicked(), ODe_Styles::fetchRegularStyleStyles(), Stylist_tree::isUser(), and pt_PieceTable::removeStyle().
bool PD_Style::setAllAttributes | ( | const PP_PropertyVector & | atts | ) |
This method replaces the previous set of attributes/properties with a new one defined in atts. It is imperitive that updateDocForStyleChange be called after this method.
atts | list of attributes with an extended properties string |
References pt_PieceTable::getVarSet(), m_indexAP, m_pBasedOn, m_pFollowedBy, m_pPT, and pt_VarSet::storeAP().
bool PD_Style::setIndexAP | ( | PT_AttrPropIndex | indexAP | ) |
References m_indexAP, and UT_ASSERT_HARMLESS.
Referenced by pt_PieceTable::appendStyle().
void PD_Style::used | ( | UT_sint32 | count | ) |
References m_iUsed.
Referenced by fp_TextRun::_lookupProperties(), fl_BlockLayout::fl_BlockLayout(), fl_TOCListener::fl_TOCListener(), and FV_View::setStyleAtPos().
bool PD_Style::m_bDisplayed [protected] |
PT_AttrPropIndex PD_Style::m_indexAP [protected] |
Referenced by _getAttributeExpand(), _getPropertyExpand(), addAttributes(), addProperties(), addProperty(), getAttribute(), getAttributeCount(), getAttributeExpand(), getNthAttribute(), getNthProperty(), getProperty(), getPropertyCount(), getPropertyExpand(), getPropertyType(), setAllAttributes(), and setIndexAP().
UT_sint32 PD_Style::m_iUsed [protected] |
PD_Style* PD_Style::m_pBasedOn [mutable, protected] |
Referenced by addAttributes(), getBasedOn(), and setAllAttributes().
PD_Style* PD_Style::m_pFollowedBy [mutable, protected] |
Referenced by addAttributes(), getFollowedBy(), and setAllAttributes().
pt_PieceTable* PD_Style::m_pPT [protected] |
Referenced by _getAttributeExpand(), _getPropertyExpand(), addAttributes(), addProperties(), addProperty(), getAttribute(), getAttributeCount(), getAttributeExpand(), getBasedOn(), getFollowedBy(), getNthAttribute(), getNthProperty(), getProperty(), getPropertyCount(), getPropertyExpand(), getPropertyType(), and setAllAttributes().
char* PD_Style::m_szName [protected] |
Referenced by PD_Style(), and ~PD_Style().