com.yandex.div.dsl.model.DivText.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kotlin-json-builder Show documentation
Show all versions of kotlin-json-builder Show documentation
DivKit is an open source Server-Driven UI (SDUI) framework. SDUI is a an emerging technique that leverage the server to build the user interfaces of their mobile app.
// Generated code. Do not modify.
package com.yandex.div.dsl.model
import java.net.URI
import com.fasterxml.jackson.annotation.*
import com.yandex.div.dsl.*
import com.yandex.div.dsl.context.*
import com.yandex.div.dsl.type.*
import com.yandex.div.dsl.util.*
class DivText internal constructor(
@JsonIgnore override val accessibility: Property?,
@JsonIgnore val action: Property?,
@JsonIgnore val actionAnimation: Property?,
@JsonIgnore val actions: Property>?,
@JsonIgnore override val alignmentHorizontal: Property?,
@JsonIgnore override val alignmentVertical: Property?,
@JsonIgnore override val alpha: Property?,
@JsonIgnore val autoEllipsize: Property?,
@JsonIgnore override val background: Property>?,
@JsonIgnore override val border: Property?,
@JsonIgnore override val columnSpan: Property?,
@JsonIgnore val doubletapActions: Property>?,
@JsonIgnore val ellipsis: Property?,
@JsonIgnore override val extensions: Property>?,
@JsonIgnore override val focus: Property?,
@JsonIgnore val focusedTextColor: Property?,
@JsonIgnore val fontFamily: Property?,
@JsonIgnore val fontSize: Property?,
@JsonIgnore val fontSizeUnit: Property?,
@JsonIgnore val fontWeight: Property?,
@JsonIgnore override val height: Property?,
@JsonIgnore override val id: Property?,
@JsonIgnore val images: Property>?,
@JsonIgnore val letterSpacing: Property?,
@JsonIgnore val lineHeight: Property?,
@JsonIgnore val longtapActions: Property>?,
@JsonIgnore override val margins: Property?,
@JsonIgnore val maxLines: Property?,
@JsonIgnore val minHiddenLines: Property?,
@JsonIgnore override val paddings: Property?,
@JsonIgnore val ranges: Property>?,
@JsonIgnore override val rowSpan: Property?,
@JsonIgnore val selectable: Property?,
@JsonIgnore override val selectedActions: Property>?,
@JsonIgnore val strike: Property?,
@JsonIgnore val text: Property?,
@JsonIgnore val textAlignmentHorizontal: Property?,
@JsonIgnore val textAlignmentVertical: Property?,
@JsonIgnore val textColor: Property?,
@JsonIgnore val textGradient: Property?,
@JsonIgnore override val tooltips: Property>?,
@JsonIgnore override val transform: Property?,
@JsonIgnore override val transitionChange: Property?,
@JsonIgnore override val transitionIn: Property?,
@JsonIgnore override val transitionOut: Property?,
@JsonIgnore override val transitionTriggers: Property>?,
@JsonIgnore val truncate: Property?,
@JsonIgnore val underline: Property?,
@JsonIgnore override val visibility: Property?,
@JsonIgnore override val visibilityAction: Property?,
@JsonIgnore override val visibilityActions: Property>?,
@JsonIgnore override val width: Property?,
) : Div, DivBase {
@JsonProperty("type") override val type = "text"
@JsonAnyGetter
internal fun properties(): Map {
return propertyMapOf(
"accessibility" to accessibility,
"action" to action,
"action_animation" to actionAnimation,
"actions" to actions,
"alignment_horizontal" to alignmentHorizontal,
"alignment_vertical" to alignmentVertical,
"alpha" to alpha,
"auto_ellipsize" to autoEllipsize,
"background" to background,
"border" to border,
"column_span" to columnSpan,
"doubletap_actions" to doubletapActions,
"ellipsis" to ellipsis,
"extensions" to extensions,
"focus" to focus,
"focused_text_color" to focusedTextColor,
"font_family" to fontFamily,
"font_size" to fontSize,
"font_size_unit" to fontSizeUnit,
"font_weight" to fontWeight,
"height" to height,
"id" to id,
"images" to images,
"letter_spacing" to letterSpacing,
"line_height" to lineHeight,
"longtap_actions" to longtapActions,
"margins" to margins,
"max_lines" to maxLines,
"min_hidden_lines" to minHiddenLines,
"paddings" to paddings,
"ranges" to ranges,
"row_span" to rowSpan,
"selectable" to selectable,
"selected_actions" to selectedActions,
"strike" to strike,
"text" to text,
"text_alignment_horizontal" to textAlignmentHorizontal,
"text_alignment_vertical" to textAlignmentVertical,
"text_color" to textColor,
"text_gradient" to textGradient,
"tooltips" to tooltips,
"transform" to transform,
"transition_change" to transitionChange,
"transition_in" to transitionIn,
"transition_out" to transitionOut,
"transition_triggers" to transitionTriggers,
"truncate" to truncate,
"underline" to underline,
"visibility" to visibility,
"visibility_action" to visibilityAction,
"visibility_actions" to visibilityActions,
"width" to width,
)
}
enum class Truncate(@JsonValue val value: String) {
NONE("none"),
START("start"),
END("end"),
MIDDLE("middle"),
}
class Ellipsis internal constructor(
@JsonIgnore val actions: Property>?,
@JsonIgnore val images: Property>?,
@JsonIgnore val ranges: Property>?,
@JsonIgnore val text: Property?,
) {
@JsonAnyGetter
internal fun properties(): Map {
return propertyMapOf(
"actions" to actions,
"images" to images,
"ranges" to ranges,
"text" to text,
)
}
}
class Image internal constructor(
@JsonIgnore val height: Property?,
@JsonIgnore val start: Property?,
@JsonIgnore val tintColor: Property?,
@JsonIgnore val tintMode: Property?,
@JsonIgnore val url: Property?,
@JsonIgnore val width: Property?,
) {
@JsonAnyGetter
internal fun properties(): Map {
return propertyMapOf(
"height" to height,
"start" to start,
"tint_color" to tintColor,
"tint_mode" to tintMode,
"url" to url,
"width" to width,
)
}
}
class Range internal constructor(
@JsonIgnore val actions: Property>?,
@JsonIgnore val end: Property?,
@JsonIgnore val fontFamily: Property?,
@JsonIgnore val fontSize: Property?,
@JsonIgnore val fontSizeUnit: Property?,
@JsonIgnore val fontWeight: Property?,
@JsonIgnore val letterSpacing: Property?,
@JsonIgnore val lineHeight: Property?,
@JsonIgnore val start: Property?,
@JsonIgnore val strike: Property?,
@JsonIgnore val textColor: Property?,
@JsonIgnore val topOffset: Property?,
@JsonIgnore val underline: Property?,
) {
@JsonAnyGetter
internal fun properties(): Map {
return propertyMapOf(
"actions" to actions,
"end" to end,
"font_family" to fontFamily,
"font_size" to fontSize,
"font_size_unit" to fontSizeUnit,
"font_weight" to fontWeight,
"letter_spacing" to letterSpacing,
"line_height" to lineHeight,
"start" to start,
"strike" to strike,
"text_color" to textColor,
"top_offset" to topOffset,
"underline" to underline,
)
}
}
}
fun TemplateContext.divText(): LiteralProperty {
return value(DivText(
accessibility = null,
action = null,
actionAnimation = null,
actions = null,
alignmentHorizontal = null,
alignmentVertical = null,
alpha = null,
autoEllipsize = null,
background = null,
border = null,
columnSpan = null,
doubletapActions = null,
ellipsis = null,
extensions = null,
focus = null,
focusedTextColor = null,
fontFamily = null,
fontSize = null,
fontSizeUnit = null,
fontWeight = null,
height = null,
id = null,
images = null,
letterSpacing = null,
lineHeight = null,
longtapActions = null,
margins = null,
maxLines = null,
minHiddenLines = null,
paddings = null,
ranges = null,
rowSpan = null,
selectable = null,
selectedActions = null,
strike = null,
text = null,
textAlignmentHorizontal = null,
textAlignmentVertical = null,
textColor = null,
textGradient = null,
tooltips = null,
transform = null,
transitionChange = null,
transitionIn = null,
transitionOut = null,
transitionTriggers = null,
truncate = null,
underline = null,
visibility = null,
visibilityAction = null,
visibilityActions = null,
width = null,
))
}
fun TemplateContext.divText(
text: Property? = null,
accessibility: Property? = null,
action: Property? = null,
actionAnimation: Property? = null,
actions: Property>? = null,
alignmentHorizontal: Property? = null,
alignmentVertical: Property? = null,
alpha: Property? = null,
autoEllipsize: Property? = null,
background: Property>? = null,
border: Property? = null,
columnSpan: Property? = null,
doubletapActions: Property>? = null,
ellipsis: Property? = null,
extensions: Property>? = null,
focus: Property? = null,
focusedTextColor: Property? = null,
fontFamily: Property? = null,
fontSize: Property? = null,
fontSizeUnit: Property? = null,
fontWeight: Property? = null,
height: Property? = null,
id: Property? = null,
images: Property>? = null,
letterSpacing: Property? = null,
lineHeight: Property? = null,
longtapActions: Property>? = null,
margins: Property? = null,
maxLines: Property? = null,
minHiddenLines: Property? = null,
paddings: Property? = null,
ranges: Property>? = null,
rowSpan: Property? = null,
selectable: Property? = null,
selectedActions: Property>? = null,
strike: Property? = null,
textAlignmentHorizontal: Property? = null,
textAlignmentVertical: Property? = null,
textColor: Property? = null,
textGradient: Property? = null,
tooltips: Property>? = null,
transform: Property? = null,
transitionChange: Property? = null,
transitionIn: Property? = null,
transitionOut: Property? = null,
transitionTriggers: Property>? = null,
truncate: Property? = null,
underline: Property? = null,
visibility: Property? = null,
visibilityAction: Property? = null,
visibilityActions: Property>? = null,
width: Property? = null,
): LiteralProperty {
return value(DivText(
accessibility = accessibility,
action = action,
actionAnimation = actionAnimation,
actions = actions,
alignmentHorizontal = alignmentHorizontal,
alignmentVertical = alignmentVertical,
alpha = alpha,
autoEllipsize = autoEllipsize,
background = background,
border = border,
columnSpan = columnSpan,
doubletapActions = doubletapActions,
ellipsis = ellipsis,
extensions = extensions,
focus = focus,
focusedTextColor = focusedTextColor,
fontFamily = fontFamily,
fontSize = fontSize,
fontSizeUnit = fontSizeUnit,
fontWeight = fontWeight,
height = height,
id = id,
images = images,
letterSpacing = letterSpacing,
lineHeight = lineHeight,
longtapActions = longtapActions,
margins = margins,
maxLines = maxLines,
minHiddenLines = minHiddenLines,
paddings = paddings,
ranges = ranges,
rowSpan = rowSpan,
selectable = selectable,
selectedActions = selectedActions,
strike = strike,
text = text,
textAlignmentHorizontal = textAlignmentHorizontal,
textAlignmentVertical = textAlignmentVertical,
textColor = textColor,
textGradient = textGradient,
tooltips = tooltips,
transform = transform,
transitionChange = transitionChange,
transitionIn = transitionIn,
transitionOut = transitionOut,
transitionTriggers = transitionTriggers,
truncate = truncate,
underline = underline,
visibility = visibility,
visibilityAction = visibilityAction,
visibilityActions = visibilityActions,
width = width,
))
}
fun TemplateContext.divText(
text: String? = null,
accessibility: DivAccessibility? = null,
action: DivAction? = null,
actionAnimation: DivAnimation? = null,
actions: List? = null,
alignmentHorizontal: DivAlignmentHorizontal? = null,
alignmentVertical: DivAlignmentVertical? = null,
alpha: Double? = null,
autoEllipsize: BoolInt? = null,
background: List? = null,
border: DivBorder? = null,
columnSpan: Int? = null,
doubletapActions: List? = null,
ellipsis: DivText.Ellipsis? = null,
extensions: List? = null,
focus: DivFocus? = null,
focusedTextColor: Color? = null,
fontFamily: DivFontFamily? = null,
fontSize: Int? = null,
fontSizeUnit: DivSizeUnit? = null,
fontWeight: DivFontWeight? = null,
height: DivSize? = null,
id: String? = null,
images: List? = null,
letterSpacing: Double? = null,
lineHeight: Int? = null,
longtapActions: List? = null,
margins: DivEdgeInsets? = null,
maxLines: Int? = null,
minHiddenLines: Int? = null,
paddings: DivEdgeInsets? = null,
ranges: List? = null,
rowSpan: Int? = null,
selectable: BoolInt? = null,
selectedActions: List? = null,
strike: DivLineStyle? = null,
textAlignmentHorizontal: DivAlignmentHorizontal? = null,
textAlignmentVertical: DivAlignmentVertical? = null,
textColor: Color? = null,
textGradient: DivTextGradient? = null,
tooltips: List? = null,
transform: DivTransform? = null,
transitionChange: DivChangeTransition? = null,
transitionIn: DivAppearanceTransition? = null,
transitionOut: DivAppearanceTransition? = null,
transitionTriggers: List? = null,
truncate: DivText.Truncate? = null,
underline: DivLineStyle? = null,
visibility: DivVisibility? = null,
visibilityAction: DivVisibilityAction? = null,
visibilityActions: List? = null,
width: DivSize? = null,
): LiteralProperty {
return value(DivText(
accessibility = optionalValue(accessibility),
action = optionalValue(action),
actionAnimation = optionalValue(actionAnimation),
actions = optionalValue(actions),
alignmentHorizontal = optionalValue(alignmentHorizontal),
alignmentVertical = optionalValue(alignmentVertical),
alpha = optionalValue(alpha),
autoEllipsize = optionalValue(autoEllipsize),
background = optionalValue(background),
border = optionalValue(border),
columnSpan = optionalValue(columnSpan),
doubletapActions = optionalValue(doubletapActions),
ellipsis = optionalValue(ellipsis),
extensions = optionalValue(extensions),
focus = optionalValue(focus),
focusedTextColor = optionalValue(focusedTextColor),
fontFamily = optionalValue(fontFamily),
fontSize = optionalValue(fontSize),
fontSizeUnit = optionalValue(fontSizeUnit),
fontWeight = optionalValue(fontWeight),
height = optionalValue(height),
id = optionalValue(id),
images = optionalValue(images),
letterSpacing = optionalValue(letterSpacing),
lineHeight = optionalValue(lineHeight),
longtapActions = optionalValue(longtapActions),
margins = optionalValue(margins),
maxLines = optionalValue(maxLines),
minHiddenLines = optionalValue(minHiddenLines),
paddings = optionalValue(paddings),
ranges = optionalValue(ranges),
rowSpan = optionalValue(rowSpan),
selectable = optionalValue(selectable),
selectedActions = optionalValue(selectedActions),
strike = optionalValue(strike),
text = optionalValue(text),
textAlignmentHorizontal = optionalValue(textAlignmentHorizontal),
textAlignmentVertical = optionalValue(textAlignmentVertical),
textColor = optionalValue(textColor),
textGradient = optionalValue(textGradient),
tooltips = optionalValue(tooltips),
transform = optionalValue(transform),
transitionChange = optionalValue(transitionChange),
transitionIn = optionalValue(transitionIn),
transitionOut = optionalValue(transitionOut),
transitionTriggers = optionalValue(transitionTriggers),
truncate = optionalValue(truncate),
underline = optionalValue(underline),
visibility = optionalValue(visibility),
visibilityAction = optionalValue(visibilityAction),
visibilityActions = optionalValue(visibilityActions),
width = optionalValue(width),
))
}
fun TemplateContext.ellipsis(): LiteralProperty {
return value(DivText.Ellipsis(
actions = null,
images = null,
ranges = null,
text = null,
))
}
fun TemplateContext.ellipsis(
text: Property? = null,
actions: Property>? = null,
images: Property>? = null,
ranges: Property>? = null,
): LiteralProperty {
return value(DivText.Ellipsis(
actions = actions,
images = images,
ranges = ranges,
text = text,
))
}
fun TemplateContext.ellipsis(
text: String? = null,
actions: List? = null,
images: List? = null,
ranges: List? = null,
): LiteralProperty {
return value(DivText.Ellipsis(
actions = optionalValue(actions),
images = optionalValue(images),
ranges = optionalValue(ranges),
text = optionalValue(text),
))
}
fun TemplateContext.image(): LiteralProperty {
return value(DivText.Image(
height = null,
start = null,
tintColor = null,
tintMode = null,
url = null,
width = null,
))
}
fun TemplateContext.image(
start: Property? = null,
url: Property? = null,
height: Property? = null,
tintColor: Property? = null,
tintMode: Property? = null,
width: Property? = null,
): LiteralProperty {
return value(DivText.Image(
height = height,
start = start,
tintColor = tintColor,
tintMode = tintMode,
url = url,
width = width,
))
}
fun TemplateContext.image(
start: Int? = null,
url: URI? = null,
height: DivFixedSize? = null,
tintColor: Color? = null,
tintMode: DivBlendMode? = null,
width: DivFixedSize? = null,
): LiteralProperty {
return value(DivText.Image(
height = optionalValue(height),
start = optionalValue(start),
tintColor = optionalValue(tintColor),
tintMode = optionalValue(tintMode),
url = optionalValue(url),
width = optionalValue(width),
))
}
fun TemplateContext.range(): LiteralProperty {
return value(DivText.Range(
actions = null,
end = null,
fontFamily = null,
fontSize = null,
fontSizeUnit = null,
fontWeight = null,
letterSpacing = null,
lineHeight = null,
start = null,
strike = null,
textColor = null,
topOffset = null,
underline = null,
))
}
fun TemplateContext.range(
end: Property? = null,
start: Property? = null,
actions: Property>? = null,
fontFamily: Property? = null,
fontSize: Property? = null,
fontSizeUnit: Property? = null,
fontWeight: Property? = null,
letterSpacing: Property? = null,
lineHeight: Property? = null,
strike: Property? = null,
textColor: Property? = null,
topOffset: Property? = null,
underline: Property? = null,
): LiteralProperty {
return value(DivText.Range(
actions = actions,
end = end,
fontFamily = fontFamily,
fontSize = fontSize,
fontSizeUnit = fontSizeUnit,
fontWeight = fontWeight,
letterSpacing = letterSpacing,
lineHeight = lineHeight,
start = start,
strike = strike,
textColor = textColor,
topOffset = topOffset,
underline = underline,
))
}
fun TemplateContext.range(
end: Int? = null,
start: Int? = null,
actions: List? = null,
fontFamily: DivFontFamily? = null,
fontSize: Int? = null,
fontSizeUnit: DivSizeUnit? = null,
fontWeight: DivFontWeight? = null,
letterSpacing: Double? = null,
lineHeight: Int? = null,
strike: DivLineStyle? = null,
textColor: Color? = null,
topOffset: Int? = null,
underline: DivLineStyle? = null,
): LiteralProperty {
return value(DivText.Range(
actions = optionalValue(actions),
end = optionalValue(end),
fontFamily = optionalValue(fontFamily),
fontSize = optionalValue(fontSize),
fontSizeUnit = optionalValue(fontSizeUnit),
fontWeight = optionalValue(fontWeight),
letterSpacing = optionalValue(letterSpacing),
lineHeight = optionalValue(lineHeight),
start = optionalValue(start),
strike = optionalValue(strike),
textColor = optionalValue(textColor),
topOffset = optionalValue(topOffset),
underline = optionalValue(underline),
))
}
fun CardContext.divText(
text: ValueProperty,
accessibility: ValueProperty? = null,
action: ValueProperty? = null,
actionAnimation: ValueProperty? = null,
actions: ValueProperty>? = null,
alignmentHorizontal: ValueProperty? = null,
alignmentVertical: ValueProperty? = null,
alpha: ValueProperty? = null,
autoEllipsize: ValueProperty? = null,
background: ValueProperty>? = null,
border: ValueProperty? = null,
columnSpan: ValueProperty? = null,
doubletapActions: ValueProperty>? = null,
ellipsis: ValueProperty? = null,
extensions: ValueProperty>? = null,
focus: ValueProperty? = null,
focusedTextColor: ValueProperty? = null,
fontFamily: ValueProperty? = null,
fontSize: ValueProperty? = null,
fontSizeUnit: ValueProperty? = null,
fontWeight: ValueProperty? = null,
height: ValueProperty? = null,
id: ValueProperty? = null,
images: ValueProperty>? = null,
letterSpacing: ValueProperty? = null,
lineHeight: ValueProperty? = null,
longtapActions: ValueProperty>? = null,
margins: ValueProperty? = null,
maxLines: ValueProperty? = null,
minHiddenLines: ValueProperty? = null,
paddings: ValueProperty? = null,
ranges: ValueProperty>? = null,
rowSpan: ValueProperty? = null,
selectable: ValueProperty? = null,
selectedActions: ValueProperty>? = null,
strike: ValueProperty? = null,
textAlignmentHorizontal: ValueProperty? = null,
textAlignmentVertical: ValueProperty? = null,
textColor: ValueProperty? = null,
textGradient: ValueProperty? = null,
tooltips: ValueProperty>? = null,
transform: ValueProperty? = null,
transitionChange: ValueProperty? = null,
transitionIn: ValueProperty? = null,
transitionOut: ValueProperty? = null,
transitionTriggers: ValueProperty>? = null,
truncate: ValueProperty