Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional O19 types to match Open Specifications #916

Merged
merged 9 commits into from
Apr 16, 2021
Merged
7 changes: 7 additions & 0 deletions src/DocumentFormat.OpenXml/Framework/OpenXmlNamespace.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,8 @@ private static string NormalizeNamespace(in OpenXmlNamespace ns)

// O19
{ "http://schemas.microsoft.com/office/powerpoint/2017/3/main", "p173", FileFormatVersions.Office2019 },
{ "http://schemas.microsoft.com/office/powerpoint/2017/10/main", "p1710", FileFormatVersions.Office2019 },
{ "http://schemas.microsoft.com/office/powerpoint/2018/4/main", "p184", FileFormatVersions.Office2019 },
{ "http://schemas.microsoft.com/office/spreadsheetml/2016/pivotdefaultlayout", "xpdl", FileFormatVersions.Office2019 },
{ "http://schemas.microsoft.com/office/spreadsheetml/2016/01/main", "xlPr", FileFormatVersions.Office2019 },
{ "http://schemas.microsoft.com/office/spreadsheetml/2015/revision2", "xr2", FileFormatVersions.Office2019 },
Expand All @@ -257,9 +259,14 @@ private static string NormalizeNamespace(in OpenXmlNamespace ns)
{ "http://schemas.microsoft.com/office/spreadsheetml/2018/threadedcomments", "xltc", FileFormatVersions.Office2019 },
{ "http://schemas.microsoft.com/office/drawing/2017/03/chart", "c16r3", FileFormatVersions.Office2019 },
{ "http://schemas.microsoft.com/office/spreadsheetml/2017/dynamicarray", "xda", FileFormatVersions.Office2019 },
{ "http://schemas.microsoft.com/office/drawing/2016/11/main", "a1611", FileFormatVersions.Office2019 },
{ "http://schemas.microsoft.com/office/drawing/2016/11/diagram", "dgm1611", FileFormatVersions.Office2019 },
{ "http://schemas.microsoft.com/office/drawing/2016/12/diagram", "dgm1612", FileFormatVersions.Office2019 },
{ "http://schemas.microsoft.com/office/drawing/2016/ink", "aink", FileFormatVersions.Office2019 },
{ "http://schemas.microsoft.com/office/drawing/2017/model3d", "am3d", FileFormatVersions.Office2019 },
{ "http://schemas.microsoft.com/office/drawing/2017/decorative", "adec", FileFormatVersions.Office2019 },
{ "http://schemas.microsoft.com/office/drawing/2018/animation", "aanim", FileFormatVersions.Office2019 },
{ "http://schemas.microsoft.com/office/drawing/2018/animation/model3d", "a3danim", FileFormatVersions.Office2019 },
{ "http://schemas.microsoft.com/office/drawing/2018/hyperlinkcolor", "ahyp", FileFormatVersions.Office2019 },
{ "http://schemas.microsoft.com/office/word/2016/wordml/cid", "w16cid", FileFormatVersions.Office2019 },
{ "http://schemas.microsoft.com/office/drawing/2016/SVG/main", "asvg", FileFormatVersions.Office2019 },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace DocumentFormat.OpenXml.Office2019.Drawing.Diagram11
/// </list>
/// </remark>
#pragma warning disable CS0618 // Type or member is obsolete
[SchemaAttr(103, "autoBuNodeInfoLst")]
[SchemaAttr(106, "autoBuNodeInfoLst")]
#pragma warning restore CS0618 // Type or member is obsolete
public partial class NumberDiagramInfoList : OpenXmlCompositeElement
{
Expand Down Expand Up @@ -66,7 +66,7 @@ public NumberDiagramInfoList(string outerXml) : base(outerXml)
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema(103, "autoBuNodeInfoLst");
builder.SetSchema(106, "autoBuNodeInfoLst");
builder.Availability = FileFormatVersions.Office2019;
builder.AddChild<NumberDiagramInfo>();
builder.Particle = new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
Expand Down Expand Up @@ -94,7 +94,7 @@ internal override void ConfigureMetadata(ElementMetadata.Builder builder)
/// </list>
/// </remark>
#pragma warning disable CS0618 // Type or member is obsolete
[SchemaAttr(103, "buPr")]
[SchemaAttr(106, "buPr")]
#pragma warning restore CS0618 // Type or member is obsolete
public partial class DiagramAutoBullet : OpenXmlCompositeElement
{
Expand Down Expand Up @@ -164,7 +164,7 @@ public BooleanValue? LeadZeros
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema(103, "buPr");
builder.SetSchema(106, "buPr");
builder.Availability = FileFormatVersions.Office2019;
builder.AddChild<DocumentFormat.OpenXml.Drawing.NoBullet>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.AutoNumberedBullet>();
Expand Down Expand Up @@ -253,7 +253,7 @@ public DocumentFormat.OpenXml.Drawing.PictureBullet? PictureBullet
/// </list>
/// </remark>
#pragma warning disable CS0618 // Type or member is obsolete
[SchemaAttr(103, "autoBuNodeInfo")]
[SchemaAttr(106, "autoBuNodeInfo")]
#pragma warning restore CS0618 // Type or member is obsolete
public partial class NumberDiagramInfo : OpenXmlCompositeElement
{
Expand Down Expand Up @@ -323,7 +323,7 @@ public EnumValue<DocumentFormat.OpenXml.Office2019.Drawing.Diagram11.STorageType
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema(103, "autoBuNodeInfo");
builder.SetSchema(106, "autoBuNodeInfo");
builder.Availability = FileFormatVersions.Office2019;
builder.AddChild<DiagramAutoBullet>();
builder.AddElement<NumberDiagramInfo>()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

#nullable enable

using DocumentFormat.OpenXml;
using DocumentFormat.OpenXml.Framework;
using DocumentFormat.OpenXml.Framework.Metadata;
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Validation.Schema;
using System;
using System.Collections.Generic;
using System.IO.Packaging;

namespace DocumentFormat.OpenXml.Office2019.Drawing
{
/// <summary>
/// <para>Defines the PictureAttributionSourceURL Class.</para>
/// <para>This class is available in Office 2019 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is a1611:picAttrSrcUrl.</para>
/// </summary>
#pragma warning disable CS0618 // Type or member is obsolete
[SchemaAttr(105, "picAttrSrcUrl")]
#pragma warning restore CS0618 // Type or member is obsolete
public partial class PictureAttributionSourceURL : OpenXmlLeafElement
{
/// <summary>
/// Initializes a new instance of the PictureAttributionSourceURL class.
/// </summary>
public PictureAttributionSourceURL() : base()
{
}

/// <summary>
/// <para>id, this property is only available in Office 2019 and later.</para>
/// <para>Represents the following attribute in the schema: r:id</para>
/// </summary>
/// <remark>
/// xmlns:r=http://schemas.openxmlformats.org/officeDocument/2006/relationships
/// </remark>

#pragma warning disable CS0618 // Type or member is obsolete

[SchemaAttr(19, "id")]
#pragma warning restore CS0618 // Type or member is obsolete

public StringValue? Id
{
get => GetAttribute<StringValue>();
set => SetAttribute(value);
}

internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema(105, "picAttrSrcUrl");
builder.Availability = FileFormatVersions.Office2019;
builder.AddElement<PictureAttributionSourceURL>()
.AddAttribute(19, "id", a => a.Id, aBuilder =>
{
aBuilder.AddValidator(RequiredValidator.Instance);
});
}

/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<PictureAttributionSourceURL>(deep);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace DocumentFormat.OpenXml.Office2019.Drawing.Diagram12
/// </list>
/// </remark>
#pragma warning disable CS0618 // Type or member is obsolete
[SchemaAttr(104, "spPr")]
[SchemaAttr(107, "spPr")]
#pragma warning restore CS0618 // Type or member is obsolete
public partial class ShapeProperties : OpenXmlCompositeElement
{
Expand Down Expand Up @@ -95,7 +95,7 @@ public EnumValue<DocumentFormat.OpenXml.Drawing.BlackWhiteModeValues>? BlackWhit
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema(104, "spPr");
builder.SetSchema(107, "spPr");
builder.Availability = FileFormatVersions.Office2019;
builder.AddChild<DocumentFormat.OpenXml.Drawing.Transform2D>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.CustomGeometry>();
Expand Down Expand Up @@ -194,7 +194,7 @@ public DocumentFormat.OpenXml.Drawing.Transform2D? Transform2D
/// </list>
/// </remark>
#pragma warning disable CS0618 // Type or member is obsolete
[SchemaAttr(104, "lstStyle")]
[SchemaAttr(107, "lstStyle")]
#pragma warning restore CS0618 // Type or member is obsolete
public partial class TextListStyleType : OpenXmlCompositeElement
{
Expand Down Expand Up @@ -232,7 +232,7 @@ public TextListStyleType(string outerXml) : base(outerXml)
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema(104, "lstStyle");
builder.SetSchema(107, "lstStyle");
builder.Availability = FileFormatVersions.Office2019;
builder.AddChild<DocumentFormat.OpenXml.Drawing.DefaultParagraphProperties>();
builder.AddChild<DocumentFormat.OpenXml.Drawing.Level1ParagraphProperties>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace DocumentFormat.OpenXml.Office2019.Drawing.SVG
/// <para>When the object is serialized out as xml, it's qualified name is asvg:svgBlip.</para>
/// </summary>
#pragma warning disable CS0618 // Type or member is obsolete
[SchemaAttr(108, "svgBlip")]
[SchemaAttr(115, "svgBlip")]
#pragma warning restore CS0618 // Type or member is obsolete
public partial class SVGBlip : OpenXmlLeafElement
{
Expand Down Expand Up @@ -73,7 +73,7 @@ public StringValue? Link
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema(108, "svgBlip");
builder.SetSchema(115, "svgBlip");
builder.Availability = FileFormatVersions.Office2019;
builder.AddElement<SVGBlip>()
.AddAttribute(19, "embed", a => a.Embed)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace DocumentFormat.OpenXml.Office2019.Drawing.Chart
/// </list>
/// </remark>
#pragma warning disable CS0618 // Type or member is obsolete
[SchemaAttr(101, "dataDisplayOptions16")]
[SchemaAttr(103, "dataDisplayOptions16")]
#pragma warning restore CS0618 // Type or member is obsolete
public partial class DataDisplayOptions16 : OpenXmlCompositeElement
{
Expand Down Expand Up @@ -65,7 +65,7 @@ public DataDisplayOptions16(string outerXml) : base(outerXml)
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema(101, "dataDisplayOptions16");
builder.SetSchema(103, "dataDisplayOptions16");
builder.Availability = FileFormatVersions.Office2019;
builder.AddChild<BooleanFalse>();
builder.Particle = new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
Expand Down Expand Up @@ -97,7 +97,7 @@ public BooleanFalse? BooleanFalse
/// <para>When the object is serialized out as xml, it's qualified name is c16r3:dispNaAsBlank.</para>
/// </summary>
#pragma warning disable CS0618 // Type or member is obsolete
[SchemaAttr(101, "dispNaAsBlank")]
[SchemaAttr(103, "dispNaAsBlank")]
#pragma warning restore CS0618 // Type or member is obsolete
public partial class BooleanFalse : OpenXmlLeafElement
{
Expand All @@ -118,7 +118,7 @@ public BooleanFalse() : base()

#pragma warning disable CS0618 // Type or member is obsolete

[SchemaAttr(101, "val")]
[SchemaAttr(103, "val")]
#pragma warning restore CS0618 // Type or member is obsolete

public BooleanValue? Val
Expand All @@ -130,10 +130,10 @@ public BooleanValue? Val
internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema(101, "dispNaAsBlank");
builder.SetSchema(103, "dispNaAsBlank");
builder.Availability = FileFormatVersions.Office2019;
builder.AddElement<BooleanFalse>()
.AddAttribute(101, "val", a => a.Val, aBuilder =>
.AddAttribute(103, "val", a => a.Val, aBuilder =>
{
aBuilder.AddValidator(new OfficeVersionValidator(FileFormatVersions.Office2019));
});
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

#nullable enable

using DocumentFormat.OpenXml;
using DocumentFormat.OpenXml.Drawing;
using DocumentFormat.OpenXml.Framework;
using DocumentFormat.OpenXml.Framework.Metadata;
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Validation.Schema;
using System;
using System.Collections.Generic;
using System.IO.Packaging;

namespace DocumentFormat.OpenXml.Office2019.Drawing
{
/// <summary>
/// <para>Defines the Decorative Class.</para>
/// <para>This class is available in Office 2019 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is adec:decorative.</para>
/// </summary>
#pragma warning disable CS0618 // Type or member is obsolete
[SchemaAttr(110, "decorative")]
#pragma warning restore CS0618 // Type or member is obsolete
public partial class Decorative : OpenXmlLeafElement
{
/// <summary>
/// Initializes a new instance of the Decorative class.
/// </summary>
public Decorative() : base()
{
}

/// <summary>
/// <para>val, this property is only available in Office 2019 and later.</para>
/// <para>Represents the following attribute in the schema: val</para>
/// </summary>

#pragma warning disable CS0618 // Type or member is obsolete

[SchemaAttr(0, "val")]
#pragma warning restore CS0618 // Type or member is obsolete

public BooleanValue? Val
{
get => GetAttribute<BooleanValue>();
set => SetAttribute(value);
}

internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema(110, "decorative");
builder.Availability = FileFormatVersions.Office2019;
builder.AddElement<Decorative>()
.AddAttribute(0, "val", a => a.Val);
}

/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<Decorative>(deep);
}
}
Loading