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 std::string & getDisplayName () const
void setDisplayName (std::string &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 (std::string &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 std::string & getBreakBefore () const
const std::string & getBreakAfter () const
const std::string & getName () const
void setName (std::string &rName)
const std::string & getParentName () const
void setParentName (const char *pName)
void setParentName (const std::string &rName)
const std::string & getNextStyleName () const
void setNextStyleName (const char *pName)
void setNextStyleName (const std::string &rName)
const std::string & getListStyleName () const
bool hasProperties () const
bool isAutomatic () const
const std::string * getMarginLeft () const
const std::string * getTextIndent () const
const std::string * getFamily () const
const std::string * getFontName () const
const std::string * getWrap (bool local) const
const std::string * getHorizPos (bool local) const
const std::string * getVerticalPos (bool local) const
const std::string * getBackgroundColor () const
const std::string * getBackgroundImageID () const
const std::string * getColumnWidth () const
const std::string * getColumnRelWidth () const
const std::string * getMinRowHeight () const
const std::string * getRowHeight () const
const std::string * getBorderTop_thickness () const
const std::string * getBorderTop_color () const
HAVE_BORDER hasTopBorder () const
const std::string * getBorderBottom_thickness () const
const std::string * getBorderBottom_color () const
HAVE_BORDER hasBottomBorder () const
const std::string * getBorderLeft_thickness () const
const std::string * getBorderLeft_color () const
HAVE_BORDER hasLeftBorder () const
const std::string * getBorderRight_thickness () const
const std::string * getBorderRight_color () const
HAVE_BORDER hasRightBorder () const
const std::string * getMasterPageName () const
const std::string * getTableMarginLeft () const
const std::string * getTableMarginRight () const
const std::string * getTableWidth () const
const std::string * getTableRelWidth () const
const std::string * getVerticalAlign () 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 (std::string &rColor, std::string &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
std::string m_abiPropsAttr
std::string m_name
std::string m_displayName
std::string m_family
std::string m_parentStyleName
std::string m_nextStyleName
std::string m_listStyleName
std::string m_masterPageName
std::string m_lineHeight
std::string m_align
std::string m_breakBefore
std::string m_breakAfter
std::string m_widows
std::string m_orphans
std::string m_marginLeft
std::string m_marginRight
std::string m_marginTop
std::string m_marginBottom
std::string m_bgcolor
std::string m_keepWithNext
std::string m_textIndent
std::string m_direction
std::string m_defaultTabInterval
std::string m_tabStops
std::string m_color
std::string m_textDecoration
std::string m_textPos
std::string m_fontName
std::string m_fontSize
std::string m_lang
std::string m_fontStyle
std::string m_fontWeight
std::string m_display
std::string m_transform
std::string m_backgroundColor
std::string m_backgroundImageID
std::string m_TableMarginLeft
std::string m_TableMarginRight
std::string m_TableWidth
std::string m_TableRelWidth
std::string m_columns
std::string m_columnGap
std::string m_wrap
std::string m_HorizRel
std::string m_HorizPos
std::string m_VerticalPos
std::string m_VerticalRel
std::string m_columnWidth
std::string m_columnRelWidth
std::string m_minRowHeight
std::string m_rowHeight
std::string m_VerticalAlign
std::string m_borderTop_thickness
std::string m_borderTop_color
HAVE_BORDER m_haveTopBorder
std::string m_borderBottom_thickness
std::string m_borderBottom_color
HAVE_BORDER m_haveBottomBorder
std::string m_borderLeft_thickness
std::string m_borderLeft_color
HAVE_BORDER m_haveLeftBorder
std::string m_borderRight_thickness
std::string m_borderRight_color
HAVE_BORDER m_haveRightBorder
std::string m_paddingLeft
std::string m_paddingRight
std::string m_paddingTop
std::string m_paddingBot
std::string 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, and UT_getAttribute().

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]

<style:tab-stop />

References gchar, m_tabStops, type, UT_getAttribute(), and UT_return_if_fail.

Referenced by startElement().

void ODi_Style_Style::_parse_style_textProperties ( const gchar **  ppProps  )  [private]
void ODi_Style_Style::_stripColorLength ( std::string &  rColor,
std::string &  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().

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(), getDisplayName(), m_abiPropsAttr, m_bAutomatic, m_displayName, m_family, m_pNextStyle, m_pParentStyle, UT_ASSERT_HARMLESS, and UT_SHOULD_NOT_HAPPEN.

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 ( std::string &  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 getAbiPropsAttrString(), m_abiPropsAttr, and m_pParentStyle.

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

const std::string * ODi_Style_Style::getBackgroundImageID (  )  const
const std::string* ODi_Style_Style::getBorderBottom_color (  )  const [inline]
const std::string* ODi_Style_Style::getBorderBottom_thickness (  )  const [inline]
const std::string* ODi_Style_Style::getBorderLeft_color (  )  const [inline]
const std::string* ODi_Style_Style::getBorderLeft_thickness (  )  const [inline]
const std::string* ODi_Style_Style::getBorderRight_color (  )  const [inline]
const std::string* ODi_Style_Style::getBorderRight_thickness (  )  const [inline]
const std::string* ODi_Style_Style::getBorderTop_color (  )  const [inline]
const std::string* ODi_Style_Style::getBorderTop_thickness (  )  const [inline]
const std::string& ODi_Style_Style::getBreakAfter (  )  const [inline]
const std::string& ODi_Style_Style::getBreakBefore (  )  const [inline]
const std::string* ODi_Style_Style::getColumnRelWidth (  )  const [inline]
const std::string* ODi_Style_Style::getColumnWidth (  )  const [inline]
const std::string* ODi_Style_Style::getFamily (  )  const [inline]
const std::string* ODi_Style_Style::getFontName (  )  const [inline]
const std::string * 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 getHorizPos(), m_HorizPos, and m_pParentStyle.

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

const std::string& ODi_Style_Style::getListStyleName (  )  const [inline]
const std::string* ODi_Style_Style::getMarginLeft (  )  const [inline]
const std::string* ODi_Style_Style::getMasterPageName (  )  const [inline]
const std::string* ODi_Style_Style::getMinRowHeight (  )  const [inline]
const std::string& ODi_Style_Style::getName (  )  const [inline]
const std::string& ODi_Style_Style::getNextStyleName (  )  const [inline]
const std::string& ODi_Style_Style::getParentName (  )  const [inline]
const std::string* ODi_Style_Style::getRowHeight (  )  const [inline]
const std::string* ODi_Style_Style::getTableMarginLeft (  )  const [inline]
const std::string* ODi_Style_Style::getTableMarginRight (  )  const [inline]

References m_TableMarginRight.

const std::string* ODi_Style_Style::getTableRelWidth (  )  const [inline]
const std::string* ODi_Style_Style::getTableWidth (  )  const [inline]
const std::string* ODi_Style_Style::getTextIndent (  )  const [inline]
const std::string* ODi_Style_Style::getVerticalAlign (  )  const [inline]
const std::string * 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 getVerticalPos(), m_pParentStyle, and m_VerticalPos.

Referenced by getVerticalPos().

const std::string * 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 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 ( std::string &  rDisplayName  )  [inline]
void ODi_Style_Style::setName ( std::string &  rName  )  [inline]

References m_name.

Referenced by ODi_Style_Style_Family::addStyle().

void ODi_Style_Style::setNextStyleName ( const std::string &  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 std::string &  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: