2017-08-28 20:56:18 -05:00
|
|
|
// Copyright 2017 Baliance. All rights reserved.
|
|
|
|
//
|
2017-09-09 10:21:47 -05:00
|
|
|
// DO NOT EDIT: generated by gooxml ECMA-376 generator
|
|
|
|
//
|
2017-08-28 20:56:18 -05:00
|
|
|
// Use of this source code is governed by the terms of the Affero GNU General
|
|
|
|
// Public License version 3.0 as published by the Free Software Foundation and
|
|
|
|
// appearing in the file LICENSE included in the packaging of this file. A
|
|
|
|
// commercial license can be purchased by contacting sales@baliance.com.
|
|
|
|
|
|
|
|
package chart
|
|
|
|
|
|
|
|
import (
|
|
|
|
"encoding/xml"
|
2017-09-29 20:52:19 -05:00
|
|
|
|
|
|
|
"baliance.com/gooxml"
|
2017-08-28 20:56:18 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
type CT_PictureOptions struct {
|
|
|
|
ApplyToFront *CT_Boolean
|
|
|
|
ApplyToSides *CT_Boolean
|
|
|
|
ApplyToEnd *CT_Boolean
|
|
|
|
PictureFormat *CT_PictureFormat
|
|
|
|
PictureStackUnit *CT_PictureStackUnit
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewCT_PictureOptions() *CT_PictureOptions {
|
|
|
|
ret := &CT_PictureOptions{}
|
|
|
|
return ret
|
|
|
|
}
|
2017-09-01 15:19:23 -05:00
|
|
|
|
2017-08-28 20:56:18 -05:00
|
|
|
func (m *CT_PictureOptions) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
|
|
|
|
e.EncodeToken(start)
|
|
|
|
if m.ApplyToFront != nil {
|
2017-09-03 09:29:13 -05:00
|
|
|
seapplyToFront := xml.StartElement{Name: xml.Name{Local: "c:applyToFront"}}
|
2017-08-28 20:56:18 -05:00
|
|
|
e.EncodeElement(m.ApplyToFront, seapplyToFront)
|
|
|
|
}
|
|
|
|
if m.ApplyToSides != nil {
|
2017-09-03 09:29:13 -05:00
|
|
|
seapplyToSides := xml.StartElement{Name: xml.Name{Local: "c:applyToSides"}}
|
2017-08-28 20:56:18 -05:00
|
|
|
e.EncodeElement(m.ApplyToSides, seapplyToSides)
|
|
|
|
}
|
|
|
|
if m.ApplyToEnd != nil {
|
2017-09-03 09:29:13 -05:00
|
|
|
seapplyToEnd := xml.StartElement{Name: xml.Name{Local: "c:applyToEnd"}}
|
2017-08-28 20:56:18 -05:00
|
|
|
e.EncodeElement(m.ApplyToEnd, seapplyToEnd)
|
|
|
|
}
|
|
|
|
if m.PictureFormat != nil {
|
2017-09-03 09:29:13 -05:00
|
|
|
sepictureFormat := xml.StartElement{Name: xml.Name{Local: "c:pictureFormat"}}
|
2017-08-28 20:56:18 -05:00
|
|
|
e.EncodeElement(m.PictureFormat, sepictureFormat)
|
|
|
|
}
|
|
|
|
if m.PictureStackUnit != nil {
|
2017-09-03 09:29:13 -05:00
|
|
|
sepictureStackUnit := xml.StartElement{Name: xml.Name{Local: "c:pictureStackUnit"}}
|
2017-08-28 20:56:18 -05:00
|
|
|
e.EncodeElement(m.PictureStackUnit, sepictureStackUnit)
|
|
|
|
}
|
|
|
|
e.EncodeToken(xml.EndElement{Name: start.Name})
|
|
|
|
return nil
|
|
|
|
}
|
2017-09-01 15:19:23 -05:00
|
|
|
|
2017-08-28 20:56:18 -05:00
|
|
|
func (m *CT_PictureOptions) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
|
|
|
|
// initialize to default
|
|
|
|
lCT_PictureOptions:
|
|
|
|
for {
|
|
|
|
tok, err := d.Token()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
switch el := tok.(type) {
|
|
|
|
case xml.StartElement:
|
2017-09-10 10:02:39 -05:00
|
|
|
switch el.Name {
|
2019-04-29 18:32:26 +03:00
|
|
|
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "applyToFront"},
|
|
|
|
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "applyToFront"}:
|
2017-08-28 20:56:18 -05:00
|
|
|
m.ApplyToFront = NewCT_Boolean()
|
|
|
|
if err := d.DecodeElement(m.ApplyToFront, &el); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2019-04-29 18:32:26 +03:00
|
|
|
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "applyToSides"},
|
|
|
|
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "applyToSides"}:
|
2017-08-28 20:56:18 -05:00
|
|
|
m.ApplyToSides = NewCT_Boolean()
|
|
|
|
if err := d.DecodeElement(m.ApplyToSides, &el); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2019-04-29 18:32:26 +03:00
|
|
|
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "applyToEnd"},
|
|
|
|
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "applyToEnd"}:
|
2017-08-28 20:56:18 -05:00
|
|
|
m.ApplyToEnd = NewCT_Boolean()
|
|
|
|
if err := d.DecodeElement(m.ApplyToEnd, &el); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2019-04-29 18:32:26 +03:00
|
|
|
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "pictureFormat"},
|
|
|
|
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "pictureFormat"}:
|
2017-08-28 20:56:18 -05:00
|
|
|
m.PictureFormat = NewCT_PictureFormat()
|
|
|
|
if err := d.DecodeElement(m.PictureFormat, &el); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2019-04-29 18:32:26 +03:00
|
|
|
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "pictureStackUnit"},
|
|
|
|
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "pictureStackUnit"}:
|
2017-08-28 20:56:18 -05:00
|
|
|
m.PictureStackUnit = NewCT_PictureStackUnit()
|
|
|
|
if err := d.DecodeElement(m.PictureStackUnit, &el); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
default:
|
2017-09-29 20:52:19 -05:00
|
|
|
gooxml.Log("skipping unsupported element on CT_PictureOptions %v", el.Name)
|
2017-08-28 20:56:18 -05:00
|
|
|
if err := d.Skip(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case xml.EndElement:
|
|
|
|
break lCT_PictureOptions
|
|
|
|
case xml.CharData:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
2017-09-01 15:19:23 -05:00
|
|
|
|
|
|
|
// Validate validates the CT_PictureOptions and its children
|
2017-08-28 20:56:18 -05:00
|
|
|
func (m *CT_PictureOptions) Validate() error {
|
|
|
|
return m.ValidateWithPath("CT_PictureOptions")
|
|
|
|
}
|
2017-09-01 15:19:23 -05:00
|
|
|
|
|
|
|
// ValidateWithPath validates the CT_PictureOptions and its children, prefixing error messages with path
|
2017-08-28 20:56:18 -05:00
|
|
|
func (m *CT_PictureOptions) ValidateWithPath(path string) error {
|
|
|
|
if m.ApplyToFront != nil {
|
|
|
|
if err := m.ApplyToFront.ValidateWithPath(path + "/ApplyToFront"); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if m.ApplyToSides != nil {
|
|
|
|
if err := m.ApplyToSides.ValidateWithPath(path + "/ApplyToSides"); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if m.ApplyToEnd != nil {
|
|
|
|
if err := m.ApplyToEnd.ValidateWithPath(path + "/ApplyToEnd"); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if m.PictureFormat != nil {
|
|
|
|
if err := m.PictureFormat.ValidateWithPath(path + "/PictureFormat"); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if m.PictureStackUnit != nil {
|
|
|
|
if err := m.PictureStackUnit.ValidateWithPath(path + "/PictureStackUnit"); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|