Appearance
types/number.proto
Table of Contents
types/number.proto
FloatAttributes
Describes features and restrictions applied to a number that is typically used as part of an apis value
Field | Type | Label | Description |
---|---|---|---|
bounds | FloatBounds | ||
step | float | The stepping interval, how little the value can change in one go. A default value of 0 is equivalent to a continuous step, i.e. all possible float values are supported | |
supports_delta | bool | Indicate whether the device supports delta adjustments when changing the value | |
ramp_support | TweenSupport | Indicate the level of ramp support the device has | |
default_capping | NumberCapping | Provide information on how invalid values will be handled |
FloatBounds
Defines the bounds for a number. Either of the min or max values can be absent which means those aspects are unbounded. It makes no sense for both to be unset, if so then this is no longer a bounds but that isn't disallowed.
Contrary to most programming practices both min and max are inclusive and denote the max allowed value, just like htmls input type=range.
Field | Type | Label | Description |
---|---|---|---|
min | float | optional | the minimum value (inclusive). If absent then there is no minimum, though this is typically Float.Min |
max | float | optional | the maximum value (inclusive). If absent then there is no maximum, though this is typically Float.Max |
Int32Attributes
Describes features and restrictions applied to a number that is typically used as part of an apis value
Field | Type | Label | Description |
---|---|---|---|
bounds | Int32Bounds | ||
step | int32 | The stepping interval, how little the value can change in one go. A default value of 0 is equivalent to a continuous step, i.e. step=1 | |
supports_delta | bool | Indicate whether the device supports delta adjustments when changing the value | |
ramp_support | TweenSupport | Indicate the level of ramp support the device has | |
default_capping | NumberCapping | Provide information on how invalid values will be handled |
Int32Bounds
Defines the bounds for a number. Either of the min or max values can be absent which means those aspects are unbounded. It makes no sense for both to be unset, if so then this is no longer a bounds but that isn't disallowed.
Contrary to most programming practices both min and max are inclusive and denote the max allowed value, just like htmls input type=range.
Field | Type | Label | Description |
---|---|---|---|
min | int32 | optional | the minimum value (inclusive). If absent then there is no minimum, though this is typically Int32.Min |
max | int32 | optional | the maximum value (inclusive). If absent then there is no maximum, though this is typically Int32.Max |
NumberCapping
Options for how invalid number values will be handled
Field | Type | Label | Description |
---|---|---|---|
min | InvalidNumberBehaviour | If the value is less than the minimum, behave this way. Should default to RESTRICT | |
step | InvalidNumberBehaviour | If the value does not lie on a step value, behave this way. Should default to ALLOW | |
max | InvalidNumberBehaviour | If the value is greater than the maximum, behave this way. Should default to RESTRICT |
InvalidNumberBehaviour
Possible behaviours for values that are not allowed by the number
Name | Number | Description |
---|---|---|
INVALID_NUMBER_BEHAVIOUR_UNSPECIFIED | 0 | A default behaviour will be applied, typically RESTRICT |
RESTRICT | 1 | The value will be restricted to the most appropriate value, typically the closest |
ERROR | 2 | An error will be raised to alert to the invalid value |
ALLOW | 3 | Ignore the bounds and apply the value anyway |