2021-03-15 02:41:37 +00:00
|
|
|
import { IMediaData, IMediaDataTransformation } from "file/media";
|
2018-03-24 19:06:10 +00:00
|
|
|
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
|
2018-12-21 01:39:20 +00:00
|
|
|
|
2018-03-24 19:06:10 +00:00
|
|
|
import { GraphicData } from "./graphic-data";
|
|
|
|
|
2021-03-15 00:11:39 +00:00
|
|
|
class GraphicAttributes extends XmlAttributeComponent<{
|
2018-11-02 02:51:57 +00:00
|
|
|
readonly a: string;
|
2021-03-15 00:11:39 +00:00
|
|
|
}> {
|
2018-11-02 02:51:57 +00:00
|
|
|
protected readonly xmlKeys = {
|
2018-03-24 19:06:10 +00:00
|
|
|
a: "xmlns:a",
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export class Graphic extends XmlComponent {
|
2018-08-07 01:38:15 +01:00
|
|
|
private readonly data: GraphicData;
|
2018-03-24 19:06:10 +00:00
|
|
|
|
2021-03-15 02:41:37 +00:00
|
|
|
constructor(mediaData: IMediaData, transform: IMediaDataTransformation) {
|
2018-03-24 19:06:10 +00:00
|
|
|
super("a:graphic");
|
|
|
|
this.root.push(
|
|
|
|
new GraphicAttributes({
|
|
|
|
a: "http://schemas.openxmlformats.org/drawingml/2006/main",
|
|
|
|
}),
|
|
|
|
);
|
|
|
|
|
2021-03-15 02:41:37 +00:00
|
|
|
this.data = new GraphicData(mediaData, transform);
|
2018-03-24 19:06:10 +00:00
|
|
|
|
|
|
|
this.root.push(this.data);
|
|
|
|
}
|
|
|
|
}
|