diff --git a/src/file/drawing/inline/graphic/graphic-data/pic/pic.ts b/src/file/drawing/inline/graphic/graphic-data/pic/pic.ts index a6f7d7f75b..e5bd2c9bd5 100644 --- a/src/file/drawing/inline/graphic/graphic-data/pic/pic.ts +++ b/src/file/drawing/inline/graphic/graphic-data/pic/pic.ts @@ -1,6 +1,8 @@ +// http://officeopenxml.com/drwPic.php import { XmlComponent } from "file/xml-components"; import { BlipFill } from "./blip/blip-fill"; import { NonVisualPicProperties } from "./non-visual-pic-properties/non-visual-pic-properties"; +import { ShapeProperties } from "./shape-properties/shape-properties"; export class Pic extends XmlComponent { @@ -9,5 +11,6 @@ export class Pic extends XmlComponent { this.root.push(new NonVisualPicProperties()); this.root.push(new BlipFill(referenceId)); + this.root.push(new ShapeProperties()); } } diff --git a/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/form/extents/extents-attributes.ts b/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/form/extents/extents-attributes.ts new file mode 100644 index 0000000000..c502231dc7 --- /dev/null +++ b/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/form/extents/extents-attributes.ts @@ -0,0 +1,13 @@ +import { XmlAttributeComponent } from "file/xml-components"; + +export interface IExtentsAttributes { + cx?: number; + cy?: number; +} + +export class ExtentsAttributes extends XmlAttributeComponent { + protected xmlKeys = { + cx: "cx", + cy: "cy", + }; +} diff --git a/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/form/extents/extents.ts b/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/form/extents/extents.ts new file mode 100644 index 0000000000..a10789f0d2 --- /dev/null +++ b/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/form/extents/extents.ts @@ -0,0 +1,15 @@ +// http://officeopenxml.com/drwSp-size.php +import { XmlComponent } from "file/xml-components"; +import { ExtentsAttributes } from "./extents-attributes"; + +export class Extents extends XmlComponent { + + constructor() { + super("a:ext"); + + this.root.push(new ExtentsAttributes({ + cx: 3162300, + cy: 2857500, + })); + } +} diff --git a/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/form/form.ts b/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/form/form.ts new file mode 100644 index 0000000000..9f74c9aa1f --- /dev/null +++ b/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/form/form.ts @@ -0,0 +1,14 @@ +// http://officeopenxml.com/drwSp-size.php +import { XmlComponent } from "file/xml-components"; +import { Extents } from "./extents/extents"; +import { Offset } from "./offset/off"; + +export class Form extends XmlComponent { + + constructor() { + super("a:xfrm"); + + this.root.push(new Extents()); + this.root.push(new Offset()); + } +} diff --git a/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/form/index.ts b/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/form/index.ts new file mode 100644 index 0000000000..c4a75a7a69 --- /dev/null +++ b/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/form/index.ts @@ -0,0 +1 @@ +export * from "./form"; diff --git a/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/form/offset/off-attributes.ts b/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/form/offset/off-attributes.ts new file mode 100644 index 0000000000..9f72211ff9 --- /dev/null +++ b/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/form/offset/off-attributes.ts @@ -0,0 +1,13 @@ +import { XmlAttributeComponent } from "file/xml-components"; + +export interface IOffsetAttributes { + x?: number; + y?: number; +} + +export class OffsetAttributes extends XmlAttributeComponent { + protected xmlKeys = { + x: "x", + y: "y", + }; +} diff --git a/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/form/offset/off.ts b/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/form/offset/off.ts new file mode 100644 index 0000000000..32c2fcca76 --- /dev/null +++ b/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/form/offset/off.ts @@ -0,0 +1,15 @@ +// http://officeopenxml.com/drwSp-size.php +import { XmlComponent } from "file/xml-components"; +import { OffsetAttributes } from "./off-attributes"; + +export class Offset extends XmlComponent { + + constructor() { + super("a:off"); + + this.root.push(new OffsetAttributes({ + x: 0, + y: 0, + })); + } +} diff --git a/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/no-fill.ts b/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/no-fill.ts new file mode 100644 index 0000000000..bbccc05664 --- /dev/null +++ b/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/no-fill.ts @@ -0,0 +1,8 @@ +import { XmlComponent } from "file/xml-components"; + +export class NoFill extends XmlComponent { + + constructor() { + super("a:noFill"); + } +} diff --git a/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/outline/no-fill.ts b/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/outline/no-fill.ts new file mode 100644 index 0000000000..bbccc05664 --- /dev/null +++ b/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/outline/no-fill.ts @@ -0,0 +1,8 @@ +import { XmlComponent } from "file/xml-components"; + +export class NoFill extends XmlComponent { + + constructor() { + super("a:noFill"); + } +} diff --git a/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/outline/outline.ts b/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/outline/outline.ts new file mode 100644 index 0000000000..5735deb3e5 --- /dev/null +++ b/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/outline/outline.ts @@ -0,0 +1,12 @@ +// http://officeopenxml.com/drwSp-outline.php +import { XmlComponent } from "file/xml-components"; +import { NoFill } from "./no-fill"; + +export class Outline extends XmlComponent { + + constructor() { + super("a:ln"); + + this.root.push(new NoFill()); + } +} diff --git a/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/preset-geometry/adjustment-values/adjustment-values.ts b/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/preset-geometry/adjustment-values/adjustment-values.ts new file mode 100644 index 0000000000..395f61f866 --- /dev/null +++ b/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/preset-geometry/adjustment-values/adjustment-values.ts @@ -0,0 +1,9 @@ +// http://officeopenxml.com/drwSp-prstGeom.php +import { XmlComponent } from "file/xml-components"; + +export class AdjustmentValues extends XmlComponent { + + constructor() { + super("a:avLst"); + } +} diff --git a/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/preset-geometry/preset-geometry-attributes.ts b/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/preset-geometry/preset-geometry-attributes.ts new file mode 100644 index 0000000000..bd1c70feaa --- /dev/null +++ b/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/preset-geometry/preset-geometry-attributes.ts @@ -0,0 +1,11 @@ +import { XmlAttributeComponent } from "file/xml-components"; + +export interface IPresetGeometryAttributes { + prst?: string; +} + +export class PresetGeometryAttributes extends XmlAttributeComponent { + protected xmlKeys = { + prst: "prst", + }; +} diff --git a/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/preset-geometry/preset-geometry.ts b/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/preset-geometry/preset-geometry.ts new file mode 100644 index 0000000000..67668bc36a --- /dev/null +++ b/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/preset-geometry/preset-geometry.ts @@ -0,0 +1,17 @@ +// http://officeopenxml.com/drwSp-prstGeom.php +import { XmlComponent } from "file/xml-components"; +import { AdjustmentValues } from "./adjustment-values/adjustment-values"; +import { PresetGeometryAttributes } from "./preset-geometry-attributes"; + +export class PresetGeometry extends XmlComponent { + + constructor() { + super("a:prstGeom"); + + this.root.push(new PresetGeometryAttributes({ + prst: "rect", + })); + + this.root.push(new AdjustmentValues()); + } +} diff --git a/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/shape-properties-attributes.ts b/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/shape-properties-attributes.ts new file mode 100644 index 0000000000..4e4761bcde --- /dev/null +++ b/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/shape-properties-attributes.ts @@ -0,0 +1,11 @@ +import { XmlAttributeComponent } from "file/xml-components"; + +export interface IShapePropertiesAttributes { + bwMode?: string; +} + +export class ShapePropertiesAttributes extends XmlAttributeComponent { + protected xmlKeys = { + bwMode: "bwMode", + }; +} diff --git a/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/shape-properties.ts b/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/shape-properties.ts new file mode 100644 index 0000000000..e5d5add2e1 --- /dev/null +++ b/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/shape-properties.ts @@ -0,0 +1,23 @@ +// http://officeopenxml.com/drwSp-SpPr.php +import { XmlComponent } from "file/xml-components"; +import { Form } from "./form"; +import { NoFill } from "./no-fill"; +import { Outline } from "./outline/outline"; +import { PresetGeometry } from "./preset-geometry/preset-geometry"; +import { ShapePropertiesAttributes } from "./shape-properties-attributes"; + +export class ShapeProperties extends XmlComponent { + + constructor() { + super("pic:spPr"); + + this.root.push(new ShapePropertiesAttributes({ + bwMode: "auto", + })); + + this.root.push(new Form()); + this.root.push(new PresetGeometry()); + this.root.push(new NoFill()); + this.root.push(new Outline()); + } +}