Orcus
|
#include <import_interface.hpp>
Public Member Functions | |
virtual size_t | append (std::string_view s)=0 |
virtual size_t | add (std::string_view s)=0 |
virtual void | set_segment_font (size_t font_index)=0 |
virtual void | set_segment_bold (bool b)=0 |
virtual void | set_segment_italic (bool b)=0 |
virtual void | set_segment_font_name (std::string_view s)=0 |
virtual void | set_segment_font_size (double point)=0 |
virtual void | set_segment_font_color (color_elem_t alpha, color_elem_t red, color_elem_t green, color_elem_t blue)=0 |
virtual void | append_segment (std::string_view s)=0 |
virtual size_t | commit_segments ()=0 |
Interface for importing raw string values shared in string cells. String values may be either with or without formatted segments.
To insert an unformatted string, simply use either append() or add() method. The string will then be immediately pushed to the pool.
To insert a string with mixed formatted segments, you need to first use one or more of:
to define the format attribute(s) of a string segment followed by a call to append_segment(). This may be repeated as many times as necessary. Then as the final step, call commit_segments() to insert the entire series of formatted segments to the pool as a single string entry. The following example demonstrates how the code may look like:
|
pure virtual |
Similar to the append() method, it adds a new string to the string pool; however, this method checks if the string being added is already in the pool before each insertion, to avoid duplicated strings.
s | string to add to the pool. |
|
pure virtual |
Append a new string to the sequence of strings. Order of insertion determines the numerical ID value of an inserted string. Note that this method assumes that the caller knows the string being appended is not yet in the pool; it does not check on duplicated strings.
s | string to append to the pool. |
|
pure virtual |
Push the current string segment to the buffer. Any formatting attributes defined so far will be applied to this segment.
s | string value for the segment. |
|
pure virtual |
Store the entire formatted string in the current buffer to the shared strings pool. The implementor may choose to unconditionally append the string to the pool, or choose to find an existing duplicate and reuse it instead.
|
pure virtual |
Set whether or not to make the current segment bold.
b | true if it's bold, false otherwise. |
|
pure virtual |
Set the index of a font to apply to the current format attributes. Refer to the import_font_style interface on how to obtain a font index. Note that a single font index is associated with multiple font-related formatting attributes, such as font name, font color, boldness and italics.
font_index | positive integer representing the font to use. |
|
pure virtual |
Set the color of a font in ARGB format to the current segment.
alpha | alpha component value (0-255). |
red | red component value (0-255). |
green | green component value (0-255). |
blue | blue component value (0-255). |
|
pure virtual |
Set the name of a font to the current segment.
s | font name. |
|
pure virtual |
Set a font size to the current segment.
point | font size in points. |
|
pure virtual |
Set whether or not to make the current segment italic.
b | true if it's italic, false otherwise. |