primitives

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ToHAlignType   map[string]HAlignType
	FromHAlignType map[HAlignType]string
)

HAlignType maps for marshal/unmarshal process

View Source
var (
	ToVAlignType   map[string]VAlignType
	FromVAlignType map[VAlignType]string
)

VAlignType maps for marshal/unmarshal process

View Source
var (
	ToBorderStyleType   map[string]BorderStyleType
	FromBorderStyleType map[BorderStyleType]string
)

BorderStyleType maps for marshal/unmarshal process

View Source
var (
	ToCellType   map[string]CellType
	FromCellType map[CellType]string
)

nolint

View Source
var (
	ToConditionOperatorType   map[string]ConditionOperatorType
	FromConditionOperatorType map[ConditionOperatorType]string
)

ConditionOperatorType maps for marshal/unmarshal process

View Source
var (
	ToConditionValueType   map[string]ConditionValueType
	FromConditionValueType map[ConditionValueType]string
)

ConditionType maps for marshal/unmarshal process

View Source
var (
	ToGradientType   map[string]GradientType
	FromGradientType map[GradientType]string
)

GradientType maps for marshal/unmarshal process

View Source
var (
	ToIconSetType   map[string]IconSetType
	FromIconSetType map[IconSetType]string
)

IconSetType maps for marshal/unmarshal process

View Source
var (
	ToPatternType   map[string]PatternType
	FromPatternType map[PatternType]string
)

PatternType maps for marshal/unmarshal process

View Source
var (
	ToVisibilityType   map[string]VisibilityType
	FromVisibilityType map[VisibilityType]string
)

nolint

Functions

func OptionalBool

func OptionalBool(v bool) *bool

OptionalBool is helper function that allow encode/decode optional boolean, where false should not be omitted - mostly for booleans with default true value

func OptionalIndex

func OptionalIndex(v int) ml.OptionalIndex

OptionalIndex is helper alias for ml.OptionalIndex from core package

Types

type BorderStyleType

type BorderStyleType byte

BorderStyleType is a type to encode XSD BorderStyleType

func (*BorderStyleType) MarshalXMLAttr

func (t *BorderStyleType) MarshalXMLAttr(name xml.Name) (xml.Attr, error)

MarshalXMLAttr marshal BorderStyleType

func (BorderStyleType) String

func (t BorderStyleType) String() string

func (*BorderStyleType) UnmarshalXMLAttr

func (t *BorderStyleType) UnmarshalXMLAttr(attr xml.Attr) error

UnmarshalXMLAttr unmarshal BorderStyleType

type Bounds

type Bounds struct {
	FromCol int
	FromRow int
	ToCol   int
	ToRow   int
	// contains filtered or unexported fields
}

Bounds is implementation of Ref

func BoundsFromIndexes

func BoundsFromIndexes(fromCol, fromRow, toCol, toRow int) Bounds

BoundsFromIndexes returns a Bounds information for provided 0-based indexes

func (*Bounds) Contains

func (b *Bounds) Contains(cIdx, rIdx int) bool

Contains checks if indexes cIdx and rIdx are inside of bounds

func (*Bounds) ContainsRef

func (b *Bounds) ContainsRef(celRef CellRef) bool

ContainsRef checks if celRef is inside of bounds

func (*Bounds) Dimension

func (b *Bounds) Dimension() (width int, height int)

Dimension returns total number of cols and rows in bounds

func (*Bounds) Equals

func (b *Bounds) Equals(a Bounds) bool

Equals checks if bounds is same as other bounds

func (Bounds) Hash

func (b Bounds) Hash() index.Code

Hash builds hash code for all required values of Bounds to use as unique index

func (Bounds) IsEmpty

func (b Bounds) IsEmpty() bool

IsEmpty return true if type was not initialized

func (Bounds) MarshalXMLAttr

func (b Bounds) MarshalXMLAttr(name xml.Name) (xml.Attr, error)

MarshalXMLAttr marshal Bounds

func (*Bounds) Overlaps

func (b *Bounds) Overlaps(a Bounds) bool

Overlaps checks if bounds intersects with another bounds

func (Bounds) String

func (b Bounds) String() string

String return textual version of bounds

func (*Bounds) ToRef

func (b *Bounds) ToRef() Ref

ToRef returns reference of bounds. Alias of String() method

func (*Bounds) UnmarshalXMLAttr

func (b *Bounds) UnmarshalXMLAttr(attr xml.Attr) error

UnmarshalXMLAttr unmarshal Bounds

type BoundsList

type BoundsList []Bounds

BoundsList is implementation of RefList

func BoundsListFromRefs

func BoundsListFromRefs(refs ...Ref) BoundsList

BoundsListFromRefs returns BoundsList for provided refs

func (*BoundsList) Add

func (bl *BoundsList) Add(ref Ref)

Add adds a new ref into the BoundsList

func (BoundsList) IsEmpty

func (bl BoundsList) IsEmpty() bool

IsEmpty return true if type was not initialized

func (*BoundsList) MarshalXMLAttr

func (bl *BoundsList) MarshalXMLAttr(name xml.Name) (xml.Attr, error)

MarshalXMLAttr marshal BoundsList

func (BoundsList) String

func (bl BoundsList) String() string

String return textual version of BoundsList

func (*BoundsList) ToRefList

func (bl *BoundsList) ToRefList() RefList

ToRefList returns refs. Alias of String() method

func (*BoundsList) UnmarshalXMLAttr

func (bl *BoundsList) UnmarshalXMLAttr(attr xml.Attr) error

UnmarshalXMLAttr unmarshal BoundsList

type CellFormulaType

type CellFormulaType byte

CellFormulaType is a type to encode XSD ST_CellFormulaType

const (
	CellFormulaTypeNormal CellFormulaType
	CellFormulaTypeArray
	CellFormulaTypeDataTable
	CellFormulaTypeShared
)

List of all possible values for CellFormulaType

func (*CellFormulaType) MarshalXMLAttr

func (e *CellFormulaType) MarshalXMLAttr(name xml.Name) (xml.Attr, error)

MarshalXMLAttr marshal CellFormulaType

func (CellFormulaType) String

func (e CellFormulaType) String() string

func (*CellFormulaType) UnmarshalXMLAttr

func (e *CellFormulaType) UnmarshalXMLAttr(attr xml.Attr) error

UnmarshalXMLAttr unmarshal CellFormulaType

type CellRef

type CellRef string

CellRef is a type to encode XSD ST_CellRef, an A1 style reference to the location of this cell

func CellRefFromIndexes

func CellRefFromIndexes(colIndex, rowIndex int) CellRef

CellRefFromIndexes returns a CellRef for 0-based indexes

func (CellRef) ToIndexes

func (cr CellRef) ToIndexes() (int, int)

ToIndexes returns 0-based indexes of reference

type CellType

type CellType byte

CellType is a type to encode XSD ST_CellType

func (*CellType) MarshalXMLAttr

func (e *CellType) MarshalXMLAttr(name xml.Name) (xml.Attr, error)

MarshalXMLAttr marshal CellType

func (CellType) String

func (e CellType) String() string

func (*CellType) UnmarshalXMLAttr

func (e *CellType) UnmarshalXMLAttr(attr xml.Attr) error

UnmarshalXMLAttr unmarshal CellType

type ConditionOperatorType

type ConditionOperatorType byte

ConditionOperatorType is a direct mapping of XSD ST_ConditionalFormattingOperator

const (
	ConditionOperatorLessThan ConditionOperatorType
	ConditionOperatorLessThanOrEqual
	ConditionOperatorEqual
	ConditionOperatorNotEqual
	ConditionOperatorGreaterThanOrEqual
	ConditionOperatorGreaterThan
	ConditionOperatorBetween
	ConditionOperatorNotBetween
	ConditionOperatorContainsText
	ConditionOperatorNotContains
	ConditionOperatorBeginsWith
	ConditionOperatorEndsWith
)

List of all possible values for OperatorType

func (*ConditionOperatorType) MarshalXMLAttr

func (t *ConditionOperatorType) MarshalXMLAttr(name xml.Name) (xml.Attr, error)

MarshalXMLAttr marshal ConditionOperatorType

func (ConditionOperatorType) String

func (t ConditionOperatorType) String() string

func (*ConditionOperatorType) UnmarshalXMLAttr

func (t *ConditionOperatorType) UnmarshalXMLAttr(attr xml.Attr) error

UnmarshalXMLAttr unmarshal ConditionOperatorType

type ConditionType

type ConditionType byte

ConditionType is a direct mapping of XSD ST_CfType

const (
	ConditionTypeExpression ConditionType
	ConditionTypeCellIs
	ConditionTypeColorScale
	ConditionTypeDataBar
	ConditionTypeIconSet
	ConditionTypeTop10
	ConditionTypeUniqueValues
	ConditionTypeDuplicateValues
	ConditionTypeContainsText
	ConditionTypeNotContainsText
	ConditionTypeBeginsWith
	ConditionTypeEndsWith
	ConditionTypeContainsBlanks
	ConditionTypeNotContainsBlanks
	ConditionTypeContainsErrors
	ConditionTypeNotContainsErrors
	ConditionTypeTimePeriod
	ConditionTypeAboveAverage
)

List of all possible values for Type

func (*ConditionType) MarshalXMLAttr

func (t *ConditionType) MarshalXMLAttr(name xml.Name) (xml.Attr, error)

MarshalXMLAttr marshal ConditionType

func (ConditionType) String

func (t ConditionType) String() string

func (*ConditionType) UnmarshalXMLAttr

func (t *ConditionType) UnmarshalXMLAttr(attr xml.Attr) error

UnmarshalXMLAttr unmarshal ConditionType

type ConditionValueType

type ConditionValueType byte

ConditionValueType is a direct mapping of XSD ST_CfvoType

func (*ConditionValueType) IsAllowed

func (t *ConditionValueType) IsAllowed(allowed ...ConditionValueType) bool

IsAllowed check if type is in list of allowed types

func (*ConditionValueType) MarshalXMLAttr

func (t *ConditionValueType) MarshalXMLAttr(name xml.Name) (xml.Attr, error)

MarshalXMLAttr marshal ConditionValueType

func (ConditionValueType) String

func (t ConditionValueType) String() string

func (*ConditionValueType) UnmarshalXMLAttr

func (t *ConditionValueType) UnmarshalXMLAttr(attr xml.Attr) error

UnmarshalXMLAttr unmarshal ConditionValueType

type FontCharsetType

type FontCharsetType ml.PropertyInt

FontCharsetType is a type to encode charset of font

func (*FontCharsetType) MarshalXML

func (t *FontCharsetType) MarshalXML(e *xml.Encoder, start xml.StartElement) error

MarshalXML marshal FontCharsetType

func (*FontCharsetType) UnmarshalXML

func (t *FontCharsetType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML unmarshal FontCharsetType

type FontEffectType

type FontEffectType ml.Property

FontEffectType is a type to encode XSD ST_VerticalAlignRun

const (
	FontEffectBaseline    FontEffectType = "baseline"
	FontEffectSuperscript FontEffectType = "superscript"
	FontEffectSubscript   FontEffectType = "subscript"
)

List of all possible values for FontEffectType

func (*FontEffectType) MarshalXML

func (t *FontEffectType) MarshalXML(e *xml.Encoder, start xml.StartElement) error

MarshalXML marshal FontEffectType

func (*FontEffectType) UnmarshalXML

func (t *FontEffectType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML unmarshal FontEffectType

type FontFamilyType

type FontFamilyType ml.PropertyInt

FontFamilyType is a type to encode XSD ST_FontFamily

func (*FontFamilyType) MarshalXML

func (t *FontFamilyType) MarshalXML(e *xml.Encoder, start xml.StartElement) error

MarshalXML marshal FontFamilyType

func (*FontFamilyType) UnmarshalXML

func (t *FontFamilyType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML unmarshal FontFamilyType

type FontSchemeType

type FontSchemeType ml.Property

FontSchemeType is a type to encode XSD ST_FontScheme

func (*FontSchemeType) MarshalXML

func (t *FontSchemeType) MarshalXML(e *xml.Encoder, start xml.StartElement) error

MarshalXML marshal FontSchemeType

func (*FontSchemeType) UnmarshalXML

func (t *FontSchemeType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML unmarshal FontSchemeType

type GradientType

type GradientType byte

GradientType is a type to encode XSD ST_GradientType

func (*GradientType) MarshalXMLAttr

func (t *GradientType) MarshalXMLAttr(name xml.Name) (xml.Attr, error)

MarshalXMLAttr marshal GradientType

func (GradientType) String

func (t GradientType) String() string

func (*GradientType) UnmarshalXMLAttr

func (t *GradientType) UnmarshalXMLAttr(attr xml.Attr) error

UnmarshalXMLAttr unmarshal GradientType

type HAlignType

type HAlignType byte

HAlignType is a type to encode XSD ST_HorizontalAlignment

func (*HAlignType) MarshalXMLAttr

func (t *HAlignType) MarshalXMLAttr(name xml.Name) (xml.Attr, error)

MarshalXMLAttr marshal HAlignType

func (HAlignType) String

func (t HAlignType) String() string

func (*HAlignType) UnmarshalXMLAttr

func (t *HAlignType) UnmarshalXMLAttr(attr xml.Attr) error

UnmarshalXMLAttr unmarshal HAlignType

type IconSetType

type IconSetType byte

IconSetType is a direct mapping of XSD ST_CfvoType

func (*IconSetType) MarshalXMLAttr

func (t *IconSetType) MarshalXMLAttr(name xml.Name) (xml.Attr, error)

MarshalXMLAttr marshal IconSetType

func (IconSetType) String

func (t IconSetType) String() string

func (*IconSetType) UnmarshalXMLAttr

func (t *IconSetType) UnmarshalXMLAttr(attr xml.Attr) error

UnmarshalXMLAttr unmarshal IconSetType

type ObjectsType

type ObjectsType byte

ObjectsType is a type to encode XSD ST_Objects

const (
	ObjectsTypeAll ObjectsType
	ObjectsTypePlaceholders
	ObjectsTypeNone
)

List of all possible values for ObjectsType

func (*ObjectsType) MarshalXMLAttr

func (e *ObjectsType) MarshalXMLAttr(name xml.Name) (xml.Attr, error)

MarshalXMLAttr marshal ObjectsType

func (ObjectsType) String

func (e ObjectsType) String() string

func (*ObjectsType) UnmarshalXMLAttr

func (e *ObjectsType) UnmarshalXMLAttr(attr xml.Attr) error

UnmarshalXMLAttr unmarshal ObjectsType

type PatternType

type PatternType byte

PatternType is a type to encode XSD ST_PatternType

func (*PatternType) MarshalXMLAttr

func (t *PatternType) MarshalXMLAttr(name xml.Name) (xml.Attr, error)

MarshalXMLAttr marshal PatternType

func (PatternType) String

func (t PatternType) String() string

func (*PatternType) UnmarshalXMLAttr

func (t *PatternType) UnmarshalXMLAttr(attr xml.Attr) error

UnmarshalXMLAttr unmarshal PatternType

type Ref

type Ref string

Ref is a type to encode XSD ST_Ref, a reference that identifies a cell or a range of cells. E.g.: N28 or B5:N10

func RefFromCellRefs

func RefFromCellRefs(from CellRef, to CellRef) Ref

RefFromCellRefs returns Ref for from/to CellRefs

func RefFromIndexes

func RefFromIndexes(colIndex, rowIndex int) Ref

RefFromIndexes returns Ref for a CellRef of 0-based indexes

func (Ref) ToBounds

func (r Ref) ToBounds() Bounds

ToBounds returns related bounds of Ref

func (Ref) ToCellRefs

func (r Ref) ToCellRefs() (from CellRef, to CellRef)

ToCellRefs returns from/to CellRef of Ref

type RefList

type RefList string

RefList is a type to encode XSD ST_Sqref, a reference that identifies list of cells or ranges of cells. E.g.: "N28 B5:N10 C10"

func RefListFromRefs

func RefListFromRefs(refs ...Ref) RefList

RefListFromRefs returns RefList for refs

func (RefList) ToBoundsList

func (r RefList) ToBoundsList() BoundsList

ToBoundsList returns related bounds of RefList

func (RefList) ToRefs

func (r RefList) ToRefs() []Ref

ToRefs returns refs of RefList

type Text

type Text string

Text is textual type that can have leading/trailing whitespace or newlines that must be preserved

func (Text) Hash

func (t Text) Hash() index.Code

Hash builds hash code for all required values of Text to use as unique index

func (*Text) MarshalXML

func (t *Text) MarshalXML(e *xml.Encoder, start xml.StartElement) error

MarshalXML marshal Text

type TimePeriodType

type TimePeriodType byte

TimePeriodType is a direct mapping of XSD ST_TimePeriod

const (
	TimePeriodToday TimePeriodType
	TimePeriodYesterday
	TimePeriodTomorrow
	TimePeriodLast7Days
	TimePeriodThisMonth
	TimePeriodLastMonth
	TimePeriodNextMonth
	TimePeriodThisWeek
	TimePeriodLastWeek
	TimePeriodNextWeek
)

List of all possible values for TimePeriodType

func (*TimePeriodType) MarshalXMLAttr

func (t *TimePeriodType) MarshalXMLAttr(name xml.Name) (xml.Attr, error)

MarshalXMLAttr marshal TimePeriodType

func (TimePeriodType) String

func (t TimePeriodType) String() string

func (*TimePeriodType) UnmarshalXMLAttr

func (t *TimePeriodType) UnmarshalXMLAttr(attr xml.Attr) error

UnmarshalXMLAttr unmarshal TimePeriodType

type UnderlineType

type UnderlineType ml.Property

UnderlineType is a type to encode XSD CT_UnderlineProperty

func (*UnderlineType) MarshalXML

func (t *UnderlineType) MarshalXML(e *xml.Encoder, start xml.StartElement) error

MarshalXML marshal UnderlineType

func (*UnderlineType) UnmarshalXML

func (t *UnderlineType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML unmarshal UnderlineType

type UpdateLinksType

type UpdateLinksType byte

UpdateLinksType is a type to encode XSD ST_UpdateLinks

const (
	UpdateLinksTypeUserSet UpdateLinksType
	UpdateLinksTypeNever
	UpdateLinksTypeAlways
)

List of all possible values for UpdateLinksType

func (*UpdateLinksType) MarshalXMLAttr

func (e *UpdateLinksType) MarshalXMLAttr(name xml.Name) (xml.Attr, error)

MarshalXMLAttr marshal UpdateLinksType

func (UpdateLinksType) String

func (e UpdateLinksType) String() string

func (*UpdateLinksType) UnmarshalXMLAttr

func (e *UpdateLinksType) UnmarshalXMLAttr(attr xml.Attr) error

UnmarshalXMLAttr unmarshal UpdateLinksType

type VAlignType

type VAlignType byte

VAlignType is a type to encode XSD ST_VerticalAlignment

func (*VAlignType) MarshalXMLAttr

func (t *VAlignType) MarshalXMLAttr(name xml.Name) (xml.Attr, error)

MarshalXMLAttr marshal VAlignType

func (VAlignType) String

func (t VAlignType) String() string

func (*VAlignType) UnmarshalXMLAttr

func (t *VAlignType) UnmarshalXMLAttr(attr xml.Attr) error

UnmarshalXMLAttr unmarshal VAlignType

type VisibilityType

type VisibilityType byte

VisibilityType is a type to encode XSD ST_Visibility and ST_SheetState

func (*VisibilityType) MarshalXMLAttr

func (e *VisibilityType) MarshalXMLAttr(name xml.Name) (xml.Attr, error)

MarshalXMLAttr marshal VisibilityType

func (VisibilityType) String

func (e VisibilityType) String() string

func (*VisibilityType) UnmarshalXMLAttr

func (e *VisibilityType) UnmarshalXMLAttr(attr xml.Attr) error

UnmarshalXMLAttr unmarshal VisibilityType

Jump to

Keyboard shortcuts

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