umya_spreadsheet/structs/drawing/
end_connection.rs1use super::super::super::UInt32Value;
3use crate::reader::driver::*;
4use crate::writer::driver::*;
5use quick_xml::events::BytesStart;
6use quick_xml::Reader;
7use quick_xml::Writer;
8use std::io::Cursor;
9
10#[derive(Clone, Default, Debug)]
11pub struct EndConnection {
12 id: UInt32Value,
13 index: UInt32Value,
14}
15impl EndConnection {
16 #[inline]
17 pub fn get_id(&self) -> &u32 {
18 self.id.get_value()
19 }
20
21 #[inline]
22 pub fn set_id(&mut self, value: u32) {
23 self.id.set_value(value);
24 }
25
26 #[inline]
27 pub fn get_index(&self) -> &u32 {
28 self.index.get_value()
29 }
30
31 #[inline]
32 pub fn set_index(&mut self, value: u32) {
33 self.index.set_value(value);
34 }
35
36 #[inline]
37 pub(crate) fn set_attributes<R: std::io::BufRead>(
38 &mut self,
39 _reader: &mut Reader<R>,
40 e: &BytesStart,
41 ) {
42 self.id.set_value_string(get_attribute(e, b"id").unwrap());
43 self.index
44 .set_value_string(get_attribute(e, b"idx").unwrap());
45 }
46
47 #[inline]
48 pub(crate) fn write_to(&self, writer: &mut Writer<Cursor<Vec<u8>>>) {
49 write_start_tag(
50 writer,
51 "a:endCxn",
52 vec![
53 ("id", &self.id.get_value_string()),
54 ("idx", &self.index.get_value_string()),
55 ],
56 true,
57 );
58 }
59}