Style value variable. More...

#include <style_set_value.h>

Public Member Functions

bool is_angle () const
 Check if value is an angle. More...
 
bool is_color () const
 Check if value is a color. More...
 
bool is_frequency () const
 Check if value is a frequency. More...
 
bool is_keyword () const
 Check if value is a keyword. More...
 
bool is_keyword (const char *keyword) const
 
bool is_keyword (const std::string &keyword) const
 
bool is_length () const
 Check if value is a length. More...
 
bool is_number () const
 Check if value is a number. More...
 
bool is_percentage () const
 Check if value is a percentage. More...
 
bool is_resolution () const
 Check if value is a resolution. More...
 
bool is_string () const
 Check if value is a string. More...
 
bool is_time () const
 Check if value is a time. More...
 
bool is_undefined () const
 Check if value is undefined. More...
 
bool is_url () const
 Check if value is an url. More...
 

Static Public Member Functions

static StyleSetValue from_angle (float angle, StyleDimension dimension=StyleDimension::rad)
 Create style value from an angle. More...
 
static StyleSetValue from_color (const Colorf &color)
 Create style value from a color. More...
 
static StyleSetValue from_frequency (float freq, StyleDimension dimension=StyleDimension::hz)
 Create style value from a frequency. More...
 
static StyleSetValue from_keyword (const std::string &keyword)
 Create style value from a keyword. More...
 
static StyleSetValue from_length (float length, StyleDimension dimension=StyleDimension::px)
 Create style value from a length. More...
 
static StyleSetValue from_number (float number)
 Create style value from a number. More...
 
static StyleSetValue from_percentage (float percentage)
 Create style value from a percentage. More...
 
static StyleSetValue from_resolution (float resolution, StyleDimension dimension=StyleDimension::dppx)
 Create style value from a resolution. More...
 
static StyleSetValue from_string (const std::string &text)
 Create style value from a string. More...
 
static StyleSetValue from_time (float t, StyleDimension dimension=StyleDimension::s)
 Create style value from a time. More...
 
static StyleSetValue from_url (const std::string &url)
 Create style value from an url. More...
 

Public Attributes

Colorf color
 Value color. More...
 
StyleDimension dimension = StyleDimension::px
 Dimension used by value. More...
 
float number = 0.0f
 Value number. More...
 
std::string text
 Text when the type is a text string. More...
 
StyleValueType type = StyleValueType::undefined
 Variant type. More...
 

Detailed Description

Style value variable.

Member Function Documentation

◆ from_angle()

static StyleSetValue clan::StyleSetValue::from_angle ( float  angle,
StyleDimension  dimension = StyleDimension::rad 
)
inlinestatic

Create style value from an angle.

References clan::angle, dimension, and clan::v.

◆ from_color()

static StyleSetValue clan::StyleSetValue::from_color ( const Colorf color)
inlinestatic

Create style value from a color.

References clan::color, color, and clan::v.

◆ from_frequency()

static StyleSetValue clan::StyleSetValue::from_frequency ( float  freq,
StyleDimension  dimension = StyleDimension::hz 
)
inlinestatic

Create style value from a frequency.

References dimension, clan::frequency, and clan::v.

◆ from_keyword()

static StyleSetValue clan::StyleSetValue::from_keyword ( const std::string &  keyword)
inlinestatic

Create style value from a keyword.

References clan::keyword, and clan::v.

◆ from_length()

static StyleSetValue clan::StyleSetValue::from_length ( float  length,
StyleDimension  dimension = StyleDimension::px 
)
inlinestatic

Create style value from a length.

References dimension, clan::length, and clan::v.

◆ from_number()

static StyleSetValue clan::StyleSetValue::from_number ( float  number)
inlinestatic

Create style value from a number.

References clan::number, number, and clan::v.

◆ from_percentage()

static StyleSetValue clan::StyleSetValue::from_percentage ( float  percentage)
inlinestatic

Create style value from a percentage.

References clan::percentage, and clan::v.

◆ from_resolution()

static StyleSetValue clan::StyleSetValue::from_resolution ( float  resolution,
StyleDimension  dimension = StyleDimension::dppx 
)
inlinestatic

Create style value from a resolution.

References dimension, clan::resolution, and clan::v.

◆ from_string()

static StyleSetValue clan::StyleSetValue::from_string ( const std::string &  text)
inlinestatic

Create style value from a string.

References clan::string, text, and clan::v.

◆ from_time()

static StyleSetValue clan::StyleSetValue::from_time ( float  t,
StyleDimension  dimension = StyleDimension::s 
)
inlinestatic

Create style value from a time.

References dimension, clan::t, clan::time, and clan::v.

◆ from_url()

static StyleSetValue clan::StyleSetValue::from_url ( const std::string &  url)
inlinestatic

Create style value from an url.

References clan::url, and clan::v.

◆ is_angle()

bool clan::StyleSetValue::is_angle ( ) const
inline

Check if value is an angle.

References clan::angle, and type.

◆ is_color()

bool clan::StyleSetValue::is_color ( ) const
inline

Check if value is a color.

References clan::color, and type.

◆ is_frequency()

bool clan::StyleSetValue::is_frequency ( ) const
inline

Check if value is a frequency.

References clan::frequency, and type.

◆ is_keyword() [1/3]

bool clan::StyleSetValue::is_keyword ( ) const
inline

Check if value is a keyword.

References clan::keyword, and type.

◆ is_keyword() [2/3]

bool clan::StyleSetValue::is_keyword ( const char *  keyword) const
inline

References is_keyword(), clan::keyword, and text.

Referenced by is_keyword().

◆ is_keyword() [3/3]

bool clan::StyleSetValue::is_keyword ( const std::string &  keyword) const
inline

References is_keyword(), clan::keyword, and text.

Referenced by is_keyword().

◆ is_length()

bool clan::StyleSetValue::is_length ( ) const
inline

Check if value is a length.

References clan::length, and type.

◆ is_number()

bool clan::StyleSetValue::is_number ( ) const
inline

Check if value is a number.

References clan::number, and type.

◆ is_percentage()

bool clan::StyleSetValue::is_percentage ( ) const
inline

Check if value is a percentage.

References clan::percentage, and type.

◆ is_resolution()

bool clan::StyleSetValue::is_resolution ( ) const
inline

Check if value is a resolution.

References clan::resolution, and type.

◆ is_string()

bool clan::StyleSetValue::is_string ( ) const
inline

Check if value is a string.

References clan::string, and type.

◆ is_time()

bool clan::StyleSetValue::is_time ( ) const
inline

Check if value is a time.

References clan::time, and type.

◆ is_undefined()

bool clan::StyleSetValue::is_undefined ( ) const
inline

Check if value is undefined.

References type, and clan::undefined.

◆ is_url()

bool clan::StyleSetValue::is_url ( ) const
inline

Check if value is an url.

References type, and clan::url.

Member Data Documentation

◆ color

Colorf clan::StyleSetValue::color

Value color.

Referenced by from_color().

◆ dimension

StyleDimension clan::StyleSetValue::dimension = StyleDimension::px

Dimension used by value.

Referenced by from_angle(), from_frequency(), from_length(), from_resolution(), and from_time().

◆ number

float clan::StyleSetValue::number = 0.0f

Value number.

Referenced by from_number().

◆ text

std::string clan::StyleSetValue::text

Text when the type is a text string.

Referenced by from_string(), and is_keyword().

◆ type


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