Add more graphic files

This commit is contained in:
Dolan
2018-01-12 00:12:39 +00:00
parent ca244bcfe1
commit 392db1cd11
15 changed files with 173 additions and 0 deletions

View File

@ -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());
}
}

View File

@ -0,0 +1,13 @@
import { XmlAttributeComponent } from "file/xml-components";
export interface IExtentsAttributes {
cx?: number;
cy?: number;
}
export class ExtentsAttributes extends XmlAttributeComponent<IExtentsAttributes> {
protected xmlKeys = {
cx: "cx",
cy: "cy",
};
}

View File

@ -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,
}));
}
}

View File

@ -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());
}
}

View File

@ -0,0 +1 @@
export * from "./form";

View File

@ -0,0 +1,13 @@
import { XmlAttributeComponent } from "file/xml-components";
export interface IOffsetAttributes {
x?: number;
y?: number;
}
export class OffsetAttributes extends XmlAttributeComponent<IOffsetAttributes> {
protected xmlKeys = {
x: "x",
y: "y",
};
}

View File

@ -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,
}));
}
}

View File

@ -0,0 +1,8 @@
import { XmlComponent } from "file/xml-components";
export class NoFill extends XmlComponent {
constructor() {
super("a:noFill");
}
}

View File

@ -0,0 +1,8 @@
import { XmlComponent } from "file/xml-components";
export class NoFill extends XmlComponent {
constructor() {
super("a:noFill");
}
}

View File

@ -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());
}
}

View File

@ -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");
}
}

View File

@ -0,0 +1,11 @@
import { XmlAttributeComponent } from "file/xml-components";
export interface IPresetGeometryAttributes {
prst?: string;
}
export class PresetGeometryAttributes extends XmlAttributeComponent<IPresetGeometryAttributes> {
protected xmlKeys = {
prst: "prst",
};
}

View File

@ -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());
}
}

View File

@ -0,0 +1,11 @@
import { XmlAttributeComponent } from "file/xml-components";
export interface IShapePropertiesAttributes {
bwMode?: string;
}
export class ShapePropertiesAttributes extends XmlAttributeComponent<IShapePropertiesAttributes> {
protected xmlKeys = {
bwMode: "bwMode",
};
}

View File

@ -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());
}
}