REFERENCE MANUAL
#include <hps.h>
Public Member Functions | |
StyleKey | AppendNamed (char const *in_style_name, Condition const &in_condition, Style::AppendMode mode=Style::AppendMode::Or) |
StyleKey | AppendSegment (SegmentKey const &in_style_source, Condition const &in_condition, Style::AppendMode mode=Style::AppendMode::Or) |
void | Flush (SegmentKey const &in_style_source) |
void | Flush (SegmentKey const &in_style_source, Condition const &in_condition) |
void | Flush (char const *in_style_name) |
void | Flush (char const *in_style_name, Condition const &in_condition) |
size_t | GetCount () const |
Type | ObjectType () const |
StyleControl & | operator= (StyleControl &&in_that) |
StyleControl & | operator= (StyleControl const &in_that) |
bool | Pop () |
bool | Pop (Style::Type &out_type, SegmentKey &out_segment_source, UTF8 &out_style_name, Condition &out_condition) |
StyleKey | PushNamed (char const *in_style_name) |
StyleKey | PushNamed (char const *in_style_name, Condition const &in_condition) |
StyleKey | PushSegment (SegmentKey const &in_style_source) |
StyleKey | PushSegment (SegmentKey const &in_style_source, Condition const &in_condition) |
void | Set (StyleTypeArray const &in_types, SegmentKeyArray const &in_segment_sources, UTF8Array const &in_style_names, ConditionArray const &in_conditions) |
void | Set (StyleTypeArray const &in_types, SegmentKeyArray const &in_segment_sources, UTF8Array const &in_style_names) |
void | Set (size_t in_count, Style::Type const in_types[], SegmentKey const in_segment_sources[], UTF8 const in_style_names[], Condition const in_conditions[]) |
StyleKey | SetNamed (char const *in_style_name) |
StyleKey | SetNamed (char const *in_style_name, Condition const &in_condition) |
StyleKey | SetSegment (SegmentKey const &in_style_source) |
StyleKey | SetSegment (SegmentKey const &in_style_source, Condition const &in_condition) |
bool | Show (StyleTypeArray &out_types, SegmentKeyArray &out_segment_sources, UTF8Array &out_style_names, ConditionArray &out_conditions) const |
bool | Show (StyleKeyArray &out_styles) const |
bool | ShowAllNamed (UTF8Array &out_names, ConditionArray &out_conditions) const |
bool | ShowAllNamed (StyleKeyArray &out_styles) const |
bool | ShowAllSegment (SegmentKeyArray &out_segments, ConditionArray &out_conditions) const |
bool | ShowAllSegment (StyleKeyArray &out_styles) const |
bool | ShowTop (Style::Type &out_type, SegmentKey &out_segment_source, UTF8 &out_style_name, Condition &out_condition) const |
bool | ShowTop (StyleKey &out_style) const |
StyleControl (SegmentKey &in_seg) | |
StyleControl (StyleControl const &in_that) | |
StyleControl (StyleControl &&in_that) | |
void | UnsetAllNamed () |
void | UnsetAllSegment () |
void | UnsetEverything () |
void | UnsetTop () |
~StyleControl () | |
![]() | |
virtual bool | Empty () const |
intptr_t | GetClassID () const |
intptr_t | GetInstanceID () const |
bool | HasType (Type in_mask) const |
Object (Object &&in_that) | |
Object & | operator= (Object const &other_object) |
Object & | operator= (Object &&in_that) |
virtual void | Reset () |
Type | Type () const |
Additional Inherited Members | |
![]() | |
template<typename T > | |
static intptr_t | ClassID () |
![]() | |
Control (Control &&in_that) | |
Control & | operator= (Control &&in_that) |
The StyleControl class is a smart pointer that is tied to a database object. Controls are used for manipulating settings within the database.
|
explicit |
Initializes a control tied to the segment in_seg.
StyleControl::StyleControl | ( | StyleControl const & | in_that | ) |
Initializes a control tied to the same object as in_that.
StyleControl::StyleControl | ( | StyleControl && | in_that | ) |
The move constructor creates a StyleControl by transferring the underlying impl of the rvalue reference to this StyleControl thereby avoiding a copy and allocation.
in_that | An rvalue reference to a StyleControl to take the impl from. |
StyleControl::~StyleControl | ( | ) |
Releases a reference to the database object this control is tied to.
StyleKey StyleControl::AppendNamed | ( | char const * | in_style_name, |
Condition const & | in_condition, | ||
Style::AppendMode | mode = Style::AppendMode::Or |
||
) |
Appends condition to an existing condition if matching style exists else adds a new named style to the top of the style stack.
StyleKey StyleControl::AppendSegment | ( | SegmentKey const & | in_style_source, |
Condition const & | in_condition, | ||
Style::AppendMode | mode = Style::AppendMode::Or |
||
) |
Appends condition to an existing condition if matching style exists else adds a new a new style based on in_style_source and places it on the top of the style stack.
void StyleControl::Flush | ( | SegmentKey const & | in_style_source | ) |
Removes any styles on the associated segment which refer to the provided style source. The styles will be removed regardless if there is a conditional expression associated with the style or not.
in_style_source | The style source used to identify which styles to remove. |
void StyleControl::Flush | ( | SegmentKey const & | in_style_source, |
Condition const & | in_condition | ||
) |
Removes any styles on the associated segment which refer to the provided style source with the provided condition. If a style is found which references the style source and has an associated conditional expression which contains the provided conditional expression, the provided conditional expression will be removed from the conditional expression associated with the style. If removing the provided conditional expression from the style results in the complete removal of the conditional expression for the style, the style itself will be completely removed.
in_style_source | The style source used to identify which styles to remove or modify. |
in_condition | The conditional expression to remove from styles which refer to the provided style source. |
void StyleControl::Flush | ( | char const * | in_style_name | ) |
Removes any styles on the associated segment which refer to the provided style name. The styles will be removed regardless if there is a conditional expression associated with the style or not.
in_style_name | The style name used to identify which styles to remove. |
void StyleControl::Flush | ( | char const * | in_style_name, |
Condition const & | in_condition | ||
) |
Removes any styles on the associated segment which refer to the provided style name with the provided condition. If a style is found which references the style name and has an associated conditional expression which contains the provided conditional expression, the provided conditional expression will be removed from the conditional expression associated with the style. If removing the provided conditional expression from the style results in the complete removal of the conditional expression for the style, the style itself will be completely removed.
in_style_name | The style name used to identify which styles to remove or modify. |
in_condition | The conditional expression to remove from styles which refer to the provided style name. |
size_t StyleControl::GetCount | ( | ) | const |
Returns the number of styles set here.
|
inlinevirtual |
This function returns the type the object, as declared. This does not necessarily give the true type of the underlying object.
Reimplemented from Control.
StyleControl& StyleControl::operator= | ( | StyleControl && | in_that | ) |
The move assignment operator transfers the underlying impl of the rvalue reference to this StyleControl thereby avoiding a copy.
in_that | An rvalue reference to a StyleControl to take the impl from. |
StyleControl& StyleControl::operator= | ( | StyleControl const & | in_that | ) |
Share the smart-pointer.
bool StyleControl::Pop | ( | ) |
Removes the most recent style.
bool StyleControl::Pop | ( | Style::Type & | out_type, |
SegmentKey & | out_segment_source, | ||
UTF8 & | out_style_name, | ||
Condition & | out_condition | ||
) |
Removes the most recent style and gives information about it to the user.
out_type | Indicates the type of the style. |
out_segment_source | If out_type was Segment, this value contains the source segment for the style. |
out_style_name | If out_type was Named, this value contains the name of the style (defined in a portfolio). |
out_condition | The conditions, if any, set on the style when it was applied. |
StyleKey StyleControl::PushNamed | ( | char const * | in_style_name | ) |
Adds a named style to the top of the style stack. Existing styles are unmodified but styles on top take precedence if there are duplicate settings.
Adds a named style to the top of the style stack. Existing styles are unmodified but styles on top take precedence if there are duplicate settings.
StyleKey StyleControl::PushSegment | ( | SegmentKey const & | in_style_source | ) |
Creates a new style based on in_style_source and places it on the top of the style stack. Existing styles are unmodified but styles on top take precedence if there are duplicate settings.
StyleKey StyleControl::PushSegment | ( | SegmentKey const & | in_style_source, |
Condition const & | in_condition | ||
) |
Creates a new style based on in_style_source and places it on the top of the style stack. Existing styles are unmodified but styles on top take precedence if there are duplicate settings.
void StyleControl::Set | ( | StyleTypeArray const & | in_types, |
SegmentKeyArray const & | in_segment_sources, | ||
UTF8Array const & | in_style_names, | ||
ConditionArray const & | in_conditions | ||
) |
Sets a collection of styles, replacing any existing styles.
in_types | Indicates the type of each style. |
in_segment_sources | For each entry, if in_type was Segment, this value must contain the source segment for the style. |
in_style_names | For each entry, if in_type was Named, this value must contain the name of the style (defined in a portfolio). |
in_conditions | The conditions to set on each style. |
void StyleControl::Set | ( | StyleTypeArray const & | in_types, |
SegmentKeyArray const & | in_segment_sources, | ||
UTF8Array const & | in_style_names | ||
) |
Sets a collection of styles, replacing any existing styles.
in_types | Indicates the type of each style. |
in_segment_sources | For each entry, if in_type was Segment, this value must contain the source segment for the style. |
in_style_names | For each entry, if in_type was Named, this value must contain the name of the style (defined in a portfolio). |
void StyleControl::Set | ( | size_t | in_count, |
Style::Type const | in_types[], | ||
SegmentKey const | in_segment_sources[], | ||
UTF8 const | in_style_names[], | ||
Condition const | in_conditions[] | ||
) |
Sets a collection of styles, replacing any existing styles.
in_count | The length of all arrays |
in_types | Indicates the type of each style. |
in_segment_sources | For each entry, if in_type was Segment, this value must contain the source segment for the style. |
in_style_names | For each entry, if in_type was Named, this value must contain the name of the style (defined in a portfolio). |
in_conditions | The conditions, if any, to set on each style. Passing a null pointer indicates no conditions are requested. |
StyleKey StyleControl::SetNamed | ( | char const * | in_style_name | ) |
Sets in_style_name as the only active style, replacing any existing styles.
in_style_name | The name of the style to apply. If the name does not exist in the active portfolio, no style is applied. |
Sets in_style_name as the only active style, replacing any existing styles.
in_style_name | The name of the style to apply. If the name does not exist in the active portfolio, no style is applied. |
in_condition | A condition or conditions that must be met for a style to be activated. |
StyleKey StyleControl::SetSegment | ( | SegmentKey const & | in_style_source | ) |
Sets in_style_source as the only active style, replacing any existing styles.
in_style_source | A segment containing attributes that should be styled. |
StyleKey StyleControl::SetSegment | ( | SegmentKey const & | in_style_source, |
Condition const & | in_condition | ||
) |
Sets in_style_source as the only active style, replacing any existing styles.
in_style_source | A segment containing attributes that should be styled. |
in_condition | A condition or conditions that must be met for a style to be activated. |
bool StyleControl::Show | ( | StyleTypeArray & | out_types, |
SegmentKeyArray & | out_segment_sources, | ||
UTF8Array & | out_style_names, | ||
ConditionArray & | out_conditions | ||
) | const |
Shows all styles on this segment.
out_types | Indicates the type of each style. |
out_segment_sources | For each entry, if out_type was Style::Type::Segment, this value contains the source segment for the style. |
out_style_names | For each entry, if out_type was Style::Type::Named, this value contains the name of the style (defined in a portfolio). |
out_conditions | The conditions, if any, set on each style when it was applied. |
bool StyleControl::Show | ( | StyleKeyArray & | out_styles | ) | const |
Shows the all styles on this segment.
out_styles | The StyleKey for each style on this segment. |
bool StyleControl::ShowAllNamed | ( | UTF8Array & | out_names, |
ConditionArray & | out_conditions | ||
) | const |
Shows all named styles on this segment.
out_names | Names of all named styles set on this segment. |
out_conditions | The conditions, if any, set on each style when it was applied. |
bool StyleControl::ShowAllNamed | ( | StyleKeyArray & | out_styles | ) | const |
Shows the all named styles on this segment.
out_styles | The StyleKey for each named style on this segment. |
bool StyleControl::ShowAllSegment | ( | SegmentKeyArray & | out_segments, |
ConditionArray & | out_conditions | ||
) | const |
Shows all segment styles on this segment.
out_segments | Keys to all segments styled onto this segment. |
out_conditions | The conditions, if any, set on each style when it was applied. |
bool StyleControl::ShowAllSegment | ( | StyleKeyArray & | out_styles | ) | const |
Shows the all segment styles on this segment.
out_styles | The StyleKey for each segment style on this segment. |
bool StyleControl::ShowTop | ( | Style::Type & | out_type, |
SegmentKey & | out_segment_source, | ||
UTF8 & | out_style_name, | ||
Condition & | out_condition | ||
) | const |
Shows the most recent style applied to this segment.
out_type | Indicates the type of the style. |
out_segment_source | If out_type was Style::Type::Segment, this value contains the source segment for the style. |
out_style_name | If out_type was Style::Type::Named, this value contains the name of the style (defined in a portfolio). |
out_condition | The conditions, if any, set on the style when it was applied. |
bool StyleControl::ShowTop | ( | StyleKey & | out_style | ) | const |
Shows the most recent style applied to this segment.
out_style | The StyleKey for the most recent style applied to this segment. |
void StyleControl::UnsetAllNamed | ( | ) |
Unsets all named styles on this segment.
void StyleControl::UnsetAllSegment | ( | ) |
Unsets all segment styles on this segment.
void StyleControl::UnsetEverything | ( | ) |
Unsets all styles on this segment.
void StyleControl::UnsetTop | ( | ) |
Unsets the most recent style on this segment.