2020-08-23 14:15:53 +00:00
|
|
|
//
|
|
|
|
// Copyright 2020 FoxyUtils ehf. All rights reserved.
|
|
|
|
//
|
|
|
|
// This is a commercial product and requires a license to operate.
|
|
|
|
// A trial license can be obtained at https://unidoc.io
|
|
|
|
//
|
|
|
|
// DO NOT EDIT: generated by unitwist Go source code obfuscator.
|
|
|
|
//
|
|
|
|
// Use of this source code is governed by the UniDoc End User License Agreement
|
|
|
|
// terms that can be accessed at https://unidoc.io/eula/
|
|
|
|
|
2020-11-09 01:00:18 +00:00
|
|
|
package drawing ;import (_d "github.com/unidoc/unioffice";_f "github.com/unidoc/unioffice/color";_ca "github.com/unidoc/unioffice/measurement";_dg "github.com/unidoc/unioffice/schema/soo/dml";);
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2020-11-09 01:00:18 +00:00
|
|
|
// SetBulletFont controls the font for the bullet character.
|
|
|
|
func (_ac ParagraphProperties )SetBulletFont (f string ){if f ==""{_ac ._fge .BuFont =nil ;}else {_ac ._fge .BuFont =_dg .NewCT_TextFont ();_ac ._fge .BuFont .TypefaceAttr =f ;};};func (_cb LineProperties )clearFill (){_cb ._e .NoFill =nil ;_cb ._e .GradFill =nil ;_cb ._e .SolidFill =nil ;_cb ._e .PattFill =nil ;};
|
|
|
|
|
|
|
|
// SetFlipHorizontal controls if the shape is flipped horizontally.
|
|
|
|
func (_bde ShapeProperties )SetFlipHorizontal (b bool ){_bde .ensureXfrm ();if !b {_bde ._bgd .Xfrm .FlipHAttr =nil ;}else {_bde ._bgd .Xfrm .FlipHAttr =_d .Bool (true );};};
|
|
|
|
|
|
|
|
// MakeParagraphProperties constructs a new ParagraphProperties wrapper.
|
|
|
|
func MakeParagraphProperties (x *_dg .CT_TextParagraphProperties )ParagraphProperties {return ParagraphProperties {x };};func (_ccc ShapeProperties )ensureXfrm (){if _ccc ._bgd .Xfrm ==nil {_ccc ._bgd .Xfrm =_dg .NewCT_Transform2D ();};};
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2020-10-12 13:59:12 +00:00
|
|
|
// SetBold controls the bolding of a run.
|
2020-11-09 01:00:18 +00:00
|
|
|
func (_aa RunProperties )SetBold (b bool ){_aa ._dgc .BAttr =_d .Bool (b )};
|
2020-08-31 22:58:25 +00:00
|
|
|
|
2020-11-09 01:00:18 +00:00
|
|
|
// MakeParagraph constructs a new paragraph wrapper.
|
|
|
|
func MakeParagraph (x *_dg .CT_TextParagraph )Paragraph {return Paragraph {x }};
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2020-11-09 01:00:18 +00:00
|
|
|
// RunProperties controls the run properties.
|
|
|
|
type RunProperties struct{_dgc *_dg .CT_TextCharacterProperties ;};
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2020-11-09 01:00:18 +00:00
|
|
|
// SetSize sets the width and height of the shape.
|
|
|
|
func (_bf ShapeProperties )SetSize (w ,h _ca .Distance ){_bf .SetWidth (w );_bf .SetHeight (h )};
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2020-11-09 01:00:18 +00:00
|
|
|
// AddRun adds a new run to a paragraph.
|
|
|
|
func (_fe Paragraph )AddRun ()Run {_ff :=MakeRun (_dg .NewEG_TextRun ());_fe ._fg .EG_TextRun =append (_fe ._fg .EG_TextRun ,_ff .X ());return _ff ;};func (_b LineProperties )SetSolidFill (c _f .Color ){_b .clearFill ();_b ._e .SolidFill =_dg .NewCT_SolidColorFillProperties ();_b ._e .SolidFill .SrgbClr =_dg .NewCT_SRgbColor ();_b ._e .SolidFill .SrgbClr .ValAttr =*c .AsRGBString ();};
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2020-11-09 01:00:18 +00:00
|
|
|
// SetGeometry sets the shape type of the shape
|
|
|
|
func (_cd ShapeProperties )SetGeometry (g _dg .ST_ShapeType ){if _cd ._bgd .PrstGeom ==nil {_cd ._bgd .PrstGeom =_dg .NewCT_PresetGeometry2D ();};_cd ._bgd .PrstGeom .PrstAttr =g ;};
|
2020-08-31 22:58:25 +00:00
|
|
|
|
2020-11-09 01:00:18 +00:00
|
|
|
// SetPosition sets the position of the shape.
|
|
|
|
func (_cce ShapeProperties )SetPosition (x ,y _ca .Distance ){_cce .ensureXfrm ();if _cce ._bgd .Xfrm .Off ==nil {_cce ._bgd .Xfrm .Off =_dg .NewCT_Point2D ();};_cce ._bgd .Xfrm .Off .XAttr .ST_CoordinateUnqualified =_d .Int64 (int64 (x /_ca .EMU ));_cce ._bgd .Xfrm .Off .YAttr .ST_CoordinateUnqualified =_d .Int64 (int64 (y /_ca .EMU ));};
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2020-11-09 01:00:18 +00:00
|
|
|
// AddBreak adds a new line break to a paragraph.
|
|
|
|
func (_fc Paragraph )AddBreak (){_db :=_dg .NewEG_TextRun ();_db .Br =_dg .NewCT_TextLineBreak ();_fc ._fg .EG_TextRun =append (_fc ._fg .EG_TextRun ,_db );};
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2020-11-09 01:00:18 +00:00
|
|
|
// SetAlign controls the paragraph alignment
|
|
|
|
func (_ag ParagraphProperties )SetAlign (a _dg .ST_TextAlignType ){_ag ._fge .AlgnAttr =a };
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2020-11-09 01:00:18 +00:00
|
|
|
// X returns the inner wrapped XML type.
|
|
|
|
func (_cg ShapeProperties )X ()*_dg .CT_ShapeProperties {return _cg ._bgd };
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2020-11-09 01:00:18 +00:00
|
|
|
// SetFont controls the font of a run.
|
|
|
|
func (_cf RunProperties )SetFont (s string ){_cf ._dgc .Latin =_dg .NewCT_TextFont ();_cf ._dgc .Latin .TypefaceAttr =s ;};func (_be ShapeProperties )SetSolidFill (c _f .Color ){_be .clearFill ();_be ._bgd .SolidFill =_dg .NewCT_SolidColorFillProperties ();_be ._bgd .SolidFill .SrgbClr =_dg .NewCT_SRgbColor ();_be ._bgd .SolidFill .SrgbClr .ValAttr =*c .AsRGBString ();};
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2020-11-09 01:00:18 +00:00
|
|
|
// MakeRun constructs a new Run wrapper.
|
|
|
|
func MakeRun (x *_dg .EG_TextRun )Run {return Run {x }};
|
2020-10-12 13:59:12 +00:00
|
|
|
|
2020-11-09 01:00:18 +00:00
|
|
|
// SetNumbered controls if bullets are numbered or not.
|
|
|
|
func (_bg ParagraphProperties )SetNumbered (scheme _dg .ST_TextAutonumberScheme ){if scheme ==_dg .ST_TextAutonumberSchemeUnset {_bg ._fge .BuAutoNum =nil ;}else {_bg ._fge .BuAutoNum =_dg .NewCT_TextAutonumberBullet ();_bg ._fge .BuAutoNum .TypeAttr =scheme ;};};
|
2020-10-12 13:59:12 +00:00
|
|
|
|
2020-11-09 01:00:18 +00:00
|
|
|
// SetLevel sets the level of indentation of a paragraph.
|
|
|
|
func (_fcd ParagraphProperties )SetLevel (idx int32 ){_fcd ._fge .LvlAttr =_d .Int32 (idx )};
|
2020-10-12 13:59:12 +00:00
|
|
|
|
2020-11-09 01:00:18 +00:00
|
|
|
// ParagraphProperties allows controlling paragraph properties.
|
|
|
|
type ParagraphProperties struct{_fge *_dg .CT_TextParagraphProperties ;};func (_eac ShapeProperties )SetNoFill (){_eac .clearFill ();_eac ._bgd .NoFill =_dg .NewCT_NoFillProperties ();};const (LineJoinRound LineJoin =iota ;LineJoinBevel ;LineJoinMiter ;);
|
|
|
|
|
|
|
|
// X returns the inner wrapped XML type.
|
|
|
|
func (_dd LineProperties )X ()*_dg .CT_LineProperties {return _dd ._e };
|
2020-10-12 13:59:12 +00:00
|
|
|
|
|
|
|
// SetFlipVertical controls if the shape is flipped vertically.
|
2020-11-09 01:00:18 +00:00
|
|
|
func (_ef ShapeProperties )SetFlipVertical (b bool ){_ef .ensureXfrm ();if !b {_ef ._bgd .Xfrm .FlipVAttr =nil ;}else {_ef ._bgd .Xfrm .FlipVAttr =_d .Bool (true );};};
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2020-11-09 01:00:18 +00:00
|
|
|
// SetWidth sets the width of the shape.
|
|
|
|
func (_dec ShapeProperties )SetWidth (w _ca .Distance ){_dec .ensureXfrm ();if _dec ._bgd .Xfrm .Ext ==nil {_dec ._bgd .Xfrm .Ext =_dg .NewCT_PositiveSize2D ();};_dec ._bgd .Xfrm .Ext .CxAttr =int64 (w /_ca .EMU );};
|
2020-10-12 13:59:12 +00:00
|
|
|
|
2020-11-09 01:00:18 +00:00
|
|
|
// SetSolidFill controls the text color of a run.
|
|
|
|
func (_gd RunProperties )SetSolidFill (c _f .Color ){_gd ._dgc .NoFill =nil ;_gd ._dgc .BlipFill =nil ;_gd ._dgc .GradFill =nil ;_gd ._dgc .GrpFill =nil ;_gd ._dgc .PattFill =nil ;_gd ._dgc .SolidFill =_dg .NewCT_SolidColorFillProperties ();_gd ._dgc .SolidFill .SrgbClr =_dg .NewCT_SRgbColor ();_gd ._dgc .SolidFill .SrgbClr .ValAttr =*c .AsRGBString ();};func (_fef ShapeProperties )LineProperties ()LineProperties {if _fef ._bgd .Ln ==nil {_fef ._bgd .Ln =_dg .NewCT_LineProperties ();};return LineProperties {_fef ._bgd .Ln };};
|
2020-10-12 13:59:12 +00:00
|
|
|
|
2020-11-09 01:00:18 +00:00
|
|
|
// SetHeight sets the height of the shape.
|
|
|
|
func (_cgf ShapeProperties )SetHeight (h _ca .Distance ){_cgf .ensureXfrm ();if _cgf ._bgd .Xfrm .Ext ==nil {_cgf ._bgd .Xfrm .Ext =_dg .NewCT_PositiveSize2D ();};_cgf ._bgd .Xfrm .Ext .CyAttr =int64 (h /_ca .EMU );};
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2020-11-09 01:00:18 +00:00
|
|
|
// Properties returns the paragraph properties.
|
|
|
|
func (_ccf Paragraph )Properties ()ParagraphProperties {if _ccf ._fg .PPr ==nil {_ccf ._fg .PPr =_dg .NewCT_TextParagraphProperties ();};return MakeParagraphProperties (_ccf ._fg .PPr );};type ShapeProperties struct{_bgd *_dg .CT_ShapeProperties };
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2020-11-09 01:00:18 +00:00
|
|
|
// SetBulletChar sets the bullet character for the paragraph.
|
|
|
|
func (_ae ParagraphProperties )SetBulletChar (c string ){if c ==""{_ae ._fge .BuChar =nil ;}else {_ae ._fge .BuChar =_dg .NewCT_TextCharBullet ();_ae ._fge .BuChar .CharAttr =c ;};};
|
2020-08-23 14:15:53 +00:00
|
|
|
|
|
|
|
// MakeRunProperties constructs a new RunProperties wrapper.
|
2020-11-09 01:00:18 +00:00
|
|
|
func MakeRunProperties (x *_dg .CT_TextCharacterProperties )RunProperties {return RunProperties {x }};
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2020-10-12 13:59:12 +00:00
|
|
|
// X returns the inner wrapped XML type.
|
2020-11-09 01:00:18 +00:00
|
|
|
func (_g ParagraphProperties )X ()*_dg .CT_TextParagraphProperties {return _g ._fge };
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2020-11-09 01:00:18 +00:00
|
|
|
// LineJoin is the type of line join
|
|
|
|
type LineJoin byte ;
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2020-10-12 13:59:12 +00:00
|
|
|
// Run is a run within a paragraph.
|
2020-11-09 01:00:18 +00:00
|
|
|
type Run struct{_bd *_dg .EG_TextRun };
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2020-11-09 01:00:18 +00:00
|
|
|
// X returns the inner wrapped XML type.
|
|
|
|
func (_ea Run )X ()*_dg .EG_TextRun {return _ea ._bd };func (_a LineProperties )SetNoFill (){_a .clearFill ();_a ._e .NoFill =_dg .NewCT_NoFillProperties ()};func (_cfa ShapeProperties )clearFill (){_cfa ._bgd .NoFill =nil ;_cfa ._bgd .BlipFill =nil ;_cfa ._bgd .GradFill =nil ;_cfa ._bgd .GrpFill =nil ;_cfa ._bgd .SolidFill =nil ;_cfa ._bgd .PattFill =nil ;};
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2020-10-12 13:59:12 +00:00
|
|
|
// Paragraph is a paragraph within a document.
|
2020-11-09 01:00:18 +00:00
|
|
|
type Paragraph struct{_fg *_dg .CT_TextParagraph };func MakeShapeProperties (x *_dg .CT_ShapeProperties )ShapeProperties {return ShapeProperties {x }};type LineProperties struct{_e *_dg .CT_LineProperties };
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2020-11-09 01:00:18 +00:00
|
|
|
// SetSize sets the font size of the run text
|
|
|
|
func (_gb RunProperties )SetSize (sz _ca .Distance ){_gb ._dgc .SzAttr =_d .Int32 (int32 (sz /_ca .HundredthPoint ));};
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2020-11-09 01:00:18 +00:00
|
|
|
// SetJoin sets the line join style.
|
|
|
|
func (_ab LineProperties )SetJoin (e LineJoin ){_ab ._e .Round =nil ;_ab ._e .Miter =nil ;_ab ._e .Bevel =nil ;switch e {case LineJoinRound :_ab ._e .Round =_dg .NewCT_LineJoinRound ();case LineJoinBevel :_ab ._e .Bevel =_dg .NewCT_LineJoinBevel ();case LineJoinMiter :_ab ._e .Miter =_dg .NewCT_LineJoinMiterProperties ();};};
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2020-11-09 01:00:18 +00:00
|
|
|
// X returns the inner wrapped XML type.
|
|
|
|
func (_bc Paragraph )X ()*_dg .CT_TextParagraph {return _bc ._fg };
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2020-11-09 01:00:18 +00:00
|
|
|
// SetText sets the run's text contents.
|
|
|
|
func (_bdb Run )SetText (s string ){_bdb ._bd .Br =nil ;_bdb ._bd .Fld =nil ;if _bdb ._bd .R ==nil {_bdb ._bd .R =_dg .NewCT_RegularTextRun ();};_bdb ._bd .R .T =s ;};
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2020-10-12 13:59:12 +00:00
|
|
|
// Properties returns the run's properties.
|
2020-11-09 01:00:18 +00:00
|
|
|
func (_de Run )Properties ()RunProperties {if _de ._bd .R ==nil {_de ._bd .R =_dg .NewCT_RegularTextRun ();};if _de ._bd .R .RPr ==nil {_de ._bd .R .RPr =_dg .NewCT_TextCharacterProperties ();};return RunProperties {_de ._bd .R .RPr };};
|
|
|
|
|
|
|
|
// SetWidth sets the line width, MS products treat zero as the minimum width
|
|
|
|
// that can be displayed.
|
|
|
|
func (_cc LineProperties )SetWidth (w _ca .Distance ){_cc ._e .WAttr =_d .Int32 (int32 (w /_ca .EMU ))};
|