#include <ap_Dialog_Stylist.h>
Public Member Functions | |
Stylist_tree (PD_Document *pDoc) | |
virtual | ~Stylist_tree (void) |
bool | findStyle (UT_UTF8String &sStyleName, UT_sint32 &row, UT_sint32 &col) |
bool | getStyleAtRowCol (UT_UTF8String &sStyle, UT_sint32 row, UT_sint32 col) |
UT_sint32 | getNumRows (void) const |
UT_sint32 | getNumCols (UT_sint32 row) const |
void | buildStyles (PD_Document *pDoc) |
UT_sint32 | getNumStyles (void) const |
bool | getNameOfRow (std::string &sName, UT_sint32 row) const |
bool | isHeading (const PD_Style *pStyle, UT_sint32 iDepth=10) const |
bool | isList (const PD_Style *pStyle, UT_sint32 iDepth=10) const |
bool | isFootnote (const PD_Style *pStyle, UT_sint32 iDepth=10) const |
bool | isUser (const PD_Style *pStyle) const |
Private Attributes | |
UT_GenericVector< const PD_Style * > | m_vecAllStyles |
UT_GenericVector< Stylist_row * > | m_vecStyleRows |
Stylist_tree::Stylist_tree | ( | PD_Document * | pDoc | ) |
This class holds the current style tree and provides a useful interface to the tree for the GUI.
References buildStyles(), UT_GenericVector< T >::clear(), m_vecAllStyles, and m_vecStyleRows.
Stylist_tree::~Stylist_tree | ( | void | ) | [virtual] |
References m_vecStyleRows, UT_DEBUGMSG, and UT_VECTOR_PURGEALL.
void Stylist_tree::buildStyles | ( | PD_Document * | pDoc | ) |
This method builds the tree of styles from the Document given.
References UT_GenericVector< T >::addItem(), Stylist_row::addStyle(), UT_GenericVector< T >::clear(), DELETEP, PD_Document::enumStyles(), XAP_App::getApp(), PD_Style::getName(), UT_GenericVector< T >::getNthItem(), XAP_App::getStringSet(), PD_Document::getStyleCount(), XAP_StringSet::getValueUTF8(), isFootnote(), isHeading(), isList(), isUser(), m_vecAllStyles, m_vecStyleRows, UT_GenericVector< T >::setNthItem(), Stylist_row::setRowName(), UT_DEBUGMSG, UT_return_if_fail, and UT_VECTOR_PURGEALL.
Referenced by Stylist_tree(), and AP_Dialog_Stylist::updateDialog().
bool Stylist_tree::findStyle | ( | UT_UTF8String & | sStyleName, | |
UT_sint32 & | row, | |||
UT_sint32 & | col | |||
) |
Return the row and column address of the style given. If not found return false.
References Stylist_row::findStyle(), UT_GenericVector< T >::getNthItem(), getNumRows(), and m_vecStyleRows.
Referenced by AP_Win32Dialog_Stylist::setStyleInGUI().
bool Stylist_tree::getNameOfRow | ( | std::string & | sName, | |
UT_sint32 | row | |||
) | const |
return the name of the row given. If the row is invalid return false;
References UT_GenericVector< T >::getNthItem(), getNumRows(), Stylist_row::getRowName(), and m_vecStyleRows.
Referenced by AP_Win32Dialog_Stylist::_fillTree(), and AP_UnixDialog_Stylist::_fillTree().
return the number of columns at the row given. If the row is invalid return 0.
References UT_GenericVector< T >::getNthItem(), Stylist_row::getNumCols(), getNumRows(), and m_vecStyleRows.
Referenced by AP_Win32Dialog_Stylist::_fillTree(), AP_UnixDialog_Stylist::_fillTree(), and AP_CocoaDialog_Stylist::styleClicked.
UT_sint32 Stylist_tree::getNumRows | ( | void | ) | const |
Return the number of rows in the tree.
References UT_GenericVector< T >::getItemCount(), and m_vecStyleRows.
Referenced by AP_Win32Dialog_Stylist::_fillTree(), AP_UnixDialog_Stylist::_fillTree(), findStyle(), getNameOfRow(), getNumCols(), getStyleAtRowCol(), and AP_CocoaDialog_Stylist::styleClicked.
UT_sint32 Stylist_tree::getNumStyles | ( | void | ) | const |
Return the total number of styles in the tree.
References UT_GenericVector< T >::getItemCount(), and m_vecAllStyles.
Referenced by AP_Dialog_Stylist::getNumStyles().
bool Stylist_tree::getStyleAtRowCol | ( | UT_UTF8String & | sStyle, | |
UT_sint32 | row, | |||
UT_sint32 | col | |||
) |
Return the style at the row and column given. If the (row,col) address is valid, return false.
References UT_GenericVector< T >::getNthItem(), getNumRows(), Stylist_row::getStyle(), and m_vecStyleRows.
Referenced by AP_Win32Dialog_Stylist::_fillTree(), AP_UnixDialog_Stylist::_fillTree(), AP_Win32Dialog_Stylist::_styleClicked(), AP_UnixDialog_Stylist::styleClicked(), and AP_CocoaDialog_Stylist::styleClicked.
Returns true if the style is withinthe "Footnote/Endnote" type of styles.
References PD_Style::getBasedOn(), and PD_Style::getName().
Referenced by buildStyles().
Returns true if the style is withinthe "Heading" type of styles.
References PD_Style::getBasedOn(), and PD_Style::getName().
Referenced by buildStyles().
Returns true if the style is withinthe "List" type of styles.
References PD_Style::getBasedOn(), and PD_Style::getName().
Referenced by buildStyles().
bool Stylist_tree::isUser | ( | const PD_Style * | pStyle | ) | const |
Returns true if the style is a userdefined style.
References PD_Style::isUserDefined().
Referenced by buildStyles().
UT_GenericVector<const PD_Style *> Stylist_tree::m_vecAllStyles [private] |
Referenced by buildStyles(), getNumStyles(), and Stylist_tree().
UT_GenericVector<Stylist_row *> Stylist_tree::m_vecStyleRows [private] |
Referenced by buildStyles(), findStyle(), getNameOfRow(), getNumCols(), getNumRows(), getStyleAtRowCol(), Stylist_tree(), and ~Stylist_tree().