10 #ifndef EMP_WEB_WIDGET_EXTRA_H 11 #define EMP_WEB_WIDGET_EXTRA_H 26 template <
typename SET_TYPE>
28 bool HasStyle(
const std::string & setting)
const {
return style.
Has(setting); }
29 const std::string &
GetStyle(
const std::string & setting) {
return style.
Get(setting); }
32 template <
typename SET_TYPE>
34 bool HasAttr(
const std::string & setting)
const {
return attr.
Has(setting); }
35 const std::string &
GetAttr(
const std::string & setting) {
return attr.
Get(setting); }
39 void Apply(
const std::string & name) {
53 operator bool()
const {
return style || attr ||
listen; }
void Clear()
Remove all setting values.
Definition: Attributes.h:79
void Clear()
Remove all setting values.
Definition: Style.h:77
Attributes & Set(const std::string &s, SET_TYPE v)
Record that attribute "a" is set to value "v" (converted to string) and return this object...
Definition: Attributes.h:48
Define Initialize() and other functions to set up Empirical to build Emscripten projects.
std::string to_string(ALL_TYPES &&...all_values)
Definition: string_utils.h:511
const std::string & Get(const std::string &setting)
Definition: Attributes.h:65
Maintains a map of attribute names to values for use in JavaScript Closely related to Style...
Definition: Attributes.h:29
Style & Set(const std::string &s, SET_TYPE v)
Record that setting "s" is set to value "v" (converted to string) and return this object...
Definition: Style.h:50
Track a set of JavaScript Listeners with their callback IDs.
Definition: Listeners.h:28
const std::string & Get(const std::string &setting)
Definition: Style.h:67
void Apply(const std::string &widget_id)
Apply ALL of the style settings to a specified widget.
Definition: Style.h:85
An Attributes class for tracking non-style features about HTML objects.
bool Has(const std::string &setting) const
Return true/false based on whether "setting" has been given a value in this Attributes obj...
Definition: Attributes.h:59
void Apply(const std::string &widget_id)
Apply all of the listeners being tracked.
Definition: Listeners.h:83
void Apply(const std::string &widget_id)
Apply ALL of the Attribute's settings to dom element "widget_id".
Definition: Attributes.h:82
A class for tracking font event listeners for Widgets.
If we are in emscripten, make sure to include the header.
Definition: array.h:37
void Remove(const std::string &setting)
Definition: Attributes.h:74
void Clear()
Remove all listeners.
Definition: Listeners.h:71
A CSS class for tracking font style, etc.
bool Has(const std::string &setting) const
Return true/false based on whether "setting" has been given a value in this Style.
Definition: Style.h:61
void Remove(const std::string &setting)
Remove a specific setting value.
Definition: Style.h:80