Class representing an OpenDocument <style:style> element. More...
#include <ODe_Style_Style.h>
Classes | |
class | CellProps |
class | ColumnProps |
class | GraphicProps |
class | ParagraphProps |
class | RowProps |
class | SectionProps |
class | TableProps |
class | TabStop |
class | TextProps |
Public Member Functions | |
ODe_Style_Style () | |
Constructor. | |
virtual | ~ODe_Style_Style () |
Destructor. | |
bool | write (GsfOutput *pODT, const UT_UTF8String &rSpacesOffset) const |
Writes <style:style> and its subelements. | |
bool | isEquivalentTo (const ODe_Style_Style &rStyle) |
It does not take style names into consideration. | |
bool | isEmpty () const |
ODe_Style_Style & | operator= (const ODe_Style_Style &rStyle) |
bool | fetchAttributesFromAbiStyle (const PP_AttrProp *pAP) |
Defines the style from attributes and properties of an AbiWord style. | |
void | fetchAttributesFromAbiSpan (const PP_AttrProp *pAP) |
Defines the style from attributes and properties of an AbiWord . | |
void | fetchAttributesFromAbiBlock (const PP_AttrProp *pAP, const ODe_Style_List *pCurrentListStyle) |
Fetch attributes from an AbiWord. | |
void | fetchAttributesFromAbiSection (const PP_AttrProp *pAP) |
Fetch attributes from an AbiWord <section> tag. | |
void | fetchAttributesFromAbiTable (const PP_AttrProp *pAP) |
Defines the style from attributes and properties of an AbiWord. | |
void | fetchAttributesFromAbiCell (const PP_AttrProp *pAP) |
Defines the style from attributes and properties of an AbiWord <cell>. | |
void | fetchAttributesFromAbiFrame (const PP_AttrProp &rAP) |
Defines the style from attributes and properties of an AbiWord <frame>. | |
void | makeDefaultStyle () |
void | setStyleName (const UT_UTF8String &rStyleName) |
const UT_UTF8String & | getName () const |
void | setFamily (const gchar *pFamily) |
void | setParentStyleName (const gchar *pParentStyleName) |
void | setMasterPageName (const UT_UTF8String &rMasterPageName) |
void | setListStyleName (const UT_UTF8String &rListStyleName) |
const UT_UTF8String & | getFontName () |
void | setBreakBefore (const gchar *pBreakBefore) |
void | setColumnWidth (const gchar *pColumnWidth) |
void | setRelColumnWidth (const gchar *pRelColumnWidth) |
void | setRelTableWidth (const gchar *pRelTableWidth) |
void | setTableWidth (const gchar *pTableWidth) |
void | setRowHeight (const gchar *pRowHeight) |
void | setMinRowHeight (const gchar *pMinRowHeight) |
void | inheritTableCellProperties (const ODe_Style_Style &tableStyle) |
void | setWrap (const UT_UTF8String &rWrap) |
void | setRunThrough (const UT_UTF8String &rRunThrough) |
void | setPadding (const UT_UTF8String &rPadding) |
void | setHorizontalPos (const UT_UTF8String &rHorizontalPos) |
void | setVerticalPos (const UT_UTF8String &rVerticalPos) |
void | setVerticalRel (const UT_UTF8String &rVerticalRel) |
const UT_UTF8String & | getDefaultTabInterval () |
void | setDefaultTabInterval (const UT_UTF8String &rDefaultTabInterval) |
Static Public Member Functions | |
static bool | hasTextStyleProps (const PP_AttrProp *pAP) |
Returns true if the specified PP_AttrProp contains properties that belongs to <style:text-properties> elements. | |
static bool | hasParagraphStyleProps (const PP_AttrProp *pAP) |
Returns true if the specified PP_AttrProp contains properties that belongs to <style:paragraph-properties> elements. | |
static bool | hasSectionInfo (const PP_AttrProp *pAP) |
static bool | hasTableStyleProps (const PP_AttrProp *pAP) |
static UT_UTF8String | convertStyleToNCName (const UT_UTF8String &name) |
Private Attributes | |
bool | m_defaultStyle |
UT_UTF8String | m_name |
UT_UTF8String | m_family |
UT_UTF8String | m_parentStyleName |
UT_UTF8String | m_nextStyleName |
UT_UTF8String | m_masterPageName |
UT_UTF8String | m_listStyleName |
class ODe_Style_Style::SectionProps * | m_pSectionProps |
class ODe_Style_Style::ParagraphProps * | m_pParagraphProps |
class ODe_Style_Style::TextProps * | m_pTextProps |
class ODe_Style_Style::TableProps * | m_pTableProps |
class ODe_Style_Style::ColumnProps * | m_pColumnProps |
class ODe_Style_Style::RowProps * | m_pRowProps |
class ODe_Style_Style::CellProps * | m_pCellProps |
class ODe_Style_Style::GraphicProps * | m_pGraphicProps |
Static Private Attributes | |
static std::map< std::string, std::string > | m_NCStyleMappings |
Class representing an OpenDocument <style:style> element.
ODe_Style_Style::ODe_Style_Style | ( | ) |
Constructor.
ODe_Style_Style::~ODe_Style_Style | ( | ) | [virtual] |
Destructor.
References DELETEP, m_pCellProps, m_pColumnProps, m_pGraphicProps, m_pParagraphProps, m_pRowProps, m_pSectionProps, m_pTableProps, and m_pTextProps.
UT_UTF8String ODe_Style_Style::convertStyleToNCName | ( | const UT_UTF8String & | name | ) | [static] |
References m_NCStyleMappings, and UT_UTF8String::utf8_str().
Referenced by ODe_Text_Listener::_openODListItem(), ODe_Text_Listener::_openParagraphDelayed(), ODe_TOC_Listener::openBlock(), ODe_Text_Listener::openSpan(), ODe_Text_Listener::openTOC(), write(), ODe_Style_PageLayout::write(), ODe_Style_MasterPage::write(), and ODe_Style_List::write().
void ODe_Style_Style::fetchAttributesFromAbiBlock | ( | const PP_AttrProp * | pAP, | |
const ODe_Style_List * | pCurrentListStyle | |||
) |
Fetch attributes from an AbiWord.
tag. Usually paragraph style attributes.
References ODe_ListLevelStyle::calculateListMargins(), ODe_Style_Style::ParagraphProps::fetchAttributesFromAbiProps(), ODe_Style_Style::TextProps::fetchAttributesFromAbiProps(), gchar, PP_AttrProp::getAttribute(), ODe_Style_List::getName(), m_defaultStyle, m_listStyleName, ODe_Style_Style::ParagraphProps::m_marginLeft, m_parentStyleName, m_pParagraphProps, m_pTextProps, ODe_Style_Style::ParagraphProps::m_textIndent, and UT_ASSERT_HARMLESS.
Referenced by ODe_Text_Listener::_openParagraphDelayed().
void ODe_Style_Style::fetchAttributesFromAbiCell | ( | const PP_AttrProp * | pAP | ) |
Defines the style from attributes and properties of an AbiWord <cell>.
References ODe_Style_Style::CellProps::fetchAttributesFromAbiProps(), and m_pCellProps.
Referenced by ODe_Table_Listener::openTable().
void ODe_Style_Style::fetchAttributesFromAbiFrame | ( | const PP_AttrProp & | rAP | ) |
Defines the style from attributes and properties of an AbiWord <frame>.
References ODe_Style_Style::GraphicProps::fetchAttributesFromAbiProps(), and m_pGraphicProps.
Referenced by ODe_Frame_Listener::_openODTextbox().
void ODe_Style_Style::fetchAttributesFromAbiSection | ( | const PP_AttrProp * | pAP | ) |
Fetch attributes from an AbiWord <section> tag.
Usually column info for an OpenDocument <style:style style:family="section"> element.
References ODe_Style_Style::SectionProps::fetchAttributesFromAbiProps(), and m_pSectionProps.
Referenced by ODe_Main_Listener::openSection().
void ODe_Style_Style::fetchAttributesFromAbiSpan | ( | const PP_AttrProp * | pAP | ) |
Defines the style from attributes and properties of an AbiWord .
References ODe_Style_Style::TextProps::fetchAttributesFromAbiProps(), gchar, PP_AttrProp::getAttribute(), m_parentStyleName, and m_pTextProps.
Referenced by ODe_Text_Listener::openSpan().
bool ODe_Style_Style::fetchAttributesFromAbiStyle | ( | const PP_AttrProp * | pAP | ) |
Defines the style from attributes and properties of an AbiWord style.
References ODe_Style_Style::ParagraphProps::fetchAttributesFromAbiProps(), ODe_Style_Style::TextProps::fetchAttributesFromAbiProps(), gchar, PP_AttrProp::getAttribute(), m_defaultStyle, m_name, m_nextStyleName, m_parentStyleName, m_pParagraphProps, m_pTextProps, PT_BASEDON_ATTRIBUTE_NAME, PT_FOLLOWEDBY_ATTRIBUTE_NAME, and PT_NAME_ATTRIBUTE_NAME.
Referenced by ODe_Styles::_addStyle().
void ODe_Style_Style::fetchAttributesFromAbiTable | ( | const PP_AttrProp * | pAP | ) |
Defines the style from attributes and properties of an AbiWord.
References ODe_Style_Style::TableProps::fetchAttributesFromAbiProps(), and m_pTableProps.
Referenced by ODe_Table_Listener::openTable().
const UT_UTF8String & ODe_Style_Style::getDefaultTabInterval | ( | ) |
References m_defaultStyle, ODe_Style_Style::ParagraphProps::m_defaultTabInterval, and m_pParagraphProps.
Referenced by ODe_DocumentData::handleDefaultTabInterval().
const UT_UTF8String & ODe_Style_Style::getFontName | ( | ) |
References ODe_Style_Style::TextProps::m_fontName, and m_pTextProps.
const UT_UTF8String& ODe_Style_Style::getName | ( | ) | const [inline] |
References m_name.
Referenced by ODe_Frame_Listener::_openODTextbox(), ODe_Text_Listener::_openParagraphDelayed(), ODe_Styles::addGraphicsStyle(), ODe_Text_Listener::insertInlinedImage(), ODe_Text_Listener::insertPositionedImage(), ODe_Main_Listener::openSection(), and ODe_Text_Listener::openSpan().
bool ODe_Style_Style::hasParagraphStyleProps | ( | const PP_AttrProp * | pAP | ) | [static] |
Returns true if the specified PP_AttrProp contains properties that belongs to <style:paragraph-properties> elements.
References gchar, and PP_AttrProp::getProperty().
Referenced by ODe_Text_Listener::_openODParagraph(), and ODe_Text_Listener::_openParagraphDelayed().
bool ODe_Style_Style::hasSectionInfo | ( | const PP_AttrProp * | pAP | ) | [static] |
References gchar, and PP_AttrProp::getProperty().
Referenced by ODe_Main_Listener::openSection().
bool ODe_Style_Style::hasTableStyleProps | ( | const PP_AttrProp * | pAP | ) | [static] |
References gchar, and PP_AttrProp::getProperty().
Referenced by ODe_Table_Listener::openTable().
bool ODe_Style_Style::hasTextStyleProps | ( | const PP_AttrProp * | pAP | ) | [static] |
Returns true if the specified PP_AttrProp contains properties that belongs to <style:text-properties> elements.
References gchar, and PP_AttrProp::getProperty().
Referenced by ODe_Text_Listener::_openODParagraph(), ODe_Text_Listener::_openParagraphDelayed(), and ODe_Text_Listener::openSpan().
void ODe_Style_Style::inheritTableCellProperties | ( | const ODe_Style_Style & | tableStyle | ) |
References ODe_Style_Style::CellProps::m_bottomColor, ODe_Style_Style::CellProps::m_bottomThickness, ODe_Style_Style::CellProps::m_leftColor, ODe_Style_Style::CellProps::m_leftThickness, m_pCellProps, ODe_Style_Style::CellProps::m_rightColor, ODe_Style_Style::CellProps::m_rightThickness, ODe_Style_Style::CellProps::m_topColor, ODe_Style_Style::CellProps::m_topThickness, ODe_Style_Style::CellProps::m_verticalAlign, and UT_return_if_fail.
Referenced by ODe_Table_Listener::openCell().
bool ODe_Style_Style::isEmpty | ( | ) | const |
References m_pCellProps, m_pColumnProps, m_pGraphicProps, m_pParagraphProps, m_pRowProps, m_pSectionProps, m_pTableProps, m_pTextProps, and ODE_IS_STYLE_PROPS_EMPTY.
Referenced by write().
bool ODe_Style_Style::isEquivalentTo | ( | const ODe_Style_Style & | rStyle | ) |
It does not take style names into consideration.
Read it like: "is style "T1" equivalent to style "T2" It is *NOT* like: "is style A equal to style B"
References m_family, m_listStyleName, m_masterPageName, m_nextStyleName, m_parentStyleName, m_pCellProps, m_pColumnProps, m_pGraphicProps, m_pParagraphProps, m_pRowProps, m_pSectionProps, m_pTableProps, m_pTextProps, and ODE_EQUAL_STYLE_PROPS.
Referenced by ODe_AutomaticStyles::_storeStyle().
void ODe_Style_Style::makeDefaultStyle | ( | ) | [inline] |
References ODe_Style_Style::ParagraphProps::m_defaultStyle, m_defaultStyle, and m_pParagraphProps.
Referenced by ODe_DocumentData::handleDefaultTabInterval().
ODe_Style_Style & ODe_Style_Style::operator= | ( | const ODe_Style_Style & | rStyle | ) |
void ODe_Style_Style::setBreakBefore | ( | const gchar * | pBreakBefore | ) |
References ODe_Style_Style::ParagraphProps::m_breakBefore, m_defaultStyle, and m_pParagraphProps.
Referenced by ODe_Text_Listener::_openParagraphDelayed().
void ODe_Style_Style::setColumnWidth | ( | const gchar * | pColumnWidth | ) |
References ODe_Style_Style::ColumnProps::m_columnWidth, and m_pColumnProps.
void ODe_Style_Style::setDefaultTabInterval | ( | const UT_UTF8String & | rDefaultTabInterval | ) |
References m_defaultStyle, ODe_Style_Style::ParagraphProps::m_defaultTabInterval, and m_pParagraphProps.
Referenced by ODe_DocumentData::handleDefaultTabInterval().
void ODe_Style_Style::setFamily | ( | const gchar * | pFamily | ) | [inline] |
References m_family.
Referenced by ODe_Styles::_addStyle(), ODe_Frame_Listener::_openODTextbox(), ODe_Text_Listener::_openParagraphDelayed(), ODe_AutomaticStyles::addTableCellStyle(), ODe_AutomaticStyles::addTableColumnStyle(), ODe_AutomaticStyles::addTableRowStyle(), ODe_AutomaticStyles::addTableStyle(), ODe_DocumentData::handleDefaultTabInterval(), ODe_Text_Listener::insertInlinedImage(), ODe_Text_Listener::insertPositionedImage(), ODe_Main_Listener::openSection(), and ODe_Text_Listener::openSpan().
void ODe_Style_Style::setHorizontalPos | ( | const UT_UTF8String & | rHorizontalPos | ) |
References ODe_Style_Style::GraphicProps::m_horizontalPos, and m_pGraphicProps.
Referenced by ODe_Frame_Listener::_openODTextbox().
void ODe_Style_Style::setListStyleName | ( | const UT_UTF8String & | rListStyleName | ) | [inline] |
References m_listStyleName.
void ODe_Style_Style::setMasterPageName | ( | const UT_UTF8String & | rMasterPageName | ) | [inline] |
References m_masterPageName.
Referenced by ODe_Text_Listener::_openParagraphDelayed().
void ODe_Style_Style::setMinRowHeight | ( | const gchar * | pMinRowHeight | ) |
References ODe_Style_Style::RowProps::m_minRowHeight, and m_pRowProps.
Referenced by ODe_Table_Listener::openTable().
void ODe_Style_Style::setPadding | ( | const UT_UTF8String & | rPadding | ) |
References ODe_Style_Style::GraphicProps::m_padding, and m_pGraphicProps.
Referenced by ODe_Frame_Listener::_openODTextbox().
void ODe_Style_Style::setParentStyleName | ( | const gchar * | pParentStyleName | ) | [inline] |
References m_parentStyleName.
Referenced by ODe_Frame_Listener::_openODTextbox(), ODe_Text_Listener::insertInlinedImage(), and ODe_Text_Listener::insertPositionedImage().
void ODe_Style_Style::setRelColumnWidth | ( | const gchar * | pRelColumnWidth | ) |
References m_pColumnProps, and ODe_Style_Style::ColumnProps::m_RelColumnWidth.
Referenced by ODe_Table_Listener::openTable().
void ODe_Style_Style::setRelTableWidth | ( | const gchar * | pRelTableWidth | ) |
void ODe_Style_Style::setRowHeight | ( | const gchar * | pRowHeight | ) |
References m_pRowProps, and ODe_Style_Style::RowProps::m_rowHeight.
void ODe_Style_Style::setRunThrough | ( | const UT_UTF8String & | rRunThrough | ) |
References m_pGraphicProps, and ODe_Style_Style::GraphicProps::m_runThrough.
Referenced by ODe_Text_Listener::insertInlinedImage(), and ODe_Text_Listener::insertPositionedImage().
void ODe_Style_Style::setStyleName | ( | const UT_UTF8String & | rStyleName | ) | [inline] |
References m_name.
Referenced by ODe_Frame_Listener::_openODTextbox(), ODe_AutomaticStyles::_storeStyle(), ODe_AutomaticStyles::addTableCellStyle(), ODe_AutomaticStyles::addTableColumnStyle(), ODe_AutomaticStyles::addTableRowStyle(), ODe_AutomaticStyles::addTableStyle(), and ODe_Text_Listener::insertInlinedImage().
void ODe_Style_Style::setTableWidth | ( | const gchar * | pTableWidth | ) |
void ODe_Style_Style::setVerticalPos | ( | const UT_UTF8String & | rVerticalPos | ) |
References m_pGraphicProps, and ODe_Style_Style::GraphicProps::m_verticalPos.
Referenced by ODe_Frame_Listener::_openODTextbox(), and ODe_Text_Listener::insertInlinedImage().
void ODe_Style_Style::setVerticalRel | ( | const UT_UTF8String & | rVerticalRel | ) |
References m_pGraphicProps, and ODe_Style_Style::GraphicProps::m_verticalRel.
Referenced by ODe_Text_Listener::insertInlinedImage().
void ODe_Style_Style::setWrap | ( | const UT_UTF8String & | rWrap | ) |
References m_pGraphicProps, and ODe_Style_Style::GraphicProps::m_wrap.
Referenced by ODe_Text_Listener::insertInlinedImage(), and ODe_Text_Listener::insertPositionedImage().
bool ODe_Style_Style::write | ( | GsfOutput * | pODT, | |
const UT_UTF8String & | rSpacesOffset | |||
) | const |
Writes <style:style> and its subelements.
rSpacesOffset | Space characters written at the beginning of each new line. |
References convertStyleToNCName(), UT_UTF8String::empty(), UT_UTF8String::escapeXML(), isEmpty(), m_defaultStyle, m_family, m_listStyleName, m_masterPageName, m_name, m_nextStyleName, m_parentStyleName, m_pCellProps, m_pColumnProps, m_pGraphicProps, m_pParagraphProps, m_pRowProps, m_pSectionProps, m_pTableProps, m_pTextProps, ODE_WRITE_STYLE_PROPS, ODe_writeAttribute(), ODe_writeUTF8String(), UT_ASSERT_HARMLESS, and UT_SHOULD_NOT_HAPPEN.
Referenced by ODe_Styles::_writeStyles().
bool ODe_Style_Style::m_defaultStyle [private] |
UT_UTF8String ODe_Style_Style::m_family [private] |
Referenced by isEquivalentTo(), setFamily(), and write().
Referenced by fetchAttributesFromAbiBlock(), isEquivalentTo(), setListStyleName(), and write().
Referenced by isEquivalentTo(), setMasterPageName(), and write().
UT_UTF8String ODe_Style_Style::m_name [private] |
Referenced by fetchAttributesFromAbiStyle(), getName(), setStyleName(), and write().
std::map< std::string, std::string > ODe_Style_Style::m_NCStyleMappings [static, private] |
Referenced by convertStyleToNCName().
Referenced by fetchAttributesFromAbiStyle(), isEquivalentTo(), and write().
class ODe_Style_Style::CellProps * ODe_Style_Style::m_pCellProps [private] |
Referenced by fetchAttributesFromAbiCell(), inheritTableCellProperties(), isEmpty(), isEquivalentTo(), operator=(), write(), and ~ODe_Style_Style().
class ODe_Style_Style::ColumnProps * ODe_Style_Style::m_pColumnProps [private] |
Referenced by isEmpty(), isEquivalentTo(), operator=(), setColumnWidth(), setRelColumnWidth(), write(), and ~ODe_Style_Style().
class ODe_Style_Style::GraphicProps * ODe_Style_Style::m_pGraphicProps [private] |
class ODe_Style_Style::ParagraphProps * ODe_Style_Style::m_pParagraphProps [private] |
class ODe_Style_Style::RowProps * ODe_Style_Style::m_pRowProps [private] |
Referenced by isEmpty(), isEquivalentTo(), operator=(), setMinRowHeight(), setRowHeight(), write(), and ~ODe_Style_Style().
class ODe_Style_Style::SectionProps * ODe_Style_Style::m_pSectionProps [private] |
Referenced by fetchAttributesFromAbiSection(), isEmpty(), isEquivalentTo(), operator=(), write(), and ~ODe_Style_Style().
class ODe_Style_Style::TableProps * ODe_Style_Style::m_pTableProps [private] |
Referenced by fetchAttributesFromAbiTable(), isEmpty(), isEquivalentTo(), operator=(), write(), and ~ODe_Style_Style().
class ODe_Style_Style::TextProps * ODe_Style_Style::m_pTextProps [private] |