xlnt
|
Encapsulates zero or more formatted text runs where a text run is a string of text with the same defined formatting. More...
#include <rich_text.hpp>
Public Member Functions | |
rich_text ()=default | |
Constructs an empty rich text object with no font and empty text. More... | |
rich_text (const std::string &plain_text) | |
Constructs a rich text object with the given text and no font. More... | |
rich_text (const rich_text &other) | |
Constructs a rich text object from other More... | |
rich_text (const std::string &plain_text, const class font &text_font) | |
Constructs a rich text object with the given text and font. More... | |
rich_text (const rich_text_run &single_run) | |
Copy constructor. More... | |
void | clear () |
Removes all text runs from this text. More... | |
void | plain_text (const std::string &s, bool preserve_space) |
Clears any runs in this text and adds a single run with default formatting and the given string as its textual content. More... | |
std::string | plain_text () const |
Combines the textual content of each text run in order and returns the result. More... | |
std::vector< rich_text_run > | runs () const |
Returns a copy of the individual runs that comprise this text. More... | |
void | runs (const std::vector< rich_text_run > &new_runs) |
Sets the runs of this text all at once. More... | |
void | add_run (const rich_text_run &t) |
Adds a new run to the end of the set of runs. More... | |
std::vector< phonetic_run > | phonetic_runs () const |
Returns a copy of the individual runs that comprise this text. More... | |
void | phonetic_runs (const std::vector< phonetic_run > &new_phonetic_runs) |
Sets the runs of this text all at once. More... | |
void | add_phonetic_run (const phonetic_run &t) |
Adds a new run to the end of the set of runs. More... | |
bool | has_phonetic_properties () const |
Returns true if this text has phonetic properties More... | |
const phonetic_pr & | phonetic_properties () const |
Returns the phonetic properties of this text. More... | |
void | phonetic_properties (const phonetic_pr &phonetic_props) |
Sets the phonetic properties of this text to phonetic_props More... | |
rich_text & | operator= (const rich_text &rhs) |
Copies rich text object from other More... | |
bool | operator== (const rich_text &rhs) const |
Returns true if the runs that make up this text are identical to those in rhs. More... | |
bool | operator!= (const rich_text &rhs) const |
Returns true if the runs that make up this text are identical to those in rhs. More... | |
bool | operator== (const std::string &rhs) const |
Returns true if this text has a single unformatted run with text equal to rhs. More... | |
bool | operator!= (const std::string &rhs) const |
Returns true if this text has a single unformatted run with text equal to rhs. More... | |
Encapsulates zero or more formatted text runs where a text run is a string of text with the same defined formatting.
|
default |
Constructs an empty rich text object with no font and empty text.
xlnt::rich_text::rich_text | ( | const std::string & | plain_text | ) |
Constructs a rich text object with the given text and no font.
xlnt::rich_text::rich_text | ( | const rich_text & | other | ) |
Constructs a rich text object from other
xlnt::rich_text::rich_text | ( | const std::string & | plain_text, |
const class font & | text_font | ||
) |
Constructs a rich text object with the given text and font.
xlnt::rich_text::rich_text | ( | const rich_text_run & | single_run | ) |
Copy constructor.
void xlnt::rich_text::add_phonetic_run | ( | const phonetic_run & | t | ) |
Adds a new run to the end of the set of runs.
void xlnt::rich_text::add_run | ( | const rich_text_run & | t | ) |
Adds a new run to the end of the set of runs.
void xlnt::rich_text::clear | ( | ) |
Removes all text runs from this text.
bool xlnt::rich_text::has_phonetic_properties | ( | ) | const |
Returns true if this text has phonetic properties
bool xlnt::rich_text::operator!= | ( | const rich_text & | rhs | ) | const |
Returns true if the runs that make up this text are identical to those in rhs.
bool xlnt::rich_text::operator!= | ( | const std::string & | rhs | ) | const |
Returns true if this text has a single unformatted run with text equal to rhs.
bool xlnt::rich_text::operator== | ( | const rich_text & | rhs | ) | const |
Returns true if the runs that make up this text are identical to those in rhs.
bool xlnt::rich_text::operator== | ( | const std::string & | rhs | ) | const |
Returns true if this text has a single unformatted run with text equal to rhs.
const phonetic_pr& xlnt::rich_text::phonetic_properties | ( | ) | const |
Returns the phonetic properties of this text.
void xlnt::rich_text::phonetic_properties | ( | const phonetic_pr & | phonetic_props | ) |
Sets the phonetic properties of this text to phonetic_props
std::vector<phonetic_run> xlnt::rich_text::phonetic_runs | ( | ) | const |
Returns a copy of the individual runs that comprise this text.
void xlnt::rich_text::phonetic_runs | ( | const std::vector< phonetic_run > & | new_phonetic_runs | ) |
Sets the runs of this text all at once.
void xlnt::rich_text::plain_text | ( | const std::string & | s, |
bool | preserve_space | ||
) |
Clears any runs in this text and adds a single run with default formatting and the given string as its textual content.
std::string xlnt::rich_text::plain_text | ( | ) | const |
Combines the textual content of each text run in order and returns the result.
std::vector<rich_text_run> xlnt::rich_text::runs | ( | ) | const |
Returns a copy of the individual runs that comprise this text.
void xlnt::rich_text::runs | ( | const std::vector< rich_text_run > & | new_runs | ) |
Sets the runs of this text all at once.