unioffice/schema/soo/dml/chart/ChartSpace.go

161 lines
6.7 KiB
Go
Raw Normal View History

// Copyright 2020 FoxyUtils ehf. All rights reserved.
2017-08-28 20:56:18 -05:00
//
// DO NOT EDIT: generated by unioffice ECMA-376 generator
//
// Use of this software package and source code is governed by the terms of the
// UniDoc End User License Agreement (EULA) that is available at:
// https://unidoc.io/eula/
// A trial license code for evaluation can be obtained at https://unidoc.io website.
2017-08-28 20:56:18 -05:00
package chart
import (
"encoding/xml"
"github.com/unidoc/unioffice"
"github.com/unidoc/unioffice/schema/soo/dml"
2017-08-28 20:56:18 -05:00
)
type ChartSpace struct {
CT_ChartSpace
}
func NewChartSpace() *ChartSpace {
ret := &ChartSpace{}
ret.CT_ChartSpace = *NewCT_ChartSpace()
return ret
}
2017-08-28 20:56:18 -05:00
func (m *ChartSpace) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/chart"})
start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:a"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/main"})
2017-08-28 20:56:18 -05:00
start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:c"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/chart"})
start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:r"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/relationships"})
start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:s"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/sharedTypes"})
2017-08-28 20:56:18 -05:00
start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:xml"}, Value: "http://www.w3.org/XML/1998/namespace"})
2017-09-03 09:29:13 -05:00
start.Name.Local = "c:chartSpace"
2017-08-28 20:56:18 -05:00
return m.CT_ChartSpace.MarshalXML(e, start)
}
2017-08-28 20:56:18 -05:00
func (m *ChartSpace) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
// initialize to default
m.CT_ChartSpace = *NewCT_ChartSpace()
lChartSpace:
for {
tok, err := d.Token()
if err != nil {
return err
}
switch el := tok.(type) {
case xml.StartElement:
switch el.Name {
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "date1904"},
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "date1904"}:
2017-08-28 20:56:18 -05:00
m.Date1904 = NewCT_Boolean()
if err := d.DecodeElement(m.Date1904, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "lang"},
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "lang"}:
2017-08-28 20:56:18 -05:00
m.Lang = NewCT_TextLanguageID()
if err := d.DecodeElement(m.Lang, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "roundedCorners"},
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "roundedCorners"}:
2017-08-28 20:56:18 -05:00
m.RoundedCorners = NewCT_Boolean()
if err := d.DecodeElement(m.RoundedCorners, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "style"},
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "style"}:
2017-08-28 20:56:18 -05:00
m.Style = NewCT_Style()
if err := d.DecodeElement(m.Style, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "clrMapOvr"},
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "clrMapOvr"}:
2017-09-23 08:39:08 -05:00
m.ClrMapOvr = dml.NewCT_ColorMapping()
2017-08-28 20:56:18 -05:00
if err := d.DecodeElement(m.ClrMapOvr, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "pivotSource"},
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "pivotSource"}:
2017-08-28 20:56:18 -05:00
m.PivotSource = NewCT_PivotSource()
if err := d.DecodeElement(m.PivotSource, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "protection"},
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "protection"}:
2017-08-28 20:56:18 -05:00
m.Protection = NewCT_Protection()
if err := d.DecodeElement(m.Protection, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "chart"},
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "chart"}:
2017-08-28 20:56:18 -05:00
if err := d.DecodeElement(m.Chart, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "spPr"},
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "spPr"}:
2017-09-23 08:39:08 -05:00
m.SpPr = dml.NewCT_ShapeProperties()
2017-08-28 20:56:18 -05:00
if err := d.DecodeElement(m.SpPr, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "txPr"},
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "txPr"}:
2017-09-23 08:39:08 -05:00
m.TxPr = dml.NewCT_TextBody()
2017-08-28 20:56:18 -05:00
if err := d.DecodeElement(m.TxPr, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "externalData"},
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "externalData"}:
2017-08-28 20:56:18 -05:00
m.ExternalData = NewCT_ExternalData()
if err := d.DecodeElement(m.ExternalData, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "printSettings"},
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "printSettings"}:
2017-08-28 20:56:18 -05:00
m.PrintSettings = NewCT_PrintSettings()
if err := d.DecodeElement(m.PrintSettings, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "userShapes"},
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "userShapes"}:
2017-08-28 20:56:18 -05:00
m.UserShapes = NewCT_RelId()
if err := d.DecodeElement(m.UserShapes, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "extLst"},
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "extLst"}:
2017-08-28 20:56:18 -05:00
m.ExtLst = NewCT_ExtensionList()
if err := d.DecodeElement(m.ExtLst, &el); err != nil {
return err
}
default:
unioffice.Log("skipping unsupported element on ChartSpace %v", el.Name)
2017-08-28 20:56:18 -05:00
if err := d.Skip(); err != nil {
return err
}
}
case xml.EndElement:
break lChartSpace
case xml.CharData:
}
}
return nil
}
// Validate validates the ChartSpace and its children
2017-08-28 20:56:18 -05:00
func (m *ChartSpace) Validate() error {
return m.ValidateWithPath("ChartSpace")
}
// ValidateWithPath validates the ChartSpace and its children, prefixing error messages with path
2017-08-28 20:56:18 -05:00
func (m *ChartSpace) ValidateWithPath(path string) error {
if err := m.CT_ChartSpace.ValidateWithPath(path); err != nil {
return err
}
return nil
}