Skip to main content

web_sys/features/
gen_SvgTextContentElement.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7    #[wasm_bindgen(
8        extends = "SvgGraphicsElement",
9        extends = "SvgElement",
10        extends = "Element",
11        extends = "Node",
12        extends = "EventTarget",
13        extends = "::js_sys::Object",
14        js_name = "SVGTextContentElement",
15        typescript_type = "SVGTextContentElement"
16    )]
17    #[derive(Debug, Clone, PartialEq, Eq)]
18    #[doc = "The `SvgTextContentElement` class."]
19    #[doc = ""]
20    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGTextContentElement)"]
21    #[doc = ""]
22    #[doc = "*This API requires the following crate features to be activated: `SvgTextContentElement`*"]
23    pub type SvgTextContentElement;
24    #[cfg(feature = "SvgAnimatedLength")]
25    #[wasm_bindgen(
26        method,
27        getter,
28        js_class = "SVGTextContentElement",
29        js_name = "textLength"
30    )]
31    #[doc = "Getter for the `textLength` field of this object."]
32    #[doc = ""]
33    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGTextContentElement/textLength)"]
34    #[doc = ""]
35    #[doc = "*This API requires the following crate features to be activated: `SvgAnimatedLength`, `SvgTextContentElement`*"]
36    pub fn text_length(this: &SvgTextContentElement) -> SvgAnimatedLength;
37    #[cfg(feature = "SvgAnimatedEnumeration")]
38    #[wasm_bindgen(
39        method,
40        getter,
41        js_class = "SVGTextContentElement",
42        js_name = "lengthAdjust"
43    )]
44    #[doc = "Getter for the `lengthAdjust` field of this object."]
45    #[doc = ""]
46    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGTextContentElement/lengthAdjust)"]
47    #[doc = ""]
48    #[doc = "*This API requires the following crate features to be activated: `SvgAnimatedEnumeration`, `SvgTextContentElement`*"]
49    pub fn length_adjust(this: &SvgTextContentElement) -> SvgAnimatedEnumeration;
50    #[cfg(feature = "SvgPoint")]
51    #[wasm_bindgen(
52        method,
53        js_class = "SVGTextContentElement",
54        js_name = "getCharNumAtPosition"
55    )]
56    #[doc = "The `getCharNumAtPosition()` method."]
57    #[doc = ""]
58    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGTextContentElement/getCharNumAtPosition)"]
59    #[doc = ""]
60    #[doc = "*This API requires the following crate features to be activated: `SvgPoint`, `SvgTextContentElement`*"]
61    pub fn get_char_num_at_position(this: &SvgTextContentElement, point: &SvgPoint) -> i32;
62    #[wasm_bindgen(
63        method,
64        js_class = "SVGTextContentElement",
65        js_name = "getComputedTextLength"
66    )]
67    #[doc = "The `getComputedTextLength()` method."]
68    #[doc = ""]
69    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGTextContentElement/getComputedTextLength)"]
70    #[doc = ""]
71    #[doc = "*This API requires the following crate features to be activated: `SvgTextContentElement`*"]
72    pub fn get_computed_text_length(this: &SvgTextContentElement) -> f32;
73    #[cfg(feature = "SvgPoint")]
74    #[wasm_bindgen(
75        catch,
76        method,
77        js_class = "SVGTextContentElement",
78        js_name = "getEndPositionOfChar"
79    )]
80    #[doc = "The `getEndPositionOfChar()` method."]
81    #[doc = ""]
82    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGTextContentElement/getEndPositionOfChar)"]
83    #[doc = ""]
84    #[doc = "*This API requires the following crate features to be activated: `SvgPoint`, `SvgTextContentElement`*"]
85    pub fn get_end_position_of_char(
86        this: &SvgTextContentElement,
87        charnum: u32,
88    ) -> Result<SvgPoint, JsValue>;
89    #[cfg(feature = "SvgRect")]
90    #[wasm_bindgen(
91        catch,
92        method,
93        js_class = "SVGTextContentElement",
94        js_name = "getExtentOfChar"
95    )]
96    #[doc = "The `getExtentOfChar()` method."]
97    #[doc = ""]
98    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGTextContentElement/getExtentOfChar)"]
99    #[doc = ""]
100    #[doc = "*This API requires the following crate features to be activated: `SvgRect`, `SvgTextContentElement`*"]
101    pub fn get_extent_of_char(
102        this: &SvgTextContentElement,
103        charnum: u32,
104    ) -> Result<SvgRect, JsValue>;
105    #[wasm_bindgen(
106        method,
107        js_class = "SVGTextContentElement",
108        js_name = "getNumberOfChars"
109    )]
110    #[doc = "The `getNumberOfChars()` method."]
111    #[doc = ""]
112    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGTextContentElement/getNumberOfChars)"]
113    #[doc = ""]
114    #[doc = "*This API requires the following crate features to be activated: `SvgTextContentElement`*"]
115    pub fn get_number_of_chars(this: &SvgTextContentElement) -> i32;
116    #[wasm_bindgen(
117        catch,
118        method,
119        js_class = "SVGTextContentElement",
120        js_name = "getRotationOfChar"
121    )]
122    #[doc = "The `getRotationOfChar()` method."]
123    #[doc = ""]
124    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGTextContentElement/getRotationOfChar)"]
125    #[doc = ""]
126    #[doc = "*This API requires the following crate features to be activated: `SvgTextContentElement`*"]
127    pub fn get_rotation_of_char(this: &SvgTextContentElement, charnum: u32)
128        -> Result<f32, JsValue>;
129    #[cfg(feature = "SvgPoint")]
130    #[wasm_bindgen(
131        catch,
132        method,
133        js_class = "SVGTextContentElement",
134        js_name = "getStartPositionOfChar"
135    )]
136    #[doc = "The `getStartPositionOfChar()` method."]
137    #[doc = ""]
138    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGTextContentElement/getStartPositionOfChar)"]
139    #[doc = ""]
140    #[doc = "*This API requires the following crate features to be activated: `SvgPoint`, `SvgTextContentElement`*"]
141    pub fn get_start_position_of_char(
142        this: &SvgTextContentElement,
143        charnum: u32,
144    ) -> Result<SvgPoint, JsValue>;
145    #[wasm_bindgen(
146        catch,
147        method,
148        js_class = "SVGTextContentElement",
149        js_name = "getSubStringLength"
150    )]
151    #[doc = "The `getSubStringLength()` method."]
152    #[doc = ""]
153    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGTextContentElement/getSubStringLength)"]
154    #[doc = ""]
155    #[doc = "*This API requires the following crate features to be activated: `SvgTextContentElement`*"]
156    pub fn get_sub_string_length(
157        this: &SvgTextContentElement,
158        charnum: u32,
159        nchars: u32,
160    ) -> Result<f32, JsValue>;
161    #[wasm_bindgen(
162        catch,
163        method,
164        js_class = "SVGTextContentElement",
165        js_name = "selectSubString"
166    )]
167    #[doc = "The `selectSubString()` method."]
168    #[doc = ""]
169    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGTextContentElement/selectSubString)"]
170    #[doc = ""]
171    #[doc = "*This API requires the following crate features to be activated: `SvgTextContentElement`*"]
172    pub fn select_sub_string(
173        this: &SvgTextContentElement,
174        charnum: u32,
175        nchars: u32,
176    ) -> Result<(), JsValue>;
177}
178impl SvgTextContentElement {
179    #[doc = "The `SVGTextContentElement.LENGTHADJUST_UNKNOWN` const."]
180    #[doc = ""]
181    #[doc = "*This API requires the following crate features to be activated: `SvgTextContentElement`*"]
182    pub const LENGTHADJUST_UNKNOWN: u16 = 0i64 as u16;
183    #[doc = "The `SVGTextContentElement.LENGTHADJUST_SPACING` const."]
184    #[doc = ""]
185    #[doc = "*This API requires the following crate features to be activated: `SvgTextContentElement`*"]
186    pub const LENGTHADJUST_SPACING: u16 = 1u64 as u16;
187    #[doc = "The `SVGTextContentElement.LENGTHADJUST_SPACINGANDGLYPHS` const."]
188    #[doc = ""]
189    #[doc = "*This API requires the following crate features to be activated: `SvgTextContentElement`*"]
190    pub const LENGTHADJUST_SPACINGANDGLYPHS: u16 = 2u64 as u16;
191}