unioffice/schema/soo/sml/CT_RPrElt.go

305 lines
8.7 KiB
Go
Raw Permalink Normal View History

2017-08-28 20:56:18 -05:00
// Copyright 2017 Baliance. All rights reserved.
//
// 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.
2017-09-23 08:23:34 -05:00
package sml
2017-08-28 20:56:18 -05:00
import (
"encoding/xml"
"log"
)
type CT_RPrElt struct {
// Font
RFont *CT_FontName
2017-08-28 20:56:18 -05:00
// Character Set
Charset *CT_IntProperty
2017-08-28 20:56:18 -05:00
// Font Family
Family *CT_IntProperty
2017-08-28 20:56:18 -05:00
// Bold
B *CT_BooleanProperty
2017-08-28 20:56:18 -05:00
// Italic
I *CT_BooleanProperty
2017-08-28 20:56:18 -05:00
// Strike Through
Strike *CT_BooleanProperty
2017-08-28 20:56:18 -05:00
// Outline
Outline *CT_BooleanProperty
2017-08-28 20:56:18 -05:00
// Shadow
Shadow *CT_BooleanProperty
2017-08-28 20:56:18 -05:00
// Condense
Condense *CT_BooleanProperty
2017-08-28 20:56:18 -05:00
// Extend
Extend *CT_BooleanProperty
2017-08-28 20:56:18 -05:00
// Text Color
Color *CT_Color
2017-08-28 20:56:18 -05:00
// Font Size
Sz *CT_FontSize
2017-08-28 20:56:18 -05:00
// Underline
U *CT_UnderlineProperty
2017-08-28 20:56:18 -05:00
// Vertical Alignment
VertAlign *CT_VerticalAlignFontProperty
2017-08-28 20:56:18 -05:00
// Font Scheme
Scheme *CT_FontScheme
2017-08-28 20:56:18 -05:00
}
func NewCT_RPrElt() *CT_RPrElt {
ret := &CT_RPrElt{}
return ret
}
2017-08-28 20:56:18 -05:00
func (m *CT_RPrElt) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
e.EncodeToken(start)
if m.RFont != nil {
serFont := xml.StartElement{Name: xml.Name{Local: "ma:rFont"}}
2017-08-28 20:56:18 -05:00
e.EncodeElement(m.RFont, serFont)
}
if m.Charset != nil {
secharset := xml.StartElement{Name: xml.Name{Local: "ma:charset"}}
2017-08-28 20:56:18 -05:00
e.EncodeElement(m.Charset, secharset)
}
if m.Family != nil {
sefamily := xml.StartElement{Name: xml.Name{Local: "ma:family"}}
2017-08-28 20:56:18 -05:00
e.EncodeElement(m.Family, sefamily)
}
if m.B != nil {
seb := xml.StartElement{Name: xml.Name{Local: "ma:b"}}
2017-08-28 20:56:18 -05:00
e.EncodeElement(m.B, seb)
}
if m.I != nil {
sei := xml.StartElement{Name: xml.Name{Local: "ma:i"}}
2017-08-28 20:56:18 -05:00
e.EncodeElement(m.I, sei)
}
if m.Strike != nil {
sestrike := xml.StartElement{Name: xml.Name{Local: "ma:strike"}}
2017-08-28 20:56:18 -05:00
e.EncodeElement(m.Strike, sestrike)
}
if m.Outline != nil {
seoutline := xml.StartElement{Name: xml.Name{Local: "ma:outline"}}
2017-08-28 20:56:18 -05:00
e.EncodeElement(m.Outline, seoutline)
}
if m.Shadow != nil {
seshadow := xml.StartElement{Name: xml.Name{Local: "ma:shadow"}}
2017-08-28 20:56:18 -05:00
e.EncodeElement(m.Shadow, seshadow)
}
if m.Condense != nil {
secondense := xml.StartElement{Name: xml.Name{Local: "ma:condense"}}
2017-08-28 20:56:18 -05:00
e.EncodeElement(m.Condense, secondense)
}
if m.Extend != nil {
seextend := xml.StartElement{Name: xml.Name{Local: "ma:extend"}}
2017-08-28 20:56:18 -05:00
e.EncodeElement(m.Extend, seextend)
}
if m.Color != nil {
secolor := xml.StartElement{Name: xml.Name{Local: "ma:color"}}
2017-08-28 20:56:18 -05:00
e.EncodeElement(m.Color, secolor)
}
if m.Sz != nil {
sesz := xml.StartElement{Name: xml.Name{Local: "ma:sz"}}
2017-08-28 20:56:18 -05:00
e.EncodeElement(m.Sz, sesz)
}
if m.U != nil {
seu := xml.StartElement{Name: xml.Name{Local: "ma:u"}}
2017-08-28 20:56:18 -05:00
e.EncodeElement(m.U, seu)
}
if m.VertAlign != nil {
severtAlign := xml.StartElement{Name: xml.Name{Local: "ma:vertAlign"}}
2017-08-28 20:56:18 -05:00
e.EncodeElement(m.VertAlign, severtAlign)
}
if m.Scheme != nil {
sescheme := xml.StartElement{Name: xml.Name{Local: "ma:scheme"}}
2017-08-28 20:56:18 -05:00
e.EncodeElement(m.Scheme, sescheme)
}
e.EncodeToken(xml.EndElement{Name: start.Name})
return nil
}
2017-08-28 20:56:18 -05:00
func (m *CT_RPrElt) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
// initialize to default
lCT_RPrElt:
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/spreadsheetml/2006/main", Local: "rFont"}:
m.RFont = NewCT_FontName()
if err := d.DecodeElement(m.RFont, &el); err != nil {
2017-08-28 20:56:18 -05:00
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/spreadsheetml/2006/main", Local: "charset"}:
m.Charset = NewCT_IntProperty()
if err := d.DecodeElement(m.Charset, &el); err != nil {
2017-08-28 20:56:18 -05:00
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/spreadsheetml/2006/main", Local: "family"}:
m.Family = NewCT_IntProperty()
if err := d.DecodeElement(m.Family, &el); err != nil {
2017-08-28 20:56:18 -05:00
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/spreadsheetml/2006/main", Local: "b"}:
m.B = NewCT_BooleanProperty()
if err := d.DecodeElement(m.B, &el); err != nil {
2017-08-28 20:56:18 -05:00
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/spreadsheetml/2006/main", Local: "i"}:
m.I = NewCT_BooleanProperty()
if err := d.DecodeElement(m.I, &el); err != nil {
2017-08-28 20:56:18 -05:00
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/spreadsheetml/2006/main", Local: "strike"}:
m.Strike = NewCT_BooleanProperty()
if err := d.DecodeElement(m.Strike, &el); err != nil {
2017-08-28 20:56:18 -05:00
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/spreadsheetml/2006/main", Local: "outline"}:
m.Outline = NewCT_BooleanProperty()
if err := d.DecodeElement(m.Outline, &el); err != nil {
2017-08-28 20:56:18 -05:00
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/spreadsheetml/2006/main", Local: "shadow"}:
m.Shadow = NewCT_BooleanProperty()
if err := d.DecodeElement(m.Shadow, &el); err != nil {
2017-08-28 20:56:18 -05:00
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/spreadsheetml/2006/main", Local: "condense"}:
m.Condense = NewCT_BooleanProperty()
if err := d.DecodeElement(m.Condense, &el); err != nil {
2017-08-28 20:56:18 -05:00
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/spreadsheetml/2006/main", Local: "extend"}:
m.Extend = NewCT_BooleanProperty()
if err := d.DecodeElement(m.Extend, &el); err != nil {
2017-08-28 20:56:18 -05:00
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/spreadsheetml/2006/main", Local: "color"}:
m.Color = NewCT_Color()
if err := d.DecodeElement(m.Color, &el); err != nil {
2017-08-28 20:56:18 -05:00
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/spreadsheetml/2006/main", Local: "sz"}:
m.Sz = NewCT_FontSize()
if err := d.DecodeElement(m.Sz, &el); err != nil {
2017-08-28 20:56:18 -05:00
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/spreadsheetml/2006/main", Local: "u"}:
m.U = NewCT_UnderlineProperty()
if err := d.DecodeElement(m.U, &el); err != nil {
2017-08-28 20:56:18 -05:00
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/spreadsheetml/2006/main", Local: "vertAlign"}:
m.VertAlign = NewCT_VerticalAlignFontProperty()
if err := d.DecodeElement(m.VertAlign, &el); err != nil {
2017-08-28 20:56:18 -05:00
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/spreadsheetml/2006/main", Local: "scheme"}:
m.Scheme = NewCT_FontScheme()
if err := d.DecodeElement(m.Scheme, &el); err != nil {
2017-08-28 20:56:18 -05:00
return err
}
default:
log.Printf("skipping unsupported element on CT_RPrElt %v", el.Name)
2017-08-28 20:56:18 -05:00
if err := d.Skip(); err != nil {
return err
}
}
case xml.EndElement:
break lCT_RPrElt
case xml.CharData:
}
}
return nil
}
// Validate validates the CT_RPrElt and its children
2017-08-28 20:56:18 -05:00
func (m *CT_RPrElt) Validate() error {
return m.ValidateWithPath("CT_RPrElt")
}
// ValidateWithPath validates the CT_RPrElt and its children, prefixing error messages with path
2017-08-28 20:56:18 -05:00
func (m *CT_RPrElt) ValidateWithPath(path string) error {
if m.RFont != nil {
if err := m.RFont.ValidateWithPath(path + "/RFont"); err != nil {
2017-08-28 20:56:18 -05:00
return err
}
}
if m.Charset != nil {
if err := m.Charset.ValidateWithPath(path + "/Charset"); err != nil {
2017-08-28 20:56:18 -05:00
return err
}
}
if m.Family != nil {
if err := m.Family.ValidateWithPath(path + "/Family"); err != nil {
2017-08-28 20:56:18 -05:00
return err
}
}
if m.B != nil {
if err := m.B.ValidateWithPath(path + "/B"); err != nil {
2017-08-28 20:56:18 -05:00
return err
}
}
if m.I != nil {
if err := m.I.ValidateWithPath(path + "/I"); err != nil {
2017-08-28 20:56:18 -05:00
return err
}
}
if m.Strike != nil {
if err := m.Strike.ValidateWithPath(path + "/Strike"); err != nil {
2017-08-28 20:56:18 -05:00
return err
}
}
if m.Outline != nil {
if err := m.Outline.ValidateWithPath(path + "/Outline"); err != nil {
2017-08-28 20:56:18 -05:00
return err
}
}
if m.Shadow != nil {
if err := m.Shadow.ValidateWithPath(path + "/Shadow"); err != nil {
2017-08-28 20:56:18 -05:00
return err
}
}
if m.Condense != nil {
if err := m.Condense.ValidateWithPath(path + "/Condense"); err != nil {
2017-08-28 20:56:18 -05:00
return err
}
}
if m.Extend != nil {
if err := m.Extend.ValidateWithPath(path + "/Extend"); err != nil {
2017-08-28 20:56:18 -05:00
return err
}
}
if m.Color != nil {
if err := m.Color.ValidateWithPath(path + "/Color"); err != nil {
2017-08-28 20:56:18 -05:00
return err
}
}
if m.Sz != nil {
if err := m.Sz.ValidateWithPath(path + "/Sz"); err != nil {
2017-08-28 20:56:18 -05:00
return err
}
}
if m.U != nil {
if err := m.U.ValidateWithPath(path + "/U"); err != nil {
2017-08-28 20:56:18 -05:00
return err
}
}
if m.VertAlign != nil {
if err := m.VertAlign.ValidateWithPath(path + "/VertAlign"); err != nil {
2017-08-28 20:56:18 -05:00
return err
}
}
if m.Scheme != nil {
if err := m.Scheme.ValidateWithPath(path + "/Scheme"); err != nil {
2017-08-28 20:56:18 -05:00
return err
}
}
return nil
}