dmlst

package
v0.0.0-...-c46cdd7 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package dml provides simple types used in DrawingML (Drawing Markup Language), part of the Office Open XML (OOXML) standard for representing graphical elements in documents.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OptBool

type OptBool struct {
	Bool  bool
	Valid bool // Valid is true if Bool is not NULL
}

OptBool represents a bool that may be null. OptBool implements the [Scanner] interface so it can be used as a scan destination, similar to [NullString].

func NewOptBool

func NewOptBool(value bool) OptBool

func OptBoolFromStr

func OptBoolFromStr(value string) OptBool

OptBoolFromStr creates a new OptBool instance from a string. The function accepts a string parameter 'value' which can be either "true", "1", "false", or "0". If the input string matches "true" or "1", the function sets the Bool field of the returned OptBool instance to true. If the input string matches "false" or "0", the function sets the Bool field of the returned OptBool instance to false.

Example usage:

nBool := OptBoolFromStr("true")
fmt.Println(nBool.Bool) // Output: true
fmt.Println(nBool.Valid) // Output: true

nBool = OptBoolFromStr("0")
fmt.Println(nBool.Bool) // Output: false
fmt.Println(nBool.Valid) // Output: true

func (OptBool) ToIntFlag

func (n OptBool) ToIntFlag() int

ToIntFlag returns the integer representation of the OptBool. If the Bool field is true, it returns 1. If the Bool field is false, it also returns 0. Note: This method does not consider the Valid field. You ensure to check Valid field before calling this if you want optional field

func (OptBool) ToStringFlag

func (n OptBool) ToStringFlag() string

ToIntFlag returns the string representation of the OptBool. If the Bool field is true, it returns "1". If the Bool field is false, it also returns "0". Note: This method does not consider the Valid field. You ensure to check Valid field before calling this if you want optional field

func (*OptBool) UnmarshalXMLAttr

func (n *OptBool) UnmarshalXMLAttr(attr xml.Attr) error

type RectAlignment

type RectAlignment string
const (
	RectAlignmentTopLeft     RectAlignment = "tl"  // Rectangle Alignment Enum (Top Left)
	RectAlignmentTop         RectAlignment = "t"   // Rectangle Alignment Enum (Top)
	RectAlignmentTopRight    RectAlignment = "tr"  // Rectangle Alignment Enum (Top Right)
	RectAlignmentLeft        RectAlignment = "l"   // Rectangle Alignment Enum (Left)
	RectAlignmentCenter      RectAlignment = "ctr" // Rectangle Alignment Enum (Center)
	RectAlignmentRight       RectAlignment = "r"   // Rectangle Alignment Enum (Right)
	RectAlignmentBottomLeft  RectAlignment = "bl"  // Rectangle Alignment Enum (Bottom Left)
	RectAlignmentBottom      RectAlignment = "b"   // Rectangle Alignment Enum (Bottom)
	RectAlignmentBottomRight RectAlignment = "br"  // Rectangle Alignment Enum (Bottom Right)
)

func RectAlignmentFromStr

func RectAlignmentFromStr(value string) (RectAlignment, error)

RectAlignmentFromStr converts a string to RectAlignment type.

func (*RectAlignment) UnmarshalXMLAttr

func (r *RectAlignment) UnmarshalXMLAttr(attr xml.Attr) error

UnmarshalXMLAttr unmarshals XML attribute into RectAlignment.

type RelFromH

type RelFromH string
const (
	RelFromHCharacter     RelFromH = "character"
	RelFromHColumn        RelFromH = "column"
	RelFromHInsideMargin  RelFromH = "insideMargin"
	RelFromHLeftMargin    RelFromH = "leftMargin"
	RelFromHMargin        RelFromH = "margin"
	RelFromHOutsizeMargin RelFromH = "outsizeMargin"
	RelFromHPage          RelFromH = "page"
	RelFromHRightMargin   RelFromH = "rightMargin"
)

func RelFromHFromStr

func RelFromHFromStr(value string) (RelFromH, error)

RelFromHFromStr converts a string to RelFromH type.

func (*RelFromH) UnmarshalXMLAttr

func (r *RelFromH) UnmarshalXMLAttr(attr xml.Attr) error

UnmarshalXMLAttr unmarshals XML attribute into RelFromH.

type RelFromV

type RelFromV string
const (
	RelFromVBottomMargin  RelFromV = "bottomMargin"
	RelFromVInsideMargin  RelFromV = "insideMargin"
	RelFromVLine          RelFromV = "line"
	RelFromVMargin        RelFromV = "margin"
	RelFromVOutsizeMargin RelFromV = "outsizeMargin"
	RelFromVPage          RelFromV = "page"
	RelFromVParagraph     RelFromV = "paragraph"
	RelFromVTopMargin     RelFromV = "topMargin"
)

func RelFromVFromStr

func RelFromVFromStr(value string) (RelFromV, error)

RelFromVFromStr converts a string to RelFromV type.

func (*RelFromV) UnmarshalXMLAttr

func (r *RelFromV) UnmarshalXMLAttr(attr xml.Attr) error

UnmarshalXMLAttr unmarshals XML attribute into RelFromV.

type TileFlipMode

type TileFlipMode string

TileFlipMode represents tile flip mode values based on the schema.

const (
	TileFlipModeNone       TileFlipMode = "none" // Tile Flip Mode Enum (None)
	TileFlipModeHorizontal TileFlipMode = "x"    // Tile Flip Mode Enum (Horizontal)
	TileFlipModeVertical   TileFlipMode = "y"    // Tile Flip Mode Enum (Vertical)
	TileFlipModeBoth       TileFlipMode = "xy"   // Tile Flip Mode Enum (Horizontal and Vertical)
)

Constants representing valid TileFlipMode values as per the schema.

func TileFlipModeFromStr

func TileFlipModeFromStr(value string) (TileFlipMode, error)

TileFlipModeFromStr converts a string to TileFlipMode type. Returns an error if the string does not match any valid TileFlipMode value.

func (*TileFlipMode) UnmarshalXMLAttr

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

UnmarshalXMLAttr unmarshals XML attribute into TileFlipMode. Implements the xml.UnmarshalerAttr interface.

type WrapText

type WrapText string

WrapText type

const (
	WrapTextBothSides WrapText = "bothSides" // Both Sides
	WrapTextLeft      WrapText = "left"      // Left Side Only
	WrapTextRight     WrapText = "right"     // Right Side Only
	WrapTextLargest   WrapText = "largest"   // Largest Side Only
)

Constants for valid values

func WrapTextFromStr

func WrapTextFromStr(value string) (WrapText, error)

WrapTextFromStr converts a string to WrapText type.

func (*WrapText) UnmarshalXMLAttr

func (w *WrapText) UnmarshalXMLAttr(attr xml.Attr) error

UnmarshalXMLAttr unmarshals XML attribute into WrapText.

Jump to

Keyboard shortcuts

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