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

ODi_Style_Style_Family Class Reference

Used by ODi_Office_Styles to handle a family of "style:style" styles. More...

#include <ODi_Style_Style_Family.h>

List of all members.

Public Member Functions

 ODi_Style_Style_Family ()
virtual ~ODi_Style_Style_Family ()
 Destructor.
ODi_Style_StyleaddStyle (const gchar **ppAtts, ODi_ElementStack &rElementStack, ODi_Abi_Data &rAbiData, std::string *pReplacementName=NULL, std::string *pReplacementDisplayName=NULL)
ODi_Style_StyleaddDefaultStyle (ODi_ElementStack &rElementStack, ODi_Abi_Data &rAbiData)
void fixStyles ()
 Fix any problems encountered on the added styles.
void linkStyles ()
 It links, if applicable, each style with its parent and its next style.
const ODi_Style_StylegetStyle (const gchar *pStyleName, bool bOnContentStream) const
const ODi_Style_StylegetDefaultStyle () const
void removeStyleStyle (ODi_Style_Style *pRemovedStyle, bool bOnContentStream)
void defineAbiStyles (PD_Document *pDocument) const
void buildAbiPropsAttrString (ODi_FontFaceDecls &rFontFaceDecls)

Private Types

typedef std::map< std::string,
ODi_Style_Style * > 
StyleMap

Private Member Functions

void _buildAbiPropsAttrString (ODi_FontFaceDecls &rFontFaceDecls, const StyleMap &map)
void _findSuitableReplacement (std::string &rReplacementName, const ODi_Style_Style *pRemovedStyle, bool bOnContentStream)
 Finds a suitable replacement for the style that will be removed.
void _reparentStyles (const StyleMap &map, const std::string &removedName, const std::string &replacementName)
void _linkStyles (const StyleMap &map, bool onContentStream)
 Helper function for linkStyles().
void _removeEmptyStyles (const StyleMap &map, bool bOnContentStream)
 Remove any style that doesn't have properties.

Private Attributes

StyleMap m_styles
StyleMap m_styles_contentStream
ODi_Style_Stylem_pDefaultStyle
std::map< std::string,
std::string > 
m_removedStyleStyles
std::map< std::string,
std::string > 
m_removedStyleStyles_contentStream

Detailed Description

Used by ODi_Office_Styles to handle a family of "style:style" styles.

Some family names: "text", "paragraph", "section", "graphic", "table", etc.


Member Typedef Documentation

typedef std::map<std::string, ODi_Style_Style*> ODi_Style_Style_Family::StyleMap [private]

Constructor & Destructor Documentation

ODi_Style_Style_Family::ODi_Style_Style_Family (  )  [inline]
ODi_Style_Style_Family::~ODi_Style_Style_Family (  )  [virtual]

Member Function Documentation

void ODi_Style_Style_Family::_buildAbiPropsAttrString ( ODi_FontFaceDecls rFontFaceDecls,
const StyleMap map 
) [private]

Referenced by buildAbiPropsAttrString().

void ODi_Style_Style_Family::_findSuitableReplacement ( std::string &  rReplacementName,
const ODi_Style_Style pRemovedStyle,
bool  bOnContentStream 
) [private]

Finds a suitable replacement for the style that will be removed.

A suitable replacement is a parent style that has properties or, if none is found, the default paragraph style.

Parameters:
rReplacementName Will receive the name of the replacement style.
pRemovedStyle The style that will be removed.

References ODi_Style_Style::getFamily(), ODi_Style_Style::getName(), ODi_Style_Style::getParentName(), ODi_Style_Style::hasProperties(), m_pDefaultStyle, m_removedStyleStyles, m_removedStyleStyles_contentStream, m_styles, and m_styles_contentStream.

Referenced by removeStyleStyle().

void ODi_Style_Style_Family::_linkStyles ( const StyleMap map,
bool  onContentStream 
) [private]
void ODi_Style_Style_Family::_removeEmptyStyles ( const StyleMap map,
bool  bOnContentStream 
) [private]

Remove any style that doesn't have properties.

References DELETEP, and removeStyleStyle().

Referenced by fixStyles().

void ODi_Style_Style_Family::_reparentStyles ( const StyleMap map,
const std::string &  removedName,
const std::string &  replacementName 
) [private]
ODi_Style_Style* ODi_Style_Style_Family::addDefaultStyle ( ODi_ElementStack rElementStack,
ODi_Abi_Data rAbiData 
) [inline]
ODi_Style_Style * ODi_Style_Style_Family::addStyle ( const gchar **  ppAtts,
ODi_ElementStack rElementStack,
ODi_Abi_Data rAbiData,
std::string *  pReplacementName = NULL,
std::string *  pReplacementDisplayName = NULL 
)
Parameters:
pReplacementName Name to replace the actual name of the style that is being added. NULL if the name shouldn't be replaced.

References gchar, ODi_ElementStack::hasElement(), m_removedStyleStyles, m_removedStyleStyles_contentStream, m_styles, m_styles_contentStream, ODi_Style_Style::setDisplayName(), ODi_Style_Style::setName(), UT_ASSERT, and UT_getAttribute().

Referenced by ODi_Office_Styles::addStyle().

void ODi_Style_Style_Family::buildAbiPropsAttrString ( ODi_FontFaceDecls rFontFaceDecls  ) 
void ODi_Style_Style_Family::defineAbiStyles ( PD_Document pDocument  )  const
void ODi_Style_Style_Family::fixStyles (  ) 

Fix any problems encountered on the added styles.

References _removeEmptyStyles(), m_styles, and m_styles_contentStream.

Referenced by ODi_Office_Styles::_fixStyles().

const ODi_Style_Style* ODi_Style_Style_Family::getDefaultStyle (  )  const [inline]
const ODi_Style_Style * ODi_Style_Style_Family::getStyle ( const gchar *  pStyleName,
bool  bOnContentStream 
) const
void ODi_Style_Style_Family::linkStyles (  ) 

It links, if applicable, each style with its parent and its next style.

By "linking" I mean that a given style will have a pointer to its parent and its next style.

References _linkStyles(), m_styles, and m_styles_contentStream.

Referenced by ODi_Office_Styles::_linkStyles().

void ODi_Style_Style_Family::removeStyleStyle ( ODi_Style_Style pRemovedStyle,
bool  bOnContentStream 
)

Member Data Documentation

std::map<std::string, std::string> ODi_Style_Style_Family::m_removedStyleStyles [private]
std::map<std::string, std::string> ODi_Style_Style_Family::m_removedStyleStyles_contentStream [private]

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