All paragraph styles used to define the chapter levels of a document are called heading styles. More...
#include <ODe_AuxiliaryData.h>
Public Member Functions | |
virtual | ~ODe_HeadingStyles () |
UT_uint8 | getHeadingOutlineLevel (const UT_UTF8String &rStyleName) const |
Given a paragraph style name, this method returns its outline level. | |
void | addStyleName (const gchar *pStyleName, UT_uint8 outlineLevel) |
Private Attributes | |
UT_GenericVector< UT_UTF8String * > | m_styleNames |
UT_GenericVector< UT_uint8 > | m_outlineLevels |
All paragraph styles used to define the chapter levels of a document are called heading styles.
Paragraphs that uses heading styles are the ones that appears on a table of contents.
This class stores the name and the respective outline level of all those styles. It's necessary to do this because, in an OpenDocument document, a standard paragraph is <text:p [...]>, but a heading paragraph is a <text:h text:outline-level="x" [...]>
So, when translating an AbiWord paragraph, we must know wheter it will map into an OpenDocument <text:p> or into a <text:h>.
ODe_HeadingStyles::~ODe_HeadingStyles | ( | ) | [virtual] |
References m_styleNames, and UT_VECTOR_PURGEALL.
void ODe_HeadingStyles::addStyleName | ( | const gchar * | pStyleName, | |
UT_uint8 | outlineLevel | |||
) |
References UT_GenericVector< T >::addItem(), m_outlineLevels, and m_styleNames.
Referenced by ODe_Text_Listener::_initDefaultHeadingStyles(), and ODe_HeadingSearcher_Listener::openTOC().
UT_uint8 ODe_HeadingStyles::getHeadingOutlineLevel | ( | const UT_UTF8String & | rStyleName | ) | const |
Given a paragraph style name, this method returns its outline level.
0 (zero) is returned it the style name is not used by heading paragraphs.
References UT_GenericVector< T >::getItemCount(), m_outlineLevels, m_styleNames, and UT_ASSERT.
Referenced by ODe_TOC_Listener::openBlock().
Referenced by addStyleName(), and getHeadingOutlineLevel().
Referenced by addStyleName(), getHeadingOutlineLevel(), and ~ODe_HeadingStyles().