use crate::value::Value;
use std::fmt::{self, Debug, Display, Formatter};
#[allow(clippy::enum_variant_names)]
#[derive(Clone, Copy, Eq, Hash, PartialEq)]
pub enum AnimationAdditionAttributes {
Accumulate,
Additive,
}
impl AnimationAdditionAttributes {
pub fn as_str(&self) -> &'static str {
match self {
Self::Accumulate => "accumulate",
Self::Additive => "additive",
}
}
}
impl Display for AnimationAdditionAttributes {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Debug for AnimationAdditionAttributes {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
pub trait AnimationAdditionAttributesSetter {
fn set_attr<V>(&mut self, attr: AnimationAdditionAttributes, value: V)
where
V: Value + 'static;
fn get_attr(&self, attr: AnimationAdditionAttributes) -> Option<&dyn Value>;
}
pub trait TagWithAnimationAdditionAttributes: AnimationAdditionAttributesSetter + Sized {
fn with_accumulate<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(AnimationAdditionAttributes::Accumulate, value);
self
}
fn set_accumulate<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(AnimationAdditionAttributes::Accumulate, value);
}
fn accumulate(&self) -> Option<&dyn Value> {
self.get_attr(AnimationAdditionAttributes::Accumulate)
}
fn with_additive<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(AnimationAdditionAttributes::Additive, value);
self
}
fn set_additive<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(AnimationAdditionAttributes::Additive, value);
}
fn additive(&self) -> Option<&dyn Value> {
self.get_attr(AnimationAdditionAttributes::Additive)
}
}
#[allow(clippy::enum_variant_names)]
#[derive(Clone, Copy, Eq, Hash, PartialEq)]
pub enum AnimationAttributeTargetAttributes {
AttributeName,
AttributeType,
}
impl AnimationAttributeTargetAttributes {
pub fn as_str(&self) -> &'static str {
match self {
Self::AttributeName => "attributeName",
Self::AttributeType => "attributeType",
}
}
}
impl Display for AnimationAttributeTargetAttributes {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Debug for AnimationAttributeTargetAttributes {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
pub trait AnimationAttributeTargetAttributesSetter {
fn set_attr<V>(&mut self, attr: AnimationAttributeTargetAttributes, value: V)
where
V: Value + 'static;
fn get_attr(&self, attr: AnimationAttributeTargetAttributes) -> Option<&dyn Value>;
}
pub trait TagWithAnimationAttributeTargetAttributes: AnimationAttributeTargetAttributesSetter + Sized {
fn with_attribute_name<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(AnimationAttributeTargetAttributes::AttributeName, value);
self
}
fn set_attribute_name<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(AnimationAttributeTargetAttributes::AttributeName, value);
}
fn attribute_name(&self) -> Option<&dyn Value> {
self.get_attr(AnimationAttributeTargetAttributes::AttributeName)
}
fn with_attribute_type<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(AnimationAttributeTargetAttributes::AttributeType, value);
self
}
fn set_attribute_type<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(AnimationAttributeTargetAttributes::AttributeType, value);
}
fn attribute_type(&self) -> Option<&dyn Value> {
self.get_attr(AnimationAttributeTargetAttributes::AttributeType)
}
}
#[allow(clippy::enum_variant_names)]
#[derive(Clone, Copy, Eq, Hash, PartialEq)]
pub enum AnimationEventAttributes {
Onbegin,
Onend,
Onrepeat,
}
impl AnimationEventAttributes {
pub fn as_str(&self) -> &'static str {
match self {
Self::Onbegin => "onbegin",
Self::Onend => "onend",
Self::Onrepeat => "onrepeat",
}
}
}
impl Display for AnimationEventAttributes {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Debug for AnimationEventAttributes {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
pub trait AnimationEventAttributesSetter {
fn set_attr<V>(&mut self, attr: AnimationEventAttributes, value: V)
where
V: Value + 'static;
fn get_attr(&self, attr: AnimationEventAttributes) -> Option<&dyn Value>;
}
pub trait TagWithAnimationEventAttributes: AnimationEventAttributesSetter + Sized {
fn with_onbegin<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(AnimationEventAttributes::Onbegin, value);
self
}
fn set_onbegin<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(AnimationEventAttributes::Onbegin, value);
}
fn onbegin(&self) -> Option<&dyn Value> {
self.get_attr(AnimationEventAttributes::Onbegin)
}
fn with_onend<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(AnimationEventAttributes::Onend, value);
self
}
fn set_onend<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(AnimationEventAttributes::Onend, value);
}
fn onend(&self) -> Option<&dyn Value> {
self.get_attr(AnimationEventAttributes::Onend)
}
fn with_onrepeat<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(AnimationEventAttributes::Onrepeat, value);
self
}
fn set_onrepeat<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(AnimationEventAttributes::Onrepeat, value);
}
fn onrepeat(&self) -> Option<&dyn Value> {
self.get_attr(AnimationEventAttributes::Onrepeat)
}
}
#[allow(clippy::enum_variant_names)]
#[derive(Clone, Copy, Eq, Hash, PartialEq)]
pub enum AnimationTimingAttributes {
Begin,
Dur,
End,
Fill,
Max,
Min,
RepeatCount,
RepeatDur,
Restart,
}
impl AnimationTimingAttributes {
pub fn as_str(&self) -> &'static str {
match self {
Self::Begin => "begin",
Self::Dur => "dur",
Self::End => "end",
Self::Fill => "fill",
Self::Max => "max",
Self::Min => "min",
Self::RepeatCount => "repeatCount",
Self::RepeatDur => "repeatDur",
Self::Restart => "restart",
}
}
}
impl Display for AnimationTimingAttributes {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Debug for AnimationTimingAttributes {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
pub trait AnimationTimingAttributesSetter {
fn set_attr<V>(&mut self, attr: AnimationTimingAttributes, value: V)
where
V: Value + 'static;
fn get_attr(&self, attr: AnimationTimingAttributes) -> Option<&dyn Value>;
}
pub trait TagWithAnimationTimingAttributes: AnimationTimingAttributesSetter + Sized {
fn with_begin<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(AnimationTimingAttributes::Begin, value);
self
}
fn set_begin<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(AnimationTimingAttributes::Begin, value);
}
fn begin(&self) -> Option<&dyn Value> {
self.get_attr(AnimationTimingAttributes::Begin)
}
fn with_dur<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(AnimationTimingAttributes::Dur, value);
self
}
fn set_dur<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(AnimationTimingAttributes::Dur, value);
}
fn dur(&self) -> Option<&dyn Value> {
self.get_attr(AnimationTimingAttributes::Dur)
}
fn with_end<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(AnimationTimingAttributes::End, value);
self
}
fn set_end<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(AnimationTimingAttributes::End, value);
}
fn end(&self) -> Option<&dyn Value> {
self.get_attr(AnimationTimingAttributes::End)
}
fn with_fill<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(AnimationTimingAttributes::Fill, value);
self
}
fn set_fill<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(AnimationTimingAttributes::Fill, value);
}
fn fill(&self) -> Option<&dyn Value> {
self.get_attr(AnimationTimingAttributes::Fill)
}
fn with_max<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(AnimationTimingAttributes::Max, value);
self
}
fn set_max<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(AnimationTimingAttributes::Max, value);
}
fn max(&self) -> Option<&dyn Value> {
self.get_attr(AnimationTimingAttributes::Max)
}
fn with_min<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(AnimationTimingAttributes::Min, value);
self
}
fn set_min<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(AnimationTimingAttributes::Min, value);
}
fn min(&self) -> Option<&dyn Value> {
self.get_attr(AnimationTimingAttributes::Min)
}
fn with_repeat_count<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(AnimationTimingAttributes::RepeatCount, value);
self
}
fn set_repeat_count<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(AnimationTimingAttributes::RepeatCount, value);
}
fn repeat_count(&self) -> Option<&dyn Value> {
self.get_attr(AnimationTimingAttributes::RepeatCount)
}
fn with_repeat_dur<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(AnimationTimingAttributes::RepeatDur, value);
self
}
fn set_repeat_dur<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(AnimationTimingAttributes::RepeatDur, value);
}
fn repeat_dur(&self) -> Option<&dyn Value> {
self.get_attr(AnimationTimingAttributes::RepeatDur)
}
fn with_restart<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(AnimationTimingAttributes::Restart, value);
self
}
fn set_restart<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(AnimationTimingAttributes::Restart, value);
}
fn restart(&self) -> Option<&dyn Value> {
self.get_attr(AnimationTimingAttributes::Restart)
}
}
#[allow(clippy::enum_variant_names)]
#[derive(Clone, Copy, Eq, Hash, PartialEq)]
pub enum AnimationValueAttributes {
Accelerate,
AutoReverse,
By,
CalcMode,
Decelerate,
From,
KeySplines,
KeyTimes,
To,
Values,
}
impl AnimationValueAttributes {
pub fn as_str(&self) -> &'static str {
match self {
Self::Accelerate => "accelerate",
Self::AutoReverse => "autoReverse",
Self::By => "by",
Self::CalcMode => "calcMode",
Self::Decelerate => "decelerate",
Self::From => "from",
Self::KeySplines => "keySplines",
Self::KeyTimes => "keyTimes",
Self::To => "to",
Self::Values => "values",
}
}
}
impl Display for AnimationValueAttributes {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Debug for AnimationValueAttributes {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
pub trait AnimationValueAttributesSetter {
fn set_attr<V>(&mut self, attr: AnimationValueAttributes, value: V)
where
V: Value + 'static;
fn get_attr(&self, attr: AnimationValueAttributes) -> Option<&dyn Value>;
}
pub trait TagWithAnimationValueAttributes: AnimationValueAttributesSetter + Sized {
fn with_accelerate<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(AnimationValueAttributes::Accelerate, value);
self
}
fn set_accelerate<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(AnimationValueAttributes::Accelerate, value);
}
fn accelerate(&self) -> Option<&dyn Value> {
self.get_attr(AnimationValueAttributes::Accelerate)
}
fn with_auto_reverse<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(AnimationValueAttributes::AutoReverse, value);
self
}
fn set_auto_reverse<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(AnimationValueAttributes::AutoReverse, value);
}
fn auto_reverse(&self) -> Option<&dyn Value> {
self.get_attr(AnimationValueAttributes::AutoReverse)
}
fn with_by<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(AnimationValueAttributes::By, value);
self
}
fn set_by<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(AnimationValueAttributes::By, value);
}
fn by(&self) -> Option<&dyn Value> {
self.get_attr(AnimationValueAttributes::By)
}
fn with_calc_mode<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(AnimationValueAttributes::CalcMode, value);
self
}
fn set_calc_mode<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(AnimationValueAttributes::CalcMode, value);
}
fn calc_mode(&self) -> Option<&dyn Value> {
self.get_attr(AnimationValueAttributes::CalcMode)
}
fn with_decelerate<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(AnimationValueAttributes::Decelerate, value);
self
}
fn set_decelerate<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(AnimationValueAttributes::Decelerate, value);
}
fn decelerate(&self) -> Option<&dyn Value> {
self.get_attr(AnimationValueAttributes::Decelerate)
}
fn with_from<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(AnimationValueAttributes::From, value);
self
}
fn set_from<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(AnimationValueAttributes::From, value);
}
fn from(&self) -> Option<&dyn Value> {
self.get_attr(AnimationValueAttributes::From)
}
fn with_key_splines<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(AnimationValueAttributes::KeySplines, value);
self
}
fn set_key_splines<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(AnimationValueAttributes::KeySplines, value);
}
fn key_splines(&self) -> Option<&dyn Value> {
self.get_attr(AnimationValueAttributes::KeySplines)
}
fn with_key_times<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(AnimationValueAttributes::KeyTimes, value);
self
}
fn set_key_times<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(AnimationValueAttributes::KeyTimes, value);
}
fn key_times(&self) -> Option<&dyn Value> {
self.get_attr(AnimationValueAttributes::KeyTimes)
}
fn with_to<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(AnimationValueAttributes::To, value);
self
}
fn set_to<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(AnimationValueAttributes::To, value);
}
fn to(&self) -> Option<&dyn Value> {
self.get_attr(AnimationValueAttributes::To)
}
fn with_values<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(AnimationValueAttributes::Values, value);
self
}
fn set_values<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(AnimationValueAttributes::Values, value);
}
fn values(&self) -> Option<&dyn Value> {
self.get_attr(AnimationValueAttributes::Values)
}
}
#[allow(clippy::enum_variant_names)]
#[derive(Clone, Copy, Eq, Hash, PartialEq)]
pub enum ConditionalProcessingAttributes {
RequiredExtensions,
RequiredFeatures,
SystemLanguage,
}
impl ConditionalProcessingAttributes {
pub fn as_str(&self) -> &'static str {
match self {
Self::RequiredExtensions => "requiredExtensions",
Self::RequiredFeatures => "requiredFeatures",
Self::SystemLanguage => "systemLanguage",
}
}
}
impl Display for ConditionalProcessingAttributes {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Debug for ConditionalProcessingAttributes {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
pub trait ConditionalProcessingAttributesSetter {
fn set_attr<V>(&mut self, attr: ConditionalProcessingAttributes, value: V)
where
V: Value + 'static;
fn get_attr(&self, attr: ConditionalProcessingAttributes) -> Option<&dyn Value>;
}
pub trait TagWithConditionalProcessingAttributes: ConditionalProcessingAttributesSetter + Sized {
fn with_required_extensions<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(ConditionalProcessingAttributes::RequiredExtensions, value);
self
}
fn set_required_extensions<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(ConditionalProcessingAttributes::RequiredExtensions, value);
}
fn required_extensions(&self) -> Option<&dyn Value> {
self.get_attr(ConditionalProcessingAttributes::RequiredExtensions)
}
fn with_required_features<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(ConditionalProcessingAttributes::RequiredFeatures, value);
self
}
fn set_required_features<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(ConditionalProcessingAttributes::RequiredFeatures, value);
}
fn required_features(&self) -> Option<&dyn Value> {
self.get_attr(ConditionalProcessingAttributes::RequiredFeatures)
}
fn with_system_language<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(ConditionalProcessingAttributes::SystemLanguage, value);
self
}
fn set_system_language<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(ConditionalProcessingAttributes::SystemLanguage, value);
}
fn system_language(&self) -> Option<&dyn Value> {
self.get_attr(ConditionalProcessingAttributes::SystemLanguage)
}
}
#[allow(clippy::enum_variant_names)]
#[derive(Clone, Copy, Eq, Hash, PartialEq)]
pub enum CoreAttributes {
Id,
Lang,
Tabindex,
XmlBase,
XmlLang,
XmlSpace,
}
impl CoreAttributes {
pub fn as_str(&self) -> &'static str {
match self {
Self::Id => "id",
Self::Lang => "lang",
Self::Tabindex => "tabindex",
Self::XmlBase => "xml:base",
Self::XmlLang => "xml:lang",
Self::XmlSpace => "xml:space",
}
}
}
impl Display for CoreAttributes {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Debug for CoreAttributes {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
pub trait CoreAttributesSetter {
fn set_attr<V>(&mut self, attr: CoreAttributes, value: V)
where
V: Value + 'static;
fn get_attr(&self, attr: CoreAttributes) -> Option<&dyn Value>;
}
pub trait TagWithCoreAttributes: CoreAttributesSetter + Sized {
fn with_id<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(CoreAttributes::Id, value);
self
}
fn set_id<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(CoreAttributes::Id, value);
}
fn id(&self) -> Option<&dyn Value> {
self.get_attr(CoreAttributes::Id)
}
fn with_lang<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(CoreAttributes::Lang, value);
self
}
fn set_lang<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(CoreAttributes::Lang, value);
}
fn lang(&self) -> Option<&dyn Value> {
self.get_attr(CoreAttributes::Lang)
}
fn with_tabindex<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(CoreAttributes::Tabindex, value);
self
}
fn set_tabindex<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(CoreAttributes::Tabindex, value);
}
fn tabindex(&self) -> Option<&dyn Value> {
self.get_attr(CoreAttributes::Tabindex)
}
fn with_xml_base<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(CoreAttributes::XmlBase, value);
self
}
fn set_xml_base<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(CoreAttributes::XmlBase, value);
}
fn xml_base(&self) -> Option<&dyn Value> {
self.get_attr(CoreAttributes::XmlBase)
}
fn with_xml_lang<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(CoreAttributes::XmlLang, value);
self
}
fn set_xml_lang<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(CoreAttributes::XmlLang, value);
}
fn xml_lang(&self) -> Option<&dyn Value> {
self.get_attr(CoreAttributes::XmlLang)
}
fn with_xml_space<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(CoreAttributes::XmlSpace, value);
self
}
fn set_xml_space<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(CoreAttributes::XmlSpace, value);
}
fn xml_space(&self) -> Option<&dyn Value> {
self.get_attr(CoreAttributes::XmlSpace)
}
}
#[allow(clippy::enum_variant_names)]
#[derive(Clone, Copy, Eq, Hash, PartialEq)]
pub enum DocumentEventAttributes {
Onabort,
Onerror,
Onresize,
Onscroll,
Onunload,
}
impl DocumentEventAttributes {
pub fn as_str(&self) -> &'static str {
match self {
Self::Onabort => "onabort",
Self::Onerror => "onerror",
Self::Onresize => "onresize",
Self::Onscroll => "onscroll",
Self::Onunload => "onunload",
}
}
}
impl Display for DocumentEventAttributes {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Debug for DocumentEventAttributes {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
pub trait DocumentEventAttributesSetter {
fn set_attr<V>(&mut self, attr: DocumentEventAttributes, value: V)
where
V: Value + 'static;
fn get_attr(&self, attr: DocumentEventAttributes) -> Option<&dyn Value>;
}
pub trait TagWithDocumentEventAttributes: DocumentEventAttributesSetter + Sized {
fn with_onabort<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(DocumentEventAttributes::Onabort, value);
self
}
fn set_onabort<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(DocumentEventAttributes::Onabort, value);
}
fn onabort(&self) -> Option<&dyn Value> {
self.get_attr(DocumentEventAttributes::Onabort)
}
fn with_onerror<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(DocumentEventAttributes::Onerror, value);
self
}
fn set_onerror<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(DocumentEventAttributes::Onerror, value);
}
fn onerror(&self) -> Option<&dyn Value> {
self.get_attr(DocumentEventAttributes::Onerror)
}
fn with_onresize<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(DocumentEventAttributes::Onresize, value);
self
}
fn set_onresize<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(DocumentEventAttributes::Onresize, value);
}
fn onresize(&self) -> Option<&dyn Value> {
self.get_attr(DocumentEventAttributes::Onresize)
}
fn with_onscroll<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(DocumentEventAttributes::Onscroll, value);
self
}
fn set_onscroll<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(DocumentEventAttributes::Onscroll, value);
}
fn onscroll(&self) -> Option<&dyn Value> {
self.get_attr(DocumentEventAttributes::Onscroll)
}
fn with_onunload<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(DocumentEventAttributes::Onunload, value);
self
}
fn set_onunload<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(DocumentEventAttributes::Onunload, value);
}
fn onunload(&self) -> Option<&dyn Value> {
self.get_attr(DocumentEventAttributes::Onunload)
}
}
#[allow(clippy::enum_variant_names)]
#[derive(Clone, Copy, Eq, Hash, PartialEq)]
pub enum FilterAttributes {
Height,
Result,
Width,
X,
Y,
}
impl FilterAttributes {
pub fn as_str(&self) -> &'static str {
match self {
Self::Height => "height",
Self::Result => "result",
Self::Width => "width",
Self::X => "x",
Self::Y => "y",
}
}
}
impl Display for FilterAttributes {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Debug for FilterAttributes {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
pub trait FilterAttributesSetter {
fn set_attr<V>(&mut self, attr: FilterAttributes, value: V)
where
V: Value + 'static;
fn get_attr(&self, attr: FilterAttributes) -> Option<&dyn Value>;
}
pub trait TagWithFilterAttributes: FilterAttributesSetter + Sized {
fn with_height<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(FilterAttributes::Height, value);
self
}
fn set_height<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(FilterAttributes::Height, value);
}
fn height(&self) -> Option<&dyn Value> {
self.get_attr(FilterAttributes::Height)
}
fn with_result<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(FilterAttributes::Result, value);
self
}
fn set_result<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(FilterAttributes::Result, value);
}
fn result(&self) -> Option<&dyn Value> {
self.get_attr(FilterAttributes::Result)
}
fn with_width<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(FilterAttributes::Width, value);
self
}
fn set_width<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(FilterAttributes::Width, value);
}
fn width(&self) -> Option<&dyn Value> {
self.get_attr(FilterAttributes::Width)
}
fn with_x<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(FilterAttributes::X, value);
self
}
fn set_x<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(FilterAttributes::X, value);
}
fn x(&self) -> Option<&dyn Value> {
self.get_attr(FilterAttributes::X)
}
fn with_y<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(FilterAttributes::Y, value);
self
}
fn set_y<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(FilterAttributes::Y, value);
}
fn y(&self) -> Option<&dyn Value> {
self.get_attr(FilterAttributes::Y)
}
}
#[allow(clippy::enum_variant_names)]
#[derive(Clone, Copy, Eq, Hash, PartialEq)]
pub enum GlobalEventAttributes {
Oncancel,
Oncanplay,
Oncanplaythrough,
Onchange,
Onclick,
Onclose,
Oncuechange,
Ondblclick,
Ondrag,
Ondragend,
Ondragenter,
Ondragleave,
Ondragover,
Ondragstart,
Ondrop,
Ondurationchange,
Onemptied,
Onended,
Onerror,
Onfocus,
Oninput,
Oninvalid,
Onkeydown,
Onkeypress,
Onkeyup,
Onload,
Onloadeddata,
Onloadedmetadata,
Onloadstart,
Onmousedown,
Onmouseenter,
Onmouseleave,
Onmousemove,
Onmouseout,
Onmouseover,
Onmouseup,
Onmousewheel,
Onpause,
Onplay,
Onplaying,
Onprogress,
Onratechange,
Onreset,
Onresize,
Onscroll,
Onseeked,
Onseeking,
Onselect,
Onshow,
Onstalled,
Onsubmit,
Onsuspend,
Ontimeupdate,
Ontoggle,
Onvolumechange,
Onwaiting,
}
impl GlobalEventAttributes {
pub fn as_str(&self) -> &'static str {
match self {
Self::Oncancel => "oncancel",
Self::Oncanplay => "oncanplay",
Self::Oncanplaythrough => "oncanplaythrough",
Self::Onchange => "onchange",
Self::Onclick => "onclick",
Self::Onclose => "onclose",
Self::Oncuechange => "oncuechange",
Self::Ondblclick => "ondblclick",
Self::Ondrag => "ondrag",
Self::Ondragend => "ondragend",
Self::Ondragenter => "ondragenter",
Self::Ondragleave => "ondragleave",
Self::Ondragover => "ondragover",
Self::Ondragstart => "ondragstart",
Self::Ondrop => "ondrop",
Self::Ondurationchange => "ondurationchange",
Self::Onemptied => "onemptied",
Self::Onended => "onended",
Self::Onerror => "onerror",
Self::Onfocus => "onfocus",
Self::Oninput => "oninput",
Self::Oninvalid => "oninvalid",
Self::Onkeydown => "onkeydown",
Self::Onkeypress => "onkeypress",
Self::Onkeyup => "onkeyup",
Self::Onload => "onload",
Self::Onloadeddata => "onloadeddata",
Self::Onloadedmetadata => "onloadedmetadata",
Self::Onloadstart => "onloadstart",
Self::Onmousedown => "onmousedown",
Self::Onmouseenter => "onmouseenter",
Self::Onmouseleave => "onmouseleave",
Self::Onmousemove => "onmousemove",
Self::Onmouseout => "onmouseout",
Self::Onmouseover => "onmouseover",
Self::Onmouseup => "onmouseup",
Self::Onmousewheel => "onmousewheel",
Self::Onpause => "onpause",
Self::Onplay => "onplay",
Self::Onplaying => "onplaying",
Self::Onprogress => "onprogress",
Self::Onratechange => "onratechange",
Self::Onreset => "onreset",
Self::Onresize => "onresize",
Self::Onscroll => "onscroll",
Self::Onseeked => "onseeked",
Self::Onseeking => "onseeking",
Self::Onselect => "onselect",
Self::Onshow => "onshow",
Self::Onstalled => "onstalled",
Self::Onsubmit => "onsubmit",
Self::Onsuspend => "onsuspend",
Self::Ontimeupdate => "ontimeupdate",
Self::Ontoggle => "ontoggle",
Self::Onvolumechange => "onvolumechange",
Self::Onwaiting => "onwaiting",
}
}
}
impl Display for GlobalEventAttributes {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Debug for GlobalEventAttributes {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
pub trait GlobalEventAttributesSetter {
fn set_attr<V>(&mut self, attr: GlobalEventAttributes, value: V)
where
V: Value + 'static;
fn get_attr(&self, attr: GlobalEventAttributes) -> Option<&dyn Value>;
}
pub trait TagWithGlobalEventAttributes: GlobalEventAttributesSetter + Sized {
fn with_oncancel<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Oncancel, value);
self
}
fn set_oncancel<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Oncancel, value);
}
fn oncancel(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Oncancel)
}
fn with_oncanplay<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Oncanplay, value);
self
}
fn set_oncanplay<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Oncanplay, value);
}
fn oncanplay(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Oncanplay)
}
fn with_oncanplaythrough<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Oncanplaythrough, value);
self
}
fn set_oncanplaythrough<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Oncanplaythrough, value);
}
fn oncanplaythrough(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Oncanplaythrough)
}
fn with_onchange<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onchange, value);
self
}
fn set_onchange<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onchange, value);
}
fn onchange(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Onchange)
}
fn with_onclick<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onclick, value);
self
}
fn set_onclick<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onclick, value);
}
fn onclick(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Onclick)
}
fn with_onclose<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onclose, value);
self
}
fn set_onclose<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onclose, value);
}
fn onclose(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Onclose)
}
fn with_oncuechange<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Oncuechange, value);
self
}
fn set_oncuechange<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Oncuechange, value);
}
fn oncuechange(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Oncuechange)
}
fn with_ondblclick<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Ondblclick, value);
self
}
fn set_ondblclick<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Ondblclick, value);
}
fn ondblclick(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Ondblclick)
}
fn with_ondrag<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Ondrag, value);
self
}
fn set_ondrag<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Ondrag, value);
}
fn ondrag(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Ondrag)
}
fn with_ondragend<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Ondragend, value);
self
}
fn set_ondragend<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Ondragend, value);
}
fn ondragend(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Ondragend)
}
fn with_ondragenter<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Ondragenter, value);
self
}
fn set_ondragenter<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Ondragenter, value);
}
fn ondragenter(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Ondragenter)
}
fn with_ondragleave<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Ondragleave, value);
self
}
fn set_ondragleave<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Ondragleave, value);
}
fn ondragleave(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Ondragleave)
}
fn with_ondragover<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Ondragover, value);
self
}
fn set_ondragover<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Ondragover, value);
}
fn ondragover(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Ondragover)
}
fn with_ondragstart<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Ondragstart, value);
self
}
fn set_ondragstart<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Ondragstart, value);
}
fn ondragstart(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Ondragstart)
}
fn with_ondrop<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Ondrop, value);
self
}
fn set_ondrop<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Ondrop, value);
}
fn ondrop(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Ondrop)
}
fn with_ondurationchange<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Ondurationchange, value);
self
}
fn set_ondurationchange<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Ondurationchange, value);
}
fn ondurationchange(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Ondurationchange)
}
fn with_onemptied<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onemptied, value);
self
}
fn set_onemptied<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onemptied, value);
}
fn onemptied(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Onemptied)
}
fn with_onended<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onended, value);
self
}
fn set_onended<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onended, value);
}
fn onended(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Onended)
}
fn with_onerror<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onerror, value);
self
}
fn set_onerror<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onerror, value);
}
fn onerror(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Onerror)
}
fn with_onfocus<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onfocus, value);
self
}
fn set_onfocus<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onfocus, value);
}
fn onfocus(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Onfocus)
}
fn with_oninput<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Oninput, value);
self
}
fn set_oninput<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Oninput, value);
}
fn oninput(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Oninput)
}
fn with_oninvalid<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Oninvalid, value);
self
}
fn set_oninvalid<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Oninvalid, value);
}
fn oninvalid(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Oninvalid)
}
fn with_onkeydown<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onkeydown, value);
self
}
fn set_onkeydown<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onkeydown, value);
}
fn onkeydown(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Onkeydown)
}
fn with_onkeypress<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onkeypress, value);
self
}
fn set_onkeypress<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onkeypress, value);
}
fn onkeypress(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Onkeypress)
}
fn with_onkeyup<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onkeyup, value);
self
}
fn set_onkeyup<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onkeyup, value);
}
fn onkeyup(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Onkeyup)
}
fn with_onload<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onload, value);
self
}
fn set_onload<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onload, value);
}
fn onload(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Onload)
}
fn with_onloadeddata<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onloadeddata, value);
self
}
fn set_onloadeddata<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onloadeddata, value);
}
fn onloadeddata(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Onloadeddata)
}
fn with_onloadedmetadata<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onloadedmetadata, value);
self
}
fn set_onloadedmetadata<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onloadedmetadata, value);
}
fn onloadedmetadata(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Onloadedmetadata)
}
fn with_onloadstart<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onloadstart, value);
self
}
fn set_onloadstart<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onloadstart, value);
}
fn onloadstart(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Onloadstart)
}
fn with_onmousedown<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onmousedown, value);
self
}
fn set_onmousedown<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onmousedown, value);
}
fn onmousedown(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Onmousedown)
}
fn with_onmouseenter<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onmouseenter, value);
self
}
fn set_onmouseenter<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onmouseenter, value);
}
fn onmouseenter(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Onmouseenter)
}
fn with_onmouseleave<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onmouseleave, value);
self
}
fn set_onmouseleave<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onmouseleave, value);
}
fn onmouseleave(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Onmouseleave)
}
fn with_onmousemove<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onmousemove, value);
self
}
fn set_onmousemove<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onmousemove, value);
}
fn onmousemove(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Onmousemove)
}
fn with_onmouseout<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onmouseout, value);
self
}
fn set_onmouseout<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onmouseout, value);
}
fn onmouseout(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Onmouseout)
}
fn with_onmouseover<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onmouseover, value);
self
}
fn set_onmouseover<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onmouseover, value);
}
fn onmouseover(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Onmouseover)
}
fn with_onmouseup<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onmouseup, value);
self
}
fn set_onmouseup<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onmouseup, value);
}
fn onmouseup(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Onmouseup)
}
fn with_onmousewheel<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onmousewheel, value);
self
}
fn set_onmousewheel<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onmousewheel, value);
}
fn onmousewheel(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Onmousewheel)
}
fn with_onpause<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onpause, value);
self
}
fn set_onpause<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onpause, value);
}
fn onpause(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Onpause)
}
fn with_onplay<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onplay, value);
self
}
fn set_onplay<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onplay, value);
}
fn onplay(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Onplay)
}
fn with_onplaying<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onplaying, value);
self
}
fn set_onplaying<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onplaying, value);
}
fn onplaying(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Onplaying)
}
fn with_onprogress<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onprogress, value);
self
}
fn set_onprogress<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onprogress, value);
}
fn onprogress(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Onprogress)
}
fn with_onratechange<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onratechange, value);
self
}
fn set_onratechange<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onratechange, value);
}
fn onratechange(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Onratechange)
}
fn with_onreset<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onreset, value);
self
}
fn set_onreset<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onreset, value);
}
fn onreset(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Onreset)
}
fn with_onresize<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onresize, value);
self
}
fn set_onresize<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onresize, value);
}
fn onresize(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Onresize)
}
fn with_onscroll<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onscroll, value);
self
}
fn set_onscroll<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onscroll, value);
}
fn onscroll(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Onscroll)
}
fn with_onseeked<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onseeked, value);
self
}
fn set_onseeked<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onseeked, value);
}
fn onseeked(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Onseeked)
}
fn with_onseeking<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onseeking, value);
self
}
fn set_onseeking<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onseeking, value);
}
fn onseeking(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Onseeking)
}
fn with_onselect<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onselect, value);
self
}
fn set_onselect<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onselect, value);
}
fn onselect(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Onselect)
}
fn with_onshow<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onshow, value);
self
}
fn set_onshow<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onshow, value);
}
fn onshow(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Onshow)
}
fn with_onstalled<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onstalled, value);
self
}
fn set_onstalled<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onstalled, value);
}
fn onstalled(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Onstalled)
}
fn with_onsubmit<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onsubmit, value);
self
}
fn set_onsubmit<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onsubmit, value);
}
fn onsubmit(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Onsubmit)
}
fn with_onsuspend<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onsuspend, value);
self
}
fn set_onsuspend<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onsuspend, value);
}
fn onsuspend(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Onsuspend)
}
fn with_ontimeupdate<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Ontimeupdate, value);
self
}
fn set_ontimeupdate<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Ontimeupdate, value);
}
fn ontimeupdate(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Ontimeupdate)
}
fn with_ontoggle<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Ontoggle, value);
self
}
fn set_ontoggle<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Ontoggle, value);
}
fn ontoggle(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Ontoggle)
}
fn with_onvolumechange<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onvolumechange, value);
self
}
fn set_onvolumechange<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onvolumechange, value);
}
fn onvolumechange(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Onvolumechange)
}
fn with_onwaiting<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onwaiting, value);
self
}
fn set_onwaiting<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GlobalEventAttributes::Onwaiting, value);
}
fn onwaiting(&self) -> Option<&dyn Value> {
self.get_attr(GlobalEventAttributes::Onwaiting)
}
}
#[allow(clippy::enum_variant_names)]
#[derive(Clone, Copy, Eq, Hash, PartialEq)]
pub enum GraphicalEventAttributes {
Onactivate,
Onfocusin,
Onfocusout,
}
impl GraphicalEventAttributes {
pub fn as_str(&self) -> &'static str {
match self {
Self::Onactivate => "onactivate",
Self::Onfocusin => "onfocusin",
Self::Onfocusout => "onfocusout",
}
}
}
impl Display for GraphicalEventAttributes {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Debug for GraphicalEventAttributes {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
pub trait GraphicalEventAttributesSetter {
fn set_attr<V>(&mut self, attr: GraphicalEventAttributes, value: V)
where
V: Value + 'static;
fn get_attr(&self, attr: GraphicalEventAttributes) -> Option<&dyn Value>;
}
pub trait TagWithGraphicalEventAttributes: GraphicalEventAttributesSetter + Sized {
fn with_onactivate<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GraphicalEventAttributes::Onactivate, value);
self
}
fn set_onactivate<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GraphicalEventAttributes::Onactivate, value);
}
fn onactivate(&self) -> Option<&dyn Value> {
self.get_attr(GraphicalEventAttributes::Onactivate)
}
fn with_onfocusin<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GraphicalEventAttributes::Onfocusin, value);
self
}
fn set_onfocusin<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GraphicalEventAttributes::Onfocusin, value);
}
fn onfocusin(&self) -> Option<&dyn Value> {
self.get_attr(GraphicalEventAttributes::Onfocusin)
}
fn with_onfocusout<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(GraphicalEventAttributes::Onfocusout, value);
self
}
fn set_onfocusout<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(GraphicalEventAttributes::Onfocusout, value);
}
fn onfocusout(&self) -> Option<&dyn Value> {
self.get_attr(GraphicalEventAttributes::Onfocusout)
}
}
#[allow(clippy::enum_variant_names)]
#[derive(Clone, Copy, Eq, Hash, PartialEq)]
pub enum PresentationAttributes {
AlignmentBaseline,
BaselineShift,
Clip,
ClipPath,
ClipRule,
Color,
ColorInterpolation,
ColorInterpolationFilters,
ColorProfile,
ColorRendering,
Cursor,
Direction,
Display,
DominantBaseline,
EnableBackground,
Fill,
FillOpacity,
FillRule,
Filter,
FloodColor,
FloodOpacity,
FontFamily,
FontSize,
FontSizeAdjust,
FontStretch,
FontStyle,
FontVariant,
FontWeight,
GlyphOrientationHorizontal,
GlyphOrientationVertical,
ImageRendering,
Kerning,
LetterSpacing,
LightingColor,
MarkerEnd,
MarkerMid,
MarkerStart,
Mask,
Opacity,
Overflow,
PointerEvents,
ShapeRendering,
StopColor,
StopOpacity,
Stroke,
StrokeDasharray,
StrokeDashoffset,
StrokeLinecap,
StrokeLinejoin,
StrokeMiterlimit,
StrokeOpacity,
StrokeWidth,
TextAnchor,
TextDecoration,
TextRendering,
Transform,
TransformOrigin,
UnicodeBidi,
VectorEffect,
Visibility,
WordSpacing,
WritingMode,
}
impl PresentationAttributes {
pub fn as_str(&self) -> &'static str {
match self {
Self::AlignmentBaseline => "alignment-baseline",
Self::BaselineShift => "baseline-shift",
Self::Clip => "clip",
Self::ClipPath => "clip-path",
Self::ClipRule => "clip-rule",
Self::Color => "color",
Self::ColorInterpolation => "color-interpolation",
Self::ColorInterpolationFilters => "color-interpolation-filters",
Self::ColorProfile => "color-profile",
Self::ColorRendering => "color-rendering",
Self::Cursor => "cursor",
Self::Direction => "direction",
Self::Display => "display",
Self::DominantBaseline => "dominant-baseline",
Self::EnableBackground => "enable-background",
Self::Fill => "fill",
Self::FillOpacity => "fill-opacity",
Self::FillRule => "fill-rule",
Self::Filter => "filter",
Self::FloodColor => "flood-color",
Self::FloodOpacity => "flood-opacity",
Self::FontFamily => "font-family",
Self::FontSize => "font-size",
Self::FontSizeAdjust => "font-size-adjust",
Self::FontStretch => "font-stretch",
Self::FontStyle => "font-style",
Self::FontVariant => "font-variant",
Self::FontWeight => "font-weight",
Self::GlyphOrientationHorizontal => "glyph-orientation-horizontal",
Self::GlyphOrientationVertical => "glyph-orientation-vertical",
Self::ImageRendering => "image-rendering",
Self::Kerning => "kerning",
Self::LetterSpacing => "letter-spacing",
Self::LightingColor => "lighting-color",
Self::MarkerEnd => "marker-end",
Self::MarkerMid => "marker-mid",
Self::MarkerStart => "marker-start",
Self::Mask => "mask",
Self::Opacity => "opacity",
Self::Overflow => "overflow",
Self::PointerEvents => "pointer-events",
Self::ShapeRendering => "shape-rendering",
Self::StopColor => "stop-color",
Self::StopOpacity => "stop-opacity",
Self::Stroke => "stroke",
Self::StrokeDasharray => "stroke-dasharray",
Self::StrokeDashoffset => "stroke-dashoffset",
Self::StrokeLinecap => "stroke-linecap",
Self::StrokeLinejoin => "stroke-linejoin",
Self::StrokeMiterlimit => "stroke-miterlimit",
Self::StrokeOpacity => "stroke-opacity",
Self::StrokeWidth => "stroke-width",
Self::TextAnchor => "text-anchor",
Self::TextDecoration => "text-decoration",
Self::TextRendering => "text-rendering",
Self::Transform => "transform",
Self::TransformOrigin => "transform-origin",
Self::UnicodeBidi => "unicode-bidi",
Self::VectorEffect => "vector-effect",
Self::Visibility => "visibility",
Self::WordSpacing => "word-spacing",
Self::WritingMode => "writing-mode",
}
}
}
impl Display for PresentationAttributes {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Debug for PresentationAttributes {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
pub trait PresentationAttributesSetter {
fn set_attr<V>(&mut self, attr: PresentationAttributes, value: V)
where
V: Value + 'static;
fn get_attr(&self, attr: PresentationAttributes) -> Option<&dyn Value>;
}
pub trait TagWithPresentationAttributes: PresentationAttributesSetter + Sized {
fn with_alignment_baseline<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::AlignmentBaseline, value);
self
}
fn set_alignment_baseline<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::AlignmentBaseline, value);
}
fn alignment_baseline(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::AlignmentBaseline)
}
fn with_baseline_shift<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::BaselineShift, value);
self
}
fn set_baseline_shift<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::BaselineShift, value);
}
fn baseline_shift(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::BaselineShift)
}
fn with_clip<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::Clip, value);
self
}
fn set_clip<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::Clip, value);
}
fn clip(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::Clip)
}
fn with_clip_path<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::ClipPath, value);
self
}
fn set_clip_path<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::ClipPath, value);
}
fn clip_path(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::ClipPath)
}
fn with_clip_rule<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::ClipRule, value);
self
}
fn set_clip_rule<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::ClipRule, value);
}
fn clip_rule(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::ClipRule)
}
fn with_color<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::Color, value);
self
}
fn set_color<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::Color, value);
}
fn color(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::Color)
}
fn with_color_interpolation<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::ColorInterpolation, value);
self
}
fn set_color_interpolation<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::ColorInterpolation, value);
}
fn color_interpolation(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::ColorInterpolation)
}
fn with_color_interpolation_filters<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::ColorInterpolationFilters, value);
self
}
fn set_color_interpolation_filters<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::ColorInterpolationFilters, value);
}
fn color_interpolation_filters(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::ColorInterpolationFilters)
}
fn with_color_profile<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::ColorProfile, value);
self
}
fn set_color_profile<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::ColorProfile, value);
}
fn color_profile(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::ColorProfile)
}
fn with_color_rendering<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::ColorRendering, value);
self
}
fn set_color_rendering<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::ColorRendering, value);
}
fn color_rendering(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::ColorRendering)
}
fn with_cursor<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::Cursor, value);
self
}
fn set_cursor<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::Cursor, value);
}
fn cursor(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::Cursor)
}
fn with_direction<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::Direction, value);
self
}
fn set_direction<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::Direction, value);
}
fn direction(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::Direction)
}
fn with_display<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::Display, value);
self
}
fn set_display<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::Display, value);
}
fn display(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::Display)
}
fn with_dominant_baseline<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::DominantBaseline, value);
self
}
fn set_dominant_baseline<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::DominantBaseline, value);
}
fn dominant_baseline(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::DominantBaseline)
}
fn with_enable_background<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::EnableBackground, value);
self
}
fn set_enable_background<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::EnableBackground, value);
}
fn enable_background(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::EnableBackground)
}
fn with_fill<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::Fill, value);
self
}
fn set_fill<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::Fill, value);
}
fn fill(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::Fill)
}
fn with_fill_opacity<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::FillOpacity, value);
self
}
fn set_fill_opacity<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::FillOpacity, value);
}
fn fill_opacity(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::FillOpacity)
}
fn with_fill_rule<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::FillRule, value);
self
}
fn set_fill_rule<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::FillRule, value);
}
fn fill_rule(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::FillRule)
}
fn with_filter<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::Filter, value);
self
}
fn set_filter<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::Filter, value);
}
fn filter(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::Filter)
}
fn with_flood_color<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::FloodColor, value);
self
}
fn set_flood_color<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::FloodColor, value);
}
fn flood_color(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::FloodColor)
}
fn with_flood_opacity<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::FloodOpacity, value);
self
}
fn set_flood_opacity<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::FloodOpacity, value);
}
fn flood_opacity(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::FloodOpacity)
}
fn with_font_family<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::FontFamily, value);
self
}
fn set_font_family<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::FontFamily, value);
}
fn font_family(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::FontFamily)
}
fn with_font_size<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::FontSize, value);
self
}
fn set_font_size<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::FontSize, value);
}
fn font_size(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::FontSize)
}
fn with_font_size_adjust<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::FontSizeAdjust, value);
self
}
fn set_font_size_adjust<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::FontSizeAdjust, value);
}
fn font_size_adjust(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::FontSizeAdjust)
}
fn with_font_stretch<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::FontStretch, value);
self
}
fn set_font_stretch<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::FontStretch, value);
}
fn font_stretch(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::FontStretch)
}
fn with_font_style<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::FontStyle, value);
self
}
fn set_font_style<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::FontStyle, value);
}
fn font_style(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::FontStyle)
}
fn with_font_variant<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::FontVariant, value);
self
}
fn set_font_variant<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::FontVariant, value);
}
fn font_variant(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::FontVariant)
}
fn with_font_weight<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::FontWeight, value);
self
}
fn set_font_weight<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::FontWeight, value);
}
fn font_weight(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::FontWeight)
}
fn with_glyph_orientation_horizontal<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::GlyphOrientationHorizontal, value);
self
}
fn set_glyph_orientation_horizontal<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::GlyphOrientationHorizontal, value);
}
fn glyph_orientation_horizontal(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::GlyphOrientationHorizontal)
}
fn with_glyph_orientation_vertical<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::GlyphOrientationVertical, value);
self
}
fn set_glyph_orientation_vertical<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::GlyphOrientationVertical, value);
}
fn glyph_orientation_vertical(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::GlyphOrientationVertical)
}
fn with_image_rendering<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::ImageRendering, value);
self
}
fn set_image_rendering<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::ImageRendering, value);
}
fn image_rendering(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::ImageRendering)
}
fn with_kerning<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::Kerning, value);
self
}
fn set_kerning<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::Kerning, value);
}
fn kerning(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::Kerning)
}
fn with_letter_spacing<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::LetterSpacing, value);
self
}
fn set_letter_spacing<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::LetterSpacing, value);
}
fn letter_spacing(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::LetterSpacing)
}
fn with_lighting_color<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::LightingColor, value);
self
}
fn set_lighting_color<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::LightingColor, value);
}
fn lighting_color(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::LightingColor)
}
fn with_marker_end<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::MarkerEnd, value);
self
}
fn set_marker_end<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::MarkerEnd, value);
}
fn marker_end(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::MarkerEnd)
}
fn with_marker_mid<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::MarkerMid, value);
self
}
fn set_marker_mid<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::MarkerMid, value);
}
fn marker_mid(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::MarkerMid)
}
fn with_marker_start<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::MarkerStart, value);
self
}
fn set_marker_start<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::MarkerStart, value);
}
fn marker_start(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::MarkerStart)
}
fn with_mask<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::Mask, value);
self
}
fn set_mask<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::Mask, value);
}
fn mask(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::Mask)
}
fn with_opacity<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::Opacity, value);
self
}
fn set_opacity<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::Opacity, value);
}
fn opacity(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::Opacity)
}
fn with_overflow<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::Overflow, value);
self
}
fn set_overflow<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::Overflow, value);
}
fn overflow(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::Overflow)
}
fn with_pointer_events<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::PointerEvents, value);
self
}
fn set_pointer_events<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::PointerEvents, value);
}
fn pointer_events(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::PointerEvents)
}
fn with_shape_rendering<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::ShapeRendering, value);
self
}
fn set_shape_rendering<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::ShapeRendering, value);
}
fn shape_rendering(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::ShapeRendering)
}
fn with_stop_color<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::StopColor, value);
self
}
fn set_stop_color<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::StopColor, value);
}
fn stop_color(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::StopColor)
}
fn with_stop_opacity<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::StopOpacity, value);
self
}
fn set_stop_opacity<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::StopOpacity, value);
}
fn stop_opacity(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::StopOpacity)
}
fn with_stroke<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::Stroke, value);
self
}
fn set_stroke<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::Stroke, value);
}
fn stroke(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::Stroke)
}
fn with_stroke_dasharray<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::StrokeDasharray, value);
self
}
fn set_stroke_dasharray<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::StrokeDasharray, value);
}
fn stroke_dasharray(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::StrokeDasharray)
}
fn with_stroke_dashoffset<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::StrokeDashoffset, value);
self
}
fn set_stroke_dashoffset<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::StrokeDashoffset, value);
}
fn stroke_dashoffset(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::StrokeDashoffset)
}
fn with_stroke_linecap<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::StrokeLinecap, value);
self
}
fn set_stroke_linecap<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::StrokeLinecap, value);
}
fn stroke_linecap(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::StrokeLinecap)
}
fn with_stroke_linejoin<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::StrokeLinejoin, value);
self
}
fn set_stroke_linejoin<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::StrokeLinejoin, value);
}
fn stroke_linejoin(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::StrokeLinejoin)
}
fn with_stroke_miterlimit<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::StrokeMiterlimit, value);
self
}
fn set_stroke_miterlimit<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::StrokeMiterlimit, value);
}
fn stroke_miterlimit(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::StrokeMiterlimit)
}
fn with_stroke_opacity<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::StrokeOpacity, value);
self
}
fn set_stroke_opacity<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::StrokeOpacity, value);
}
fn stroke_opacity(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::StrokeOpacity)
}
fn with_stroke_width<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::StrokeWidth, value);
self
}
fn set_stroke_width<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::StrokeWidth, value);
}
fn stroke_width(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::StrokeWidth)
}
fn with_text_anchor<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::TextAnchor, value);
self
}
fn set_text_anchor<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::TextAnchor, value);
}
fn text_anchor(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::TextAnchor)
}
fn with_text_decoration<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::TextDecoration, value);
self
}
fn set_text_decoration<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::TextDecoration, value);
}
fn text_decoration(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::TextDecoration)
}
fn with_text_rendering<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::TextRendering, value);
self
}
fn set_text_rendering<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::TextRendering, value);
}
fn text_rendering(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::TextRendering)
}
fn with_transform<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::Transform, value);
self
}
fn set_transform<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::Transform, value);
}
fn transform(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::Transform)
}
fn with_transform_origin<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::TransformOrigin, value);
self
}
fn set_transform_origin<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::TransformOrigin, value);
}
fn transform_origin(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::TransformOrigin)
}
fn with_unicode_bidi<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::UnicodeBidi, value);
self
}
fn set_unicode_bidi<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::UnicodeBidi, value);
}
fn unicode_bidi(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::UnicodeBidi)
}
fn with_vector_effect<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::VectorEffect, value);
self
}
fn set_vector_effect<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::VectorEffect, value);
}
fn vector_effect(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::VectorEffect)
}
fn with_visibility<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::Visibility, value);
self
}
fn set_visibility<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::Visibility, value);
}
fn visibility(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::Visibility)
}
fn with_word_spacing<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::WordSpacing, value);
self
}
fn set_word_spacing<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::WordSpacing, value);
}
fn word_spacing(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::WordSpacing)
}
fn with_writing_mode<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::WritingMode, value);
self
}
fn set_writing_mode<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(PresentationAttributes::WritingMode, value);
}
fn writing_mode(&self) -> Option<&dyn Value> {
self.get_attr(PresentationAttributes::WritingMode)
}
}
#[allow(clippy::enum_variant_names)]
#[derive(Clone, Copy, Eq, Hash, PartialEq)]
pub enum StyleAttributes {
Class,
Style,
}
impl StyleAttributes {
pub fn as_str(&self) -> &'static str {
match self {
Self::Class => "class",
Self::Style => "style",
}
}
}
impl Display for StyleAttributes {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Debug for StyleAttributes {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
pub trait StyleAttributesSetter {
fn set_attr<V>(&mut self, attr: StyleAttributes, value: V)
where
V: Value + 'static;
fn get_attr(&self, attr: StyleAttributes) -> Option<&dyn Value>;
}
pub trait TagWithStyleAttributes: StyleAttributesSetter + Sized {
fn with_class<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(StyleAttributes::Class, value);
self
}
fn set_class<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(StyleAttributes::Class, value);
}
fn class(&self) -> Option<&dyn Value> {
self.get_attr(StyleAttributes::Class)
}
fn with_style<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(StyleAttributes::Style, value);
self
}
fn set_style<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(StyleAttributes::Style, value);
}
fn style(&self) -> Option<&dyn Value> {
self.get_attr(StyleAttributes::Style)
}
}
#[allow(clippy::enum_variant_names)]
#[derive(Clone, Copy, Eq, Hash, PartialEq)]
pub enum TransferFunctionAttributes {
Amplitude,
Exponent,
Intercept,
Offset,
Slope,
TableValues,
Type,
}
impl TransferFunctionAttributes {
pub fn as_str(&self) -> &'static str {
match self {
Self::Amplitude => "amplitude",
Self::Exponent => "exponent",
Self::Intercept => "intercept",
Self::Offset => "offset",
Self::Slope => "slope",
Self::TableValues => "tableValues",
Self::Type => "type",
}
}
}
impl Display for TransferFunctionAttributes {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Debug for TransferFunctionAttributes {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
pub trait TransferFunctionAttributesSetter {
fn set_attr<V>(&mut self, attr: TransferFunctionAttributes, value: V)
where
V: Value + 'static;
fn get_attr(&self, attr: TransferFunctionAttributes) -> Option<&dyn Value>;
}
pub trait TagWithTransferFunctionAttributes: TransferFunctionAttributesSetter + Sized {
fn with_amplitude<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(TransferFunctionAttributes::Amplitude, value);
self
}
fn set_amplitude<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(TransferFunctionAttributes::Amplitude, value);
}
fn amplitude(&self) -> Option<&dyn Value> {
self.get_attr(TransferFunctionAttributes::Amplitude)
}
fn with_exponent<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(TransferFunctionAttributes::Exponent, value);
self
}
fn set_exponent<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(TransferFunctionAttributes::Exponent, value);
}
fn exponent(&self) -> Option<&dyn Value> {
self.get_attr(TransferFunctionAttributes::Exponent)
}
fn with_intercept<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(TransferFunctionAttributes::Intercept, value);
self
}
fn set_intercept<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(TransferFunctionAttributes::Intercept, value);
}
fn intercept(&self) -> Option<&dyn Value> {
self.get_attr(TransferFunctionAttributes::Intercept)
}
fn with_offset<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(TransferFunctionAttributes::Offset, value);
self
}
fn set_offset<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(TransferFunctionAttributes::Offset, value);
}
fn offset(&self) -> Option<&dyn Value> {
self.get_attr(TransferFunctionAttributes::Offset)
}
fn with_slope<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(TransferFunctionAttributes::Slope, value);
self
}
fn set_slope<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(TransferFunctionAttributes::Slope, value);
}
fn slope(&self) -> Option<&dyn Value> {
self.get_attr(TransferFunctionAttributes::Slope)
}
fn with_table_values<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(TransferFunctionAttributes::TableValues, value);
self
}
fn set_table_values<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(TransferFunctionAttributes::TableValues, value);
}
fn table_values(&self) -> Option<&dyn Value> {
self.get_attr(TransferFunctionAttributes::TableValues)
}
fn with_ty<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(TransferFunctionAttributes::Type, value);
self
}
fn set_ty<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(TransferFunctionAttributes::Type, value);
}
fn ty(&self) -> Option<&dyn Value> {
self.get_attr(TransferFunctionAttributes::Type)
}
}
#[allow(clippy::enum_variant_names)]
#[derive(Clone, Copy, Eq, Hash, PartialEq)]
pub enum XLinkAttributes {
XlinkActuate,
XlinkArcrole,
XlinkHref,
XlinkRole,
XlinkShow,
XlinkTitle,
XlinkType,
}
impl XLinkAttributes {
pub fn as_str(&self) -> &'static str {
match self {
Self::XlinkActuate => "xlink:actuate",
Self::XlinkArcrole => "xlink:arcrole",
Self::XlinkHref => "xlink:href",
Self::XlinkRole => "xlink:role",
Self::XlinkShow => "xlink:show",
Self::XlinkTitle => "xlink:title",
Self::XlinkType => "xlink:type",
}
}
}
impl Display for XLinkAttributes {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl Debug for XLinkAttributes {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
pub trait XLinkAttributesSetter {
fn set_attr<V>(&mut self, attr: XLinkAttributes, value: V)
where
V: Value + 'static;
fn get_attr(&self, attr: XLinkAttributes) -> Option<&dyn Value>;
}
pub trait TagWithXLinkAttributes: XLinkAttributesSetter + Sized {
fn with_xlink_actuate<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(XLinkAttributes::XlinkActuate, value);
self
}
fn set_xlink_actuate<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(XLinkAttributes::XlinkActuate, value);
}
fn xlink_actuate(&self) -> Option<&dyn Value> {
self.get_attr(XLinkAttributes::XlinkActuate)
}
fn with_xlink_arcrole<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(XLinkAttributes::XlinkArcrole, value);
self
}
fn set_xlink_arcrole<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(XLinkAttributes::XlinkArcrole, value);
}
fn xlink_arcrole(&self) -> Option<&dyn Value> {
self.get_attr(XLinkAttributes::XlinkArcrole)
}
fn with_xlink_href<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(XLinkAttributes::XlinkHref, value);
self
}
fn set_xlink_href<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(XLinkAttributes::XlinkHref, value);
}
fn xlink_href(&self) -> Option<&dyn Value> {
self.get_attr(XLinkAttributes::XlinkHref)
}
fn with_xlink_role<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(XLinkAttributes::XlinkRole, value);
self
}
fn set_xlink_role<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(XLinkAttributes::XlinkRole, value);
}
fn xlink_role(&self) -> Option<&dyn Value> {
self.get_attr(XLinkAttributes::XlinkRole)
}
fn with_xlink_show<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(XLinkAttributes::XlinkShow, value);
self
}
fn set_xlink_show<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(XLinkAttributes::XlinkShow, value);
}
fn xlink_show(&self) -> Option<&dyn Value> {
self.get_attr(XLinkAttributes::XlinkShow)
}
fn with_xlink_title<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(XLinkAttributes::XlinkTitle, value);
self
}
fn set_xlink_title<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(XLinkAttributes::XlinkTitle, value);
}
fn xlink_title(&self) -> Option<&dyn Value> {
self.get_attr(XLinkAttributes::XlinkTitle)
}
fn with_xlink_type<V>(mut self, value: V) -> Self
where
V: Value + 'static
{
self.set_attr(XLinkAttributes::XlinkType, value);
self
}
fn set_xlink_type<V>(&mut self, value: V)
where
V: Value + 'static
{
self.set_attr(XLinkAttributes::XlinkType, value);
}
fn xlink_type(&self) -> Option<&dyn Value> {
self.get_attr(XLinkAttributes::XlinkType)
}
}
pub(super) mod prelude {
pub use super::{
TagWithAnimationAdditionAttributes,
TagWithAnimationAttributeTargetAttributes,
TagWithAnimationEventAttributes,
TagWithAnimationTimingAttributes,
TagWithAnimationValueAttributes,
TagWithConditionalProcessingAttributes,
TagWithCoreAttributes,
TagWithDocumentEventAttributes,
TagWithFilterAttributes,
TagWithGlobalEventAttributes,
TagWithGraphicalEventAttributes,
TagWithPresentationAttributes,
TagWithStyleAttributes,
TagWithTransferFunctionAttributes,
TagWithXLinkAttributes,
};
}