Public Types | Public Member Functions | Private Member Functions | Private Attributes

ODi_Style_Style Class Reference

An OpenDocument regular style (<style:style>). More...

#include <ODi_Style_Style.h>

Inheritance diagram for ODi_Style_Style:
ODi_ListenerState

List of all members.

Public Types

enum  HAVE_BORDER { HAVE_BORDER_YES, HAVE_BORDER_NO, HAVE_BORDER_UNSPECIFIED }

Public Member Functions

 ODi_Style_Style (ODi_ElementStack &rElementStack, ODi_Abi_Data &rAbiData)
 Constructor.
virtual ~ODi_Style_Style ()
void startElement (const gchar *pName, const gchar **ppAtts, ODi_ListenerStateAction &rAction)
void endElement (const gchar *pName, ODi_ListenerStateAction &rAction)
void charData (const gchar *, int)
const UT_UTF8StringgetDisplayName () const
void setDisplayName (UT_UTF8String &rDisplayName)
void defineAbiStyle (PD_Document *pDocument)
 Defines an AbiWord style that is equivalent to this OpenDocument style.
ODi_Abi_DatagetAbiData (void)
void buildAbiPropsAttrString (ODi_FontFaceDecls &rFontFaceDecls)
 Builds the AbiWord "props" attribute value that describes this Style.
void getAbiPropsAttrString (UT_UTF8String &rProps, bool appendParentProps=TRUE) const
void setParentStyleName (const gchar *pParentStyleName)
const ODi_Style_StylegetParent () const
void setParentStylePointer (const ODi_Style_Style *pParentStyle)
void setNextStylePointer (const ODi_Style_Style *pNextStyle)
const UT_UTF8StringgetBreakBefore () const
const UT_UTF8StringgetBreakAfter () const
const UT_UTF8StringgetName () const
void setName (UT_UTF8String &rName)
const UT_UTF8StringgetParentName () const
void setParentName (const char *pName)
void setParentName (const UT_UTF8String &rName)
const UT_UTF8StringgetNextStyleName () const
void setNextStyleName (const char *pName)
void setNextStyleName (const UT_UTF8String &rName)
const UT_UTF8StringgetListStyleName () const
bool hasProperties () const
bool isAutomatic () const
const UT_UTF8StringgetMarginLeft () const
const UT_UTF8StringgetTextIndent () const
const UT_UTF8StringgetFamily () const
const UT_UTF8StringgetFontName () const
const UT_UTF8StringgetWrap (bool local) const
const UT_UTF8StringgetHorizPos (bool local) const
const UT_UTF8StringgetVerticalPos (bool local) const
const UT_UTF8StringgetBackgroundColor () const
const UT_UTF8StringgetBackgroundImageID () const
const UT_UTF8StringgetColumnWidth () const
const UT_UTF8StringgetColumnRelWidth () const
const UT_UTF8StringgetMinRowHeight () const
const UT_UTF8StringgetRowHeight () const
const UT_UTF8StringgetBorderTop_thickness () const
const UT_UTF8StringgetBorderTop_color () const
HAVE_BORDER hasTopBorder () const
const UT_UTF8StringgetBorderBottom_thickness () const
const UT_UTF8StringgetBorderBottom_color () const
HAVE_BORDER hasBottomBorder () const
const UT_UTF8StringgetBorderLeft_thickness () const
const UT_UTF8StringgetBorderLeft_color () const
HAVE_BORDER hasLeftBorder () const
const UT_UTF8StringgetBorderRight_thickness () const
const UT_UTF8StringgetBorderRight_color () const
HAVE_BORDER hasRightBorder () const
const UT_UTF8StringgetMasterPageName () const
const UT_UTF8StringgetTableMarginLeft () const
const UT_UTF8StringgetTableMarginRight () const
const UT_UTF8StringgetTableWidth () const
const UT_UTF8StringgetTableRelWidth () const
const UT_UTF8StringgetVerticalAlign () const

Private Member Functions

void _parse_style_style (const gchar **ppAtts)
void _parse_style_paragraphProperties (const gchar **ppProps)
void _parse_style_tabStopProperties (const gchar **ppProps)
 <style:tab-stop />
void _parse_style_textProperties (const gchar **ppProps)
 <style:text-properties />
void _parse_style_sectionProperties (const gchar **ppProps)
void _parse_style_graphicProperties (const gchar **ppProps)
 <style:graphic-properties />
void _parse_style_tableProperties (const gchar **ppProps)
 <style:table-properties />
void _parse_style_tableColumnProperties (const gchar **ppProps)
 <style:table-column-properties />
void _parse_style_tableRowProperties (const gchar **ppProps)
 <style:table-row-properties />
void _parse_style_tableCellProperties (const gchar **ppProps)
 <style:table-cell-properties />
void _parse_style_background_image (const gchar **ppProps)
 <style:background-image />
void _stripColorLength (UT_UTF8String &rColor, UT_UTF8String &rLength, HAVE_BORDER &rHaveBorder, const gchar *pString) const
 If pString is "0.0556in solid #0000ff", rColor will receive "#0000ff", rLength "0.0556in" and rHaveBorder "yes".
bool _isValidDimensionString (const gchar *pString, UT_uint32 length=0) const
 This function shouldn't exist.

Private Attributes

bool m_bAutomatic
const ODi_Style_Stylem_pParentStyle
const ODi_Style_Stylem_pNextStyle
UT_UTF8String m_abiPropsAttr
UT_UTF8String m_name
UT_UTF8String m_displayName
UT_UTF8String m_family
UT_UTF8String m_parentStyleName
UT_UTF8String m_nextStyleName
UT_UTF8String m_listStyleName
UT_UTF8String m_masterPageName
UT_UTF8String m_lineHeight
UT_UTF8String m_align
UT_UTF8String m_breakBefore
UT_UTF8String m_breakAfter
UT_UTF8String m_widows
UT_UTF8String m_orphans
UT_UTF8String m_marginLeft
UT_UTF8String m_marginRight
UT_UTF8String m_marginTop
UT_UTF8String m_marginBottom
UT_UTF8String m_bgcolor
UT_UTF8String m_keepWithNext
UT_UTF8String m_textIndent
UT_UTF8String m_direction
UT_UTF8String m_defaultTabInterval
UT_UTF8String m_tabStops
UT_UTF8String m_color
UT_UTF8String m_textDecoration
UT_UTF8String m_textPos
UT_UTF8String m_fontName
UT_UTF8String m_fontSize
UT_UTF8String m_lang
UT_UTF8String m_fontStyle
UT_UTF8String m_fontWeight
UT_UTF8String m_display
std::string m_transform
UT_UTF8String m_backgroundColor
UT_UTF8String m_backgroundImageID
UT_UTF8String m_TableMarginLeft
UT_UTF8String m_TableMarginRight
UT_UTF8String m_TableWidth
UT_UTF8String m_TableRelWidth
UT_UTF8String m_columns
UT_UTF8String m_columnGap
UT_UTF8String m_wrap
UT_UTF8String m_HorizRel
UT_UTF8String m_HorizPos
UT_UTF8String m_VerticalPos
UT_UTF8String m_VerticalRel
UT_UTF8String m_columnWidth
UT_UTF8String m_columnRelWidth
UT_UTF8String m_minRowHeight
UT_UTF8String m_rowHeight
UT_UTF8String m_VerticalAlign
UT_UTF8String m_borderTop_thickness
UT_UTF8String m_borderTop_color
HAVE_BORDER m_haveTopBorder
UT_UTF8String m_borderBottom_thickness
UT_UTF8String m_borderBottom_color
HAVE_BORDER m_haveBottomBorder
UT_UTF8String m_borderLeft_thickness
UT_UTF8String m_borderLeft_color
HAVE_BORDER m_haveLeftBorder
UT_UTF8String m_borderRight_thickness
UT_UTF8String m_borderRight_color
HAVE_BORDER m_haveRightBorder
UT_UTF8String m_paddingLeft
UT_UTF8String m_paddingRight
UT_UTF8String m_paddingTop
UT_UTF8String m_paddingBot
UT_UTF8String m_mergeBorders
ODi_Abi_Datam_rAbiData

Detailed Description

An OpenDocument regular style (<style:style>).


Member Enumeration Documentation

Enumerator:
HAVE_BORDER_YES 
HAVE_BORDER_NO 
HAVE_BORDER_UNSPECIFIED 

Constructor & Destructor Documentation

ODi_Style_Style::ODi_Style_Style ( ODi_ElementStack rElementStack,
ODi_Abi_Data rAbiData 
)

Constructor.

References ODi_ElementStack::hasElement(), and m_bAutomatic.

virtual ODi_Style_Style::~ODi_Style_Style (  )  [inline, virtual]

Member Function Documentation

bool ODi_Style_Style::_isValidDimensionString ( const gchar *  pString,
UT_uint32  length = 0 
) const [private]

This function shouldn't exist.

The code should use UT_isValidDimensionString instead. The problem with the UT function is that it doesn't check the dimension specifier and only accepts NULL terminated strings.

Parameters:
length 0 for NULL terminated strings.

References dim, DIM_none, gchar, and UT_determineDimension().

Referenced by _stripColorLength().

void ODi_Style_Style::_parse_style_background_image ( const gchar **  ppProps  )  [private]
void ODi_Style_Style::_parse_style_sectionProperties ( const gchar **  ppProps  )  [private]
void ODi_Style_Style::_parse_style_style ( const gchar **  ppAtts  )  [private]
void ODi_Style_Style::_parse_style_tableColumnProperties ( const gchar **  ppProps  )  [private]

<style:table-column-properties />

References gchar, m_columnRelWidth, m_columnWidth, m_name, UT_DEBUGMSG, UT_getAttribute(), and UT_UTF8String::utf8_str().

Referenced by startElement().

void ODi_Style_Style::_parse_style_tableProperties ( const gchar **  ppProps  )  [private]
void ODi_Style_Style::_parse_style_tableRowProperties ( const gchar **  ppProps  )  [private]

<style:table-row-properties />

References gchar, m_minRowHeight, m_rowHeight, and UT_getAttribute().

Referenced by startElement().

void ODi_Style_Style::_parse_style_tabStopProperties ( const gchar **  ppProps  )  [private]
void ODi_Style_Style::_parse_style_textProperties ( const gchar **  ppProps  )  [private]
void ODi_Style_Style::_stripColorLength ( UT_UTF8String rColor,
UT_UTF8String rLength,
ODi_Style_Style::HAVE_BORDER rHaveBorder,
const gchar *  pString 
) const [private]

If pString is "0.0556in solid #0000ff", rColor will receive "#0000ff", rLength "0.0556in" and rHaveBorder "yes".

If pString is "none", both rColor and rLenght will be empty and rHaveBorder will be "no"

References _isValidDimensionString(), UT_UTF8String::assign(), and UT_UTF8String::clear().

Referenced by _parse_style_graphicProperties(), _parse_style_paragraphProperties(), and _parse_style_tableCellProperties().

void ODi_Style_Style::charData ( const gchar *  ,
int   
) [inline, virtual]

Implements ODi_ListenerState.

void ODi_Style_Style::defineAbiStyle ( PD_Document pDocument  ) 

Defines an AbiWord style that is equivalent to this OpenDocument style.

Called by text and paragraph styles.

Parameters:
pDocument The AbiWord document on which the style will be defined.
pDocument The AbiWord document on which the style will be defined.

References PD_Document::appendStyle(), gchar, getDisplayName(), m_abiPropsAttr, m_bAutomatic, m_displayName, m_family, m_pNextStyle, m_pParentStyle, UT_ASSERT_HARMLESS, UT_SHOULD_NOT_HAPPEN, and UT_UTF8String::utf8_str().

Referenced by ODi_Style_Style_Family::defineAbiStyles().

void ODi_Style_Style::endElement ( const gchar *  pName,
ODi_ListenerStateAction rAction 
) [virtual]
ODi_Abi_Data& ODi_Style_Style::getAbiData ( void   )  [inline]

References m_rAbiData.

void ODi_Style_Style::getAbiPropsAttrString ( UT_UTF8String rProps,
bool  appendParentProps = TRUE 
) const
Parameters:
rProps The string that will have appended to it the properties of this style.
appendParentProps If TRUE, it will append all parent props before appending its own props. If FALSE, it will append only its own props.
rProps The string that will have appended to it the properties of this style.

References UT_UTF8String::empty(), getAbiPropsAttrString(), m_abiPropsAttr, and m_pParentStyle.

Referenced by ODi_TextContent_ListenerState::_insureInSection(), ODi_TextContent_ListenerState::_startParagraphElement(), getAbiPropsAttrString(), and ODi_TextContent_ListenerState::startElement().

const UT_UTF8String * ODi_Style_Style::getBackgroundImageID (  )  const
const UT_UTF8String* ODi_Style_Style::getBorderBottom_color (  )  const [inline]
const UT_UTF8String* ODi_Style_Style::getBorderBottom_thickness (  )  const [inline]
const UT_UTF8String* ODi_Style_Style::getBorderLeft_color (  )  const [inline]
const UT_UTF8String* ODi_Style_Style::getBorderLeft_thickness (  )  const [inline]
const UT_UTF8String* ODi_Style_Style::getBorderRight_color (  )  const [inline]
const UT_UTF8String* ODi_Style_Style::getBorderRight_thickness (  )  const [inline]
const UT_UTF8String* ODi_Style_Style::getBorderTop_color (  )  const [inline]
const UT_UTF8String* ODi_Style_Style::getBorderTop_thickness (  )  const [inline]
const UT_UTF8String& ODi_Style_Style::getBreakAfter (  )  const [inline]
const UT_UTF8String& ODi_Style_Style::getBreakBefore (  )  const [inline]
const UT_UTF8String* ODi_Style_Style::getColumnRelWidth (  )  const [inline]
const UT_UTF8String* ODi_Style_Style::getColumnWidth (  )  const [inline]
const UT_UTF8String* ODi_Style_Style::getFamily (  )  const [inline]
const UT_UTF8String* ODi_Style_Style::getFontName (  )  const [inline]
const UT_UTF8String * ODi_Style_Style::getHorizPos ( bool  local  )  const
Parameters:
local If "true", It returns the plain value of the corresponding variable. Otherwise, it considers the final value of this property, taking into account its value on the parent styles.

References UT_UTF8String::empty(), getHorizPos(), m_HorizPos, and m_pParentStyle.

Referenced by ODi_Frame_ListenerState::_drawTextBox(), and getHorizPos().

const UT_UTF8String& ODi_Style_Style::getListStyleName (  )  const [inline]
const UT_UTF8String* ODi_Style_Style::getMarginLeft (  )  const [inline]
const UT_UTF8String* ODi_Style_Style::getMasterPageName (  )  const [inline]
const UT_UTF8String* ODi_Style_Style::getMinRowHeight (  )  const [inline]
const UT_UTF8String& ODi_Style_Style::getNextStyleName (  )  const [inline]
const UT_UTF8String* ODi_Style_Style::getRowHeight (  )  const [inline]
const UT_UTF8String* ODi_Style_Style::getTableMarginLeft (  )  const [inline]
const UT_UTF8String* ODi_Style_Style::getTableMarginRight (  )  const [inline]

References m_TableMarginRight.

const UT_UTF8String* ODi_Style_Style::getTableRelWidth (  )  const [inline]
const UT_UTF8String* ODi_Style_Style::getTableWidth (  )  const [inline]
const UT_UTF8String* ODi_Style_Style::getTextIndent (  )  const [inline]
const UT_UTF8String* ODi_Style_Style::getVerticalAlign (  )  const [inline]
const UT_UTF8String * ODi_Style_Style::getVerticalPos ( bool  local  )  const
Parameters:
local If "true", It returns the plain value of the corresponding variable. Otherwise, it considers the final value of this property, taking into account its value on the parent styles.

References UT_UTF8String::empty(), getVerticalPos(), m_pParentStyle, and m_VerticalPos.

Referenced by getVerticalPos().

const UT_UTF8String * ODi_Style_Style::getWrap ( bool  local  )  const
Parameters:
local If "true", It returns the plain value of the corresponding variable. Otherwise, it considers the final value of this property, taking into account its value on the parent styles.

References UT_UTF8String::empty(), getWrap(), m_pParentStyle, and m_wrap.

Referenced by ODi_Frame_ListenerState::_getFrameProperties(), getWrap(), and ODi_TextContent_ListenerState::startElement().

HAVE_BORDER ODi_Style_Style::hasBottomBorder (  )  const [inline]
HAVE_BORDER ODi_Style_Style::hasLeftBorder (  )  const [inline]
HAVE_BORDER ODi_Style_Style::hasRightBorder (  )  const [inline]
HAVE_BORDER ODi_Style_Style::hasTopBorder (  )  const [inline]
void ODi_Style_Style::setDisplayName ( UT_UTF8String rDisplayName  )  [inline]
void ODi_Style_Style::setName ( UT_UTF8String rName  )  [inline]

References m_name.

Referenced by ODi_Style_Style_Family::addStyle().

void ODi_Style_Style::setNextStyleName ( const UT_UTF8String rName  )  [inline]

References m_nextStyleName.

void ODi_Style_Style::setNextStyleName ( const char *  pName  )  [inline]
void ODi_Style_Style::setNextStylePointer ( const ODi_Style_Style pNextStyle  )  [inline]
void ODi_Style_Style::setParentName ( const char *  pName  )  [inline]
void ODi_Style_Style::setParentName ( const UT_UTF8String rName  )  [inline]

References m_parentStyleName.

void ODi_Style_Style::setParentStyleName ( const gchar *  pParentStyleName  )  [inline]

References m_parentStyleName.

void ODi_Style_Style::setParentStylePointer ( const ODi_Style_Style pParentStyle  )  [inline]

Member Data Documentation


The documentation for this class was generated from the following files: