xlnt
Public Member Functions | List of all members
xlnt::rich_text Class Reference

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_runruns () 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_runphonetic_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_prphonetic_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_textoperator= (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...
 

Detailed Description

Encapsulates zero or more formatted text runs where a text run is a string of text with the same defined formatting.

Constructor & Destructor Documentation

◆ rich_text() [1/5]

xlnt::rich_text::rich_text ( )
default

Constructs an empty rich text object with no font and empty text.

◆ rich_text() [2/5]

xlnt::rich_text::rich_text ( const std::string &  plain_text)

Constructs a rich text object with the given text and no font.

◆ rich_text() [3/5]

xlnt::rich_text::rich_text ( const rich_text other)

Constructs a rich text object from other

◆ rich_text() [4/5]

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.

◆ rich_text() [5/5]

xlnt::rich_text::rich_text ( const rich_text_run single_run)

Copy constructor.

Member Function Documentation

◆ add_phonetic_run()

void xlnt::rich_text::add_phonetic_run ( const phonetic_run t)

Adds a new run to the end of the set of runs.

◆ add_run()

void xlnt::rich_text::add_run ( const rich_text_run t)

Adds a new run to the end of the set of runs.

◆ clear()

void xlnt::rich_text::clear ( )

Removes all text runs from this text.

◆ has_phonetic_properties()

bool xlnt::rich_text::has_phonetic_properties ( ) const

Returns true if this text has phonetic properties

◆ operator!=() [1/2]

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.

◆ operator!=() [2/2]

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.

◆ operator=()

rich_text& xlnt::rich_text::operator= ( const rich_text rhs)

Copies rich text object from other

◆ operator==() [1/2]

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.

◆ operator==() [2/2]

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.

◆ phonetic_properties() [1/2]

const phonetic_pr& xlnt::rich_text::phonetic_properties ( ) const

Returns the phonetic properties of this text.

◆ phonetic_properties() [2/2]

void xlnt::rich_text::phonetic_properties ( const phonetic_pr phonetic_props)

Sets the phonetic properties of this text to phonetic_props

◆ phonetic_runs() [1/2]

std::vector<phonetic_run> xlnt::rich_text::phonetic_runs ( ) const

Returns a copy of the individual runs that comprise this text.

◆ phonetic_runs() [2/2]

void xlnt::rich_text::phonetic_runs ( const std::vector< phonetic_run > &  new_phonetic_runs)

Sets the runs of this text all at once.

◆ plain_text() [1/2]

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.

◆ plain_text() [2/2]

std::string xlnt::rich_text::plain_text ( ) const

Combines the textual content of each text run in order and returns the result.

◆ runs() [1/2]

std::vector<rich_text_run> xlnt::rich_text::runs ( ) const

Returns a copy of the individual runs that comprise this text.

◆ runs() [2/2]

void xlnt::rich_text::runs ( const std::vector< rich_text_run > &  new_runs)

Sets the runs of this text all at once.


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