// // 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/ package drawing ;import (_a "github.com/unidoc/unioffice";_b "github.com/unidoc/unioffice/color";_af "github.com/unidoc/unioffice/measurement";_ae "github.com/unidoc/unioffice/schema/soo/dml";);func (_c LineProperties )clearFill (){_c ._d .NoFill =nil ;_c ._d .GradFill =nil ;_c ._d .SolidFill =nil ;_c ._d .PattFill =nil ;}; // SetNumbered controls if bullets are numbered or not. func (_be ParagraphProperties )SetNumbered (scheme _ae .ST_TextAutonumberScheme ){if scheme ==_ae .ST_TextAutonumberSchemeUnset {_be ._aag .BuAutoNum =nil ;}else {_be ._aag .BuAutoNum =_ae .NewCT_TextAutonumberBullet ();_be ._aag .BuAutoNum .TypeAttr =scheme ;};};func (_cc ShapeProperties )clearFill (){_cc ._ea .NoFill =nil ;_cc ._ea .BlipFill =nil ;_cc ._ea .GradFill =nil ;_cc ._ea .GrpFill =nil ;_cc ._ea .SolidFill =nil ;_cc ._ea .PattFill =nil ;};func (_bc ShapeProperties )SetSolidFill (c _b .Color ){_bc .clearFill ();_bc ._ea .SolidFill =_ae .NewCT_SolidColorFillProperties ();_bc ._ea .SolidFill .SrgbClr =_ae .NewCT_SRgbColor ();_bc ._ea .SolidFill .SrgbClr .ValAttr =*c .AsRGBString ();}; // RunProperties controls the run properties. type RunProperties struct{_fa *_ae .CT_TextCharacterProperties ;}; // Run is a run within a paragraph. type Run struct{_fg *_ae .EG_TextRun }; // SetGeometry sets the shape type of the shape func (_fgg ShapeProperties )SetGeometry (g _ae .ST_ShapeType ){if _fgg ._ea .PrstGeom ==nil {_fgg ._ea .PrstGeom =_ae .NewCT_PresetGeometry2D ();};_fgg ._ea .PrstGeom .PrstAttr =g ;}; // SetBulletChar sets the bullet character for the paragraph. func (_eg ParagraphProperties )SetBulletChar (c string ){if c ==""{_eg ._aag .BuChar =nil ;}else {_eg ._aag .BuChar =_ae .NewCT_TextCharBullet ();_eg ._aag .BuChar .CharAttr =c ;};}; // SetSize sets the width and height of the shape. func (_ef ShapeProperties )SetSize (w ,h _af .Distance ){_ef .SetWidth (w );_ef .SetHeight (h )};const (LineJoinRound LineJoin =iota ;LineJoinBevel ;LineJoinMiter ;); // SetHeight sets the height of the shape. func (_fe ShapeProperties )SetHeight (h _af .Distance ){_fe .ensureXfrm ();if _fe ._ea .Xfrm .Ext ==nil {_fe ._ea .Xfrm .Ext =_ae .NewCT_PositiveSize2D ();};_fe ._ea .Xfrm .Ext .CyAttr =int64 (h /_af .EMU );};func (_ag LineProperties )SetSolidFill (c _b .Color ){_ag .clearFill ();_ag ._d .SolidFill =_ae .NewCT_SolidColorFillProperties ();_ag ._d .SolidFill .SrgbClr =_ae .NewCT_SRgbColor ();_ag ._d .SolidFill .SrgbClr .ValAttr =*c .AsRGBString ();}; // MakeParagraphProperties constructs a new ParagraphProperties wrapper. func MakeParagraphProperties (x *_ae .CT_TextParagraphProperties )ParagraphProperties {return ParagraphProperties {x };}; // ParagraphProperties allows controlling paragraph properties. type ParagraphProperties struct{_aag *_ae .CT_TextParagraphProperties ;}; // SetFlipVertical controls if the shape is flipped vertically. func (_ac ShapeProperties )SetFlipVertical (b bool ){_ac .ensureXfrm ();if !b {_ac ._ea .Xfrm .FlipVAttr =nil ;}else {_ac ._ea .Xfrm .FlipVAttr =_a .Bool (true );};}; // AddBreak adds a new line break to a paragraph. func (_ab Paragraph )AddBreak (){_eb :=_ae .NewEG_TextRun ();_eb .Br =_ae .NewCT_TextLineBreak ();_ab ._ca .EG_TextRun =append (_ab ._ca .EG_TextRun ,_eb );};type ShapeProperties struct{_ea *_ae .CT_ShapeProperties }; // Properties returns the run's properties. func (_bde Run )Properties ()RunProperties {if _bde ._fg .R ==nil {_bde ._fg .R =_ae .NewCT_RegularTextRun ();};if _bde ._fg .R .RPr ==nil {_bde ._fg .R .RPr =_ae .NewCT_TextCharacterProperties ();};return RunProperties {_bde ._fg .R .RPr };}; // MakeRunProperties constructs a new RunProperties wrapper. func MakeRunProperties (x *_ae .CT_TextCharacterProperties )RunProperties {return RunProperties {x }}; // SetAlign controls the paragraph alignment func (_cae ParagraphProperties )SetAlign (a _ae .ST_TextAlignType ){_cae ._aag .AlgnAttr =a }; // X returns the inner wrapped XML type. func (_faa ShapeProperties )X ()*_ae .CT_ShapeProperties {return _faa ._ea }; // X returns the inner wrapped XML type. func (_aad Paragraph )X ()*_ae .CT_TextParagraph {return _aad ._ca }; // SetFlipHorizontal controls if the shape is flipped horizontally. func (_aagg ShapeProperties )SetFlipHorizontal (b bool ){_aagg .ensureXfrm ();if !b {_aagg ._ea .Xfrm .FlipHAttr =nil ;}else {_aagg ._ea .Xfrm .FlipHAttr =_a .Bool (true );};};func (_bb ShapeProperties )LineProperties ()LineProperties {if _bb ._ea .Ln ==nil {_bb ._ea .Ln =_ae .NewCT_LineProperties ();};return LineProperties {_bb ._ea .Ln };}; // SetFont controls the font of a run. func (_ce RunProperties )SetFont (s string ){_ce ._fa .Latin =_ae .NewCT_TextFont ();_ce ._fa .Latin .TypefaceAttr =s ;}; // SetText sets the run's text contents. func (_ebg Run )SetText (s string ){_ebg ._fg .Br =nil ;_ebg ._fg .Fld =nil ;if _ebg ._fg .R ==nil {_ebg ._fg .R =_ae .NewCT_RegularTextRun ();};_ebg ._fg .R .T =s ;};func MakeShapeProperties (x *_ae .CT_ShapeProperties )ShapeProperties {return ShapeProperties {x }}; // SetPosition sets the position of the shape. func (_ad ShapeProperties )SetPosition (x ,y _af .Distance ){_ad .ensureXfrm ();if _ad ._ea .Xfrm .Off ==nil {_ad ._ea .Xfrm .Off =_ae .NewCT_Point2D ();};_ad ._ea .Xfrm .Off .XAttr .ST_CoordinateUnqualified =_a .Int64 (int64 (x /_af .EMU ));_ad ._ea .Xfrm .Off .YAttr .ST_CoordinateUnqualified =_a .Int64 (int64 (y /_af .EMU ));}; // MakeRun constructs a new Run wrapper. func MakeRun (x *_ae .EG_TextRun )Run {return Run {x }}; // SetBold controls the bolding of a run. func (_dfa RunProperties )SetBold (b bool ){_dfa ._fa .BAttr =_a .Bool (b )}; // LineJoin is the type of line join type LineJoin byte ; // SetSolidFill controls the text color of a run. func (_fgd RunProperties )SetSolidFill (c _b .Color ){_fgd ._fa .NoFill =nil ;_fgd ._fa .BlipFill =nil ;_fgd ._fa .GradFill =nil ;_fgd ._fa .GrpFill =nil ;_fgd ._fa .PattFill =nil ;_fgd ._fa .SolidFill =_ae .NewCT_SolidColorFillProperties ();_fgd ._fa .SolidFill .SrgbClr =_ae .NewCT_SRgbColor ();_fgd ._fa .SolidFill .SrgbClr .ValAttr =*c .AsRGBString ();}; // X returns the inner wrapped XML type. func (_ge Run )X ()*_ae .EG_TextRun {return _ge ._fg }; // SetJoin sets the line join style. func (_df LineProperties )SetJoin (e LineJoin ){_df ._d .Round =nil ;_df ._d .Miter =nil ;_df ._d .Bevel =nil ;switch e {case LineJoinRound :_df ._d .Round =_ae .NewCT_LineJoinRound ();case LineJoinBevel :_df ._d .Bevel =_ae .NewCT_LineJoinBevel ();case LineJoinMiter :_df ._d .Miter =_ae .NewCT_LineJoinMiterProperties ();};}; // Properties returns the paragraph properties. func (_gaf Paragraph )Properties ()ParagraphProperties {if _gaf ._ca .PPr ==nil {_gaf ._ca .PPr =_ae .NewCT_TextParagraphProperties ();};return MakeParagraphProperties (_gaf ._ca .PPr );}; // MakeParagraph constructs a new paragraph wrapper. func MakeParagraph (x *_ae .CT_TextParagraph )Paragraph {return Paragraph {x }}; // SetWidth sets the width of the shape. func (_fc ShapeProperties )SetWidth (w _af .Distance ){_fc .ensureXfrm ();if _fc ._ea .Xfrm .Ext ==nil {_fc ._ea .Xfrm .Ext =_ae .NewCT_PositiveSize2D ();};_fc ._ea .Xfrm .Ext .CxAttr =int64 (w /_af .EMU );}; // AddRun adds a new run to a paragraph. func (_e Paragraph )AddRun ()Run {_dfd :=MakeRun (_ae .NewEG_TextRun ());_e ._ca .EG_TextRun =append (_e ._ca .EG_TextRun ,_dfd .X ());return _dfd ;};func (_bdc ShapeProperties )SetNoFill (){_bdc .clearFill ();_bdc ._ea .NoFill =_ae .NewCT_NoFillProperties ();};type LineProperties struct{_d *_ae .CT_LineProperties }; // Paragraph is a paragraph within a document. type Paragraph struct{_ca *_ae .CT_TextParagraph }; // SetLevel sets the level of indentation of a paragraph. func (_bd ParagraphProperties )SetLevel (idx int32 ){_bd ._aag .LvlAttr =_a .Int32 (idx )}; // SetBulletFont controls the font for the bullet character. func (_afd ParagraphProperties )SetBulletFont (f string ){if f ==""{_afd ._aag .BuFont =nil ;}else {_afd ._aag .BuFont =_ae .NewCT_TextFont ();_afd ._aag .BuFont .TypefaceAttr =f ;};}; // SetWidth sets the line width, MS products treat zero as the minimum width // that can be displayed. func (_aa LineProperties )SetWidth (w _af .Distance ){_aa ._d .WAttr =_a .Int32 (int32 (w /_af .EMU ))}; // X returns the inner wrapped XML type. func (_gf LineProperties )X ()*_ae .CT_LineProperties {return _gf ._d };func (_cb ShapeProperties )ensureXfrm (){if _cb ._ea .Xfrm ==nil {_cb ._ea .Xfrm =_ae .NewCT_Transform2D ();};}; // GetPosition gets the position of the shape in EMU. func (_egc ShapeProperties )GetPosition ()(int64 ,int64 ){_egc .ensureXfrm ();if _egc ._ea .Xfrm .Off ==nil {_egc ._ea .Xfrm .Off =_ae .NewCT_Point2D ();};return *_egc ._ea .Xfrm .Off .XAttr .ST_CoordinateUnqualified ,*_egc ._ea .Xfrm .Off .YAttr .ST_CoordinateUnqualified ;}; // SetSize sets the font size of the run text func (_gfb RunProperties )SetSize (sz _af .Distance ){_gfb ._fa .SzAttr =_a .Int32 (int32 (sz /_af .HundredthPoint ));};func (_ga LineProperties )SetNoFill (){_ga .clearFill ();_ga ._d .NoFill =_ae .NewCT_NoFillProperties ()}; // X returns the inner wrapped XML type. func (_f ParagraphProperties )X ()*_ae .CT_TextParagraphProperties {return _f ._aag };