shape

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 31, 2019 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CellAnchorFrom

type CellAnchorFrom struct {
	XMLName      xml.Name `xml:"xdr:from"`
	Column       int      `xml:"xdr:col"`
	ColumnOffset int      `xml:"xdr:colOff"`
	Row          int      `xml:"xdr:row"`
	RowOffset    int      `xml:"xdr:rowOff"`
}

CellAnchorFrom is an anchor struct used within oneCellAnchor or twoCellAnchor.

func NewCellAnchorFrom

func NewCellAnchorFrom(left, top int) *CellAnchorFrom

NewCellAnchorFrom creates CellAnchorFrom with left and top pixels.

type CellAnchorTo

type CellAnchorTo struct {
	XMLName      xml.Name `xml:"xdr:to"`
	Column       int      `xml:"xdr:col"`
	ColumnOffset int      `xml:"xdr:colOff"`
	Row          int      `xml:"xdr:row"`
	RowOffset    int      `xml:"xdr:rowOff"`
}

CellAnchorTo is an anchor struct used within twoCellAnchor.

func NewCellAnchorTo

func NewCellAnchorTo(left, top int) *CellAnchorTo

NewCellAnchorTo creates CellAnchorTo with left and top pixels.

type Geom

type Geom struct {
	XMLName      xml.Name `xml:"a:prstGeom"`
	Preset       string   `xml:"prst,attr"`
	AdjustValues string   `xml:"a:avLst"`
}

Geom is geometry type with preset.

type Line

type Line struct {
	// contains filtered or unexported fields
}

Line is a kind of shapes.

func NewLine

func NewLine() *Line

NewLine creates a rectangle.

func (*Line) MarshalXML

func (ln *Line) MarshalXML(e *xml.Encoder, start xml.StartElement) error

MarshalXML generates the xml element from this and puts it to the encoder.

func (*Line) SetColor

func (ln *Line) SetColor(c string)

SetColor sets the color of this.

func (*Line) SetDashType

func (ln *Line) SetDashType(t string)

SetDashType sets the type of line dash of this.

func (*Line) SetEndPos

func (ln *Line) SetEndPos(x, y int)

SetEndPos sets the position of the end of this.

func (*Line) SetHeadType

func (ln *Line) SetHeadType(t string)

SetHeadType sets the type of the head of this.

func (*Line) SetStartPos

func (ln *Line) SetStartPos(x, y int)

SetStartPos sets the position of the start of this.

func (*Line) SetTailType

func (ln *Line) SetTailType(t string)

SetTailType sets the type of the tail of this.

type LineEnd

type LineEnd struct {
	Type string `xml:"type,attr"`
}

LineEnd is a type of terminal shape of the line.

type LineProperties

type LineProperties struct {
	XMLName xml.Name    `xml:"a:ln"`
	Fill    *SolidFill  `xml:",omitempty"`
	Dash    *PresetDash `xml:",omitempty"`
	Head    *LineEnd    `xml:"a:headEnd,omitempty"`
	Tail    *LineEnd    `xml:"a:tailEnd,omitempty"`
}

LineProperties is a line property around the shape.

type NoFill

type NoFill struct {
	XMLName xml.Name `xml:"a:noFill"`
}

NoFill is nothing of fill element.

type PresetDash

type PresetDash struct {
	XMLName xml.Name `xml:"a:prstDash"`
	Value   string   `xml:"val,attr"`
}

PresetDash is a preset type for line dash.

type Rectangle

type Rectangle struct {
	// contains filtered or unexported fields
}

Rectangle is a kind of shapes.

func NewRectangle

func NewRectangle() *Rectangle

NewRectangle creates a rectangle.

func (*Rectangle) MarshalXML

func (r *Rectangle) MarshalXML(e *xml.Encoder, start xml.StartElement) error

MarshalXML generates the xml element from this and puts it to the encoder.

func (*Rectangle) SetFillColor

func (r *Rectangle) SetFillColor(c string)

SetFillColor sets the color used to fill this.

func (*Rectangle) SetFontSize

func (r *Rectangle) SetFontSize(size int)

SetFontSize sets the text font size with one-hundredth of the given numeric value.

func (*Rectangle) SetGeoType

func (r *Rectangle) SetGeoType(t string)

SetGeoType sets the type of geometory.

func (*Rectangle) SetHAlign

func (r *Rectangle) SetHAlign(align string)

SetHAlign sets the horizontal alignment of text.

If align == "l", aligns the text to the left If align == "r", aligns the text to the right If align == "ctr", centers the text

func (*Rectangle) SetLeftTop

func (r *Rectangle) SetLeftTop(l, t int)

SetLeftTop sets top and left of this.

func (*Rectangle) SetLineColor

func (r *Rectangle) SetLineColor(c string)

SetLineColor sets the color of the line around this.

func (*Rectangle) SetNoFill

func (r *Rectangle) SetNoFill(f bool)

SetNoFill sets the no-fill flag.

func (*Rectangle) SetNoLine

func (r *Rectangle) SetNoLine(f bool)

SetNoLine sets the no-line flag.

func (*Rectangle) SetSize

func (r *Rectangle) SetSize(w, h int)

SetSize sets top and left of this.

func (*Rectangle) SetText

func (r *Rectangle) SetText(t, lang string)

SetText sets inner text of this.

func (*Rectangle) SetVAlign

func (r *Rectangle) SetVAlign(align string)

SetVAlign sets the vertical alignment of text.

If align == "t", aligns the text to the top If align == "b", aligns the text to the bottom If align == "ctr", centers the text

func (*Rectangle) SetWrapType

func (r *Rectangle) SetWrapType(t string)

SetWrapType sets the type of text wrapping.

type RgbColor

type RgbColor struct {
	XMLName xml.Name `xml:"a:srgbClr"`
	Value   string   `xml:"val,attr"`
}

RgbColor is a struct to be specified a color by rgb hex values like "FFFF00".

type Shape

type Shape interface {
	MarshalXML(*xml.Encoder, xml.StartElement) error
}

Shape is a kind of Drawing Charts such as a rectangle, circle, line and so on.

type SolidFill

type SolidFill struct {
	XMLName xml.Name  `xml:"a:solidFill"`
	Color   *RgbColor `xml:",omitempty"`
}

SolidFill is a fill property of the shape.

type TextBodyProperties

type TextBodyProperties struct {
	XMLName            xml.Name  `xml:"a:bodyPr"`
	VerticalOverflow   string    `xml:"vertOverflow,attr"`
	HorizontalOverflow string    `xml:"horzOverflow,attr"`
	Wrap               string    `xml:"wrap,attr"`
	RtlCol             string    `xml:"rtlCol,attr"`
	Anchor             string    `xml:"anchor,attr"`
	AutoFit            *struct{} `xml:"a:spAutoFit,omitempty"`
}

TextBodyProperties is a set of properties of the text box.

type TextParticularProperties

type TextParticularProperties struct {
	XMLName xml.Name `xml:"a:pPr"`
	Align   string   `xml:"algn,attr"`
}

TextParticularProperties is a set of the run particular properties for the text.

type TextRunProperties

type TextRunProperties struct {
	XMLName  xml.Name `xml:"a:rPr"`
	Kumimoji string   `xml:"kumimoji,attr"`
	Lang     string   `xml:"lang,attr"`
	AltLang  string   `xml:"altLang,attr"`
	Size     string   `xml:"sz,attr"`
}

TextRunProperties is a set of the run level properties for the text.

type XForm added in v0.0.2

type XForm struct {
	XMLName xml.Name `xml:"a:xfrm"`
	FlipH   string   `xml:"flipH,attr,omitempty"`
	FlipV   string   `xml:"flipV,attr,omitempty"`
}

XForm specifies the transform to be applied to the corresponding graphic frame

type XdrNonVisualProperties

type XdrNonVisualProperties struct {
	XMLName xml.Name `xml:"xdr:cNvPr"`
	ID      string   `xml:"id,attr"`
	Name    string   `xml:"name,attr"`
}

XdrNonVisualProperties is struct.

type XdrNonVisualShapeProperties

type XdrNonVisualShapeProperties struct {
	XMLName         xml.Name                `xml:"xdr:nvSpPr"`
	Properties      *XdrNonVisualProperties `xml:",omitempty"`
	ShapeProperties string                  `xml:"xdr:cNvSpPr"`
}

XdrNonVisualShapeProperties is struct.

type XdrShape

type XdrShape struct {
	XMLName      xml.Name                     `xml:"xdr:sp"`
	NvProperties *XdrNonVisualShapeProperties `xml:",omitempty"`
	Properties   *XdrShapeProperties          `xml:",omitempty"`
	TextBody     *XdrTextBody                 `xml:",omitempty"`
}

XdrShape is struct.

type XdrShapeProperties

type XdrShapeProperties struct {
	XMLName    xml.Name        `xml:"xdr:spPr"`
	XForm      *XForm          `xml:",omitempty"`
	PresetGeom *Geom           `xml:",omitempty"`
	Fill       *SolidFill      `xml:",omitempty"`
	NoFill     *NoFill         `xml:",omitempty"`
	Line       *LineProperties `xml:",omitempty"`
}

XdrShapeProperties is struct.

type XdrTextBody

type XdrTextBody struct {
	XMLName     xml.Name                  `xml:"xdr:txBody"`
	Properties  *TextBodyProperties       `xml:",omitempty"`
	ListStyle   string                    `xml:"a:lstStyle"`
	PProperties *TextParticularProperties `xml:"a:p>a:pPr"`
	RProperties *TextRunProperties        `xml:"a:p>a:r>a:rPr"`
	Text        string                    `xml:"a:p>a:r>a:t"`
}

XdrTextBody is struct.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL