2018-01-16 01:31:47 +00:00
|
|
|
// http://officeopenxml.com/drwPicInline.php
|
2022-06-26 23:26:42 +01:00
|
|
|
import { IMediaData, IMediaDataTransformation } from "@file/media";
|
|
|
|
import { XmlComponent } from "@file/xml-components";
|
2018-06-08 07:50:23 +02:00
|
|
|
import { DocProperties } from "./../doc-properties/doc-properties";
|
|
|
|
import { EffectExtent } from "./../effect-extent/effect-extent";
|
|
|
|
import { Extent } from "./../extent/extent";
|
|
|
|
import { GraphicFrameProperties } from "./../graphic-frame/graphic-frame-properties";
|
2018-06-09 23:49:01 +01:00
|
|
|
import { Graphic } from "./../inline/graphic";
|
2018-01-16 00:43:00 +00:00
|
|
|
import { InlineAttributes } from "./inline-attributes";
|
2018-01-11 01:47:09 +00:00
|
|
|
|
2021-05-26 09:28:31 +03:00
|
|
|
// <xsd:complexType name="CT_Inline">
|
|
|
|
// <xsd:sequence>
|
|
|
|
// <xsd:element name="extent" type="a:CT_PositiveSize2D"/>
|
|
|
|
// <xsd:element name="effectExtent" type="CT_EffectExtent" minOccurs="0"/>
|
|
|
|
// <xsd:element name="docPr" type="a:CT_NonVisualDrawingProps" minOccurs="1" maxOccurs="1"/>
|
|
|
|
// <xsd:element name="cNvGraphicFramePr" type="a:CT_NonVisualGraphicFrameProperties"
|
|
|
|
// minOccurs="0" maxOccurs="1"/>
|
|
|
|
// <xsd:element ref="a:graphic" minOccurs="1" maxOccurs="1"/>
|
|
|
|
// </xsd:sequence>
|
|
|
|
// <xsd:attribute name="distT" type="ST_WrapDistance" use="optional"/>
|
|
|
|
// <xsd:attribute name="distB" type="ST_WrapDistance" use="optional"/>
|
|
|
|
// <xsd:attribute name="distL" type="ST_WrapDistance" use="optional"/>
|
|
|
|
// <xsd:attribute name="distR" type="ST_WrapDistance" use="optional"/>
|
|
|
|
// </xsd:complexType>
|
2018-01-11 01:47:09 +00:00
|
|
|
export class Inline extends XmlComponent {
|
2018-08-07 01:38:15 +01:00
|
|
|
private readonly extent: Extent;
|
|
|
|
private readonly graphic: Graphic;
|
2018-03-24 19:06:10 +00:00
|
|
|
|
2022-08-31 07:52:27 +01:00
|
|
|
public constructor(mediaData: IMediaData, transform: IMediaDataTransformation) {
|
2018-01-11 01:47:09 +00:00
|
|
|
super("wp:inline");
|
|
|
|
|
2018-01-23 01:33:12 +00:00
|
|
|
this.root.push(
|
|
|
|
new InlineAttributes({
|
|
|
|
distT: 0,
|
|
|
|
distB: 0,
|
|
|
|
distL: 0,
|
|
|
|
distR: 0,
|
|
|
|
}),
|
|
|
|
);
|
2018-01-16 00:43:00 +00:00
|
|
|
|
2021-03-15 02:41:37 +00:00
|
|
|
this.extent = new Extent(transform.emus.x, transform.emus.y);
|
|
|
|
this.graphic = new Graphic(mediaData, transform);
|
2018-03-24 19:06:10 +00:00
|
|
|
|
|
|
|
this.root.push(this.extent);
|
2018-01-16 01:31:47 +00:00
|
|
|
this.root.push(new EffectExtent());
|
|
|
|
this.root.push(new DocProperties());
|
2018-01-11 01:47:09 +00:00
|
|
|
this.root.push(new GraphicFrameProperties());
|
2018-03-24 19:06:10 +00:00
|
|
|
this.root.push(this.graphic);
|
|
|
|
}
|
2018-01-11 01:47:09 +00:00
|
|
|
}
|