![]() | InDesign SDK 20.5 |
#include <CHMLFiltTextHelper.h>
Public Member Functions | |
| CHMLFiltTextHelper (const UIDRef &textModelUIDRef, const RangeData &targetRangeData) | |
| CHMLFiltTextHelper (const UIDRef &textModelUIDRef) | |
| virtual | ~CHMLFiltTextHelper () |
| ErrorCode | InsertText (const WideString &wstr) |
| ErrorCode | Apply () |
| void | AddUnderline () |
| void | AddNonUnderline () |
| void | AddAlignment (ICompositionStyle::TextAlignment alignment) |
| void | AddBold () |
| void | AddDefaultFont () |
| void | AddPointSize (const PMReal &pointSize) |
| void | AddFont (const PMString &fontName) |
| void | Reset (const RangeData &targetRangeData) |
| void | Reset (const TextIndex &position) |
Protected Member Functions | |
| void | checkInvariant () |
| ErrorCode | doApplyAttributes (boost::shared_ptr< AttributeBossList > &attrList, const ClassID &which) |
Helper methods to ease text manipulations; these can be used to add overrides to both character and paragraph attributes to a specified text model and range (RangeData). Note that the overrides will not be applied until the Apply method is called on the instance. This enables several different overrides to be stored up and then applied by processing a single command rather than lots of individual commands for each override.
| CHMLFiltTextHelper::CHMLFiltTextHelper | ( | const UIDRef & | textModelUIDRef, |
| const RangeData & | targetRangeData | ||
| ) |
Constructor taking a text model and a range.
| textModelUIDRef | IN text model to encapsulate |
| targetRangeData | IN range over which this will operate |
| CHMLFiltTextHelper::CHMLFiltTextHelper | ( | const UIDRef & | textModelUIDRef | ) |
Constructor taking just a text model but no range.
| textModelUIDRef | IN text model to encapsulate |
| virtual |
Destructor
| void CHMLFiltTextHelper::AddAlignment | ( | ICompositionStyle::TextAlignment | alignment | ) |
Add an alignment override (paragraph level attribute)
| alignment | IN specifies the type of alignment to set |
| void CHMLFiltTextHelper::AddBold | ( | ) |
Add a override to add a bold style
| void CHMLFiltTextHelper::AddDefaultFont | ( | ) |
Add override to restore the default font (e.g. to remove bold)
| void CHMLFiltTextHelper::AddFont | ( | const PMString & | fontName | ) |
Add a font override
| fontName | IN name of font to apply |
| void CHMLFiltTextHelper::AddNonUnderline | ( | ) |
Add an override to remove underlining
| void CHMLFiltTextHelper::AddPointSize | ( | const PMReal & | pointSize | ) |
Add a point size override
| pointSize | IN point size of override. |
| void CHMLFiltTextHelper::AddUnderline | ( | ) |
Add an underline override.
| ErrorCode CHMLFiltTextHelper::Apply | ( | ) |
Applies the overrides stored in this object to appropriate targets such as the strand for paragraph attributes (kParaAttrStrandBoss) or character attributes (kCharAttrStrandBoss).
| ErrorCode CHMLFiltTextHelper::InsertText | ( | const WideString & | wstr | ) |
Method to insert a WideString into the text model at the current insertion position (start of encapsulated range or the insertion position stored in this).
| wstr | IN text to insert |
| void CHMLFiltTextHelper::Reset | ( | const RangeData & | targetRangeData | ) |
Change the encapsulated text range (stored in a RangeData)
| targetRangeData | IN new range |
| void CHMLFiltTextHelper::Reset | ( | const TextIndex & | position | ) |
Change from a range to an insertion position
| position | IN insertion position in text model. |