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/
|
|
|
|
|
2021-07-30 17:03:26 +00:00
|
|
|
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 ;};
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2021-07-30 17:03:26 +00:00
|
|
|
// 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 ();};
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2021-07-30 17:03:26 +00:00
|
|
|
// RunProperties controls the run properties.
|
|
|
|
type RunProperties struct{_fa *_ae .CT_TextCharacterProperties ;};
|
2021-06-16 07:10:52 +00:00
|
|
|
|
2021-07-30 17:03:26 +00:00
|
|
|
// Run is a run within a paragraph.
|
|
|
|
type Run struct{_fg *_ae .EG_TextRun };
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2021-07-30 17:03:26 +00:00
|
|
|
// 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 ;};
|
2020-08-31 22:58:25 +00:00
|
|
|
|
2021-07-30 17:03:26 +00:00
|
|
|
// 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 ;};};
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2021-07-30 17:03:26 +00:00
|
|
|
// 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 ;);
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2021-07-30 17:03:26 +00:00
|
|
|
// 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 ();};
|
2021-06-16 07:10:52 +00:00
|
|
|
|
2021-07-30 17:03:26 +00:00
|
|
|
// MakeParagraphProperties constructs a new ParagraphProperties wrapper.
|
|
|
|
func MakeParagraphProperties (x *_ae .CT_TextParagraphProperties )ParagraphProperties {return ParagraphProperties {x };};
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2021-07-30 17:03:26 +00:00
|
|
|
// ParagraphProperties allows controlling paragraph properties.
|
|
|
|
type ParagraphProperties struct{_aag *_ae .CT_TextParagraphProperties ;};
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2021-07-30 17:03:26 +00:00
|
|
|
// 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 );};};
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2021-07-30 17:03:26 +00:00
|
|
|
// 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 };
|
2020-10-12 13:59:12 +00:00
|
|
|
|
2021-07-30 17:03:26 +00:00
|
|
|
// 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 };};
|
2021-05-31 16:22:30 +00:00
|
|
|
|
2021-07-30 17:03:26 +00:00
|
|
|
// MakeRunProperties constructs a new RunProperties wrapper.
|
|
|
|
func MakeRunProperties (x *_ae .CT_TextCharacterProperties )RunProperties {return RunProperties {x }};
|
2021-05-31 16:22:30 +00:00
|
|
|
|
2021-07-30 17:03:26 +00:00
|
|
|
// SetAlign controls the paragraph alignment
|
|
|
|
func (_cae ParagraphProperties )SetAlign (a _ae .ST_TextAlignType ){_cae ._aag .AlgnAttr =a };
|
2020-10-12 13:59:12 +00:00
|
|
|
|
2021-04-23 20:00:00 +00:00
|
|
|
// X returns the inner wrapped XML type.
|
2021-07-30 17:03:26 +00:00
|
|
|
func (_faa ShapeProperties )X ()*_ae .CT_ShapeProperties {return _faa ._ea };
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2021-07-30 17:03:26 +00:00
|
|
|
// X returns the inner wrapped XML type.
|
|
|
|
func (_aad Paragraph )X ()*_ae .CT_TextParagraph {return _aad ._ca };
|
2021-06-16 07:10:52 +00:00
|
|
|
|
2021-07-30 17:03:26 +00:00
|
|
|
// 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 };};
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2021-07-30 17:03:26 +00:00
|
|
|
// SetFont controls the font of a run.
|
|
|
|
func (_ce RunProperties )SetFont (s string ){_ce ._fa .Latin =_ae .NewCT_TextFont ();_ce ._fa .Latin .TypefaceAttr =s ;};
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2021-07-30 17:03:26 +00:00
|
|
|
// 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 }};
|
2021-03-16 20:51:18 +00:00
|
|
|
|
2021-07-30 17:03:26 +00:00
|
|
|
// 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 ));};
|
2021-03-16 20:51:18 +00:00
|
|
|
|
2021-07-30 17:03:26 +00:00
|
|
|
// MakeRun constructs a new Run wrapper.
|
|
|
|
func MakeRun (x *_ae .EG_TextRun )Run {return Run {x }};
|
2021-03-16 20:51:18 +00:00
|
|
|
|
2021-07-30 17:03:26 +00:00
|
|
|
// SetBold controls the bolding of a run.
|
|
|
|
func (_dfa RunProperties )SetBold (b bool ){_dfa ._fa .BAttr =_a .Bool (b )};
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2021-07-30 17:03:26 +00:00
|
|
|
// LineJoin is the type of line join
|
|
|
|
type LineJoin byte ;
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2021-06-16 07:10:52 +00:00
|
|
|
// SetSolidFill controls the text color of a run.
|
2021-07-30 17:03:26 +00:00
|
|
|
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 ();};
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2021-07-30 17:03:26 +00:00
|
|
|
// X returns the inner wrapped XML type.
|
|
|
|
func (_ge Run )X ()*_ae .EG_TextRun {return _ge ._fg };
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2021-07-30 17:03:26 +00:00
|
|
|
// 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 ();};};
|
2021-04-23 20:00:00 +00:00
|
|
|
|
2021-07-30 17:03:26 +00:00
|
|
|
// 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 );};
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2021-07-30 17:03:26 +00:00
|
|
|
// MakeParagraph constructs a new paragraph wrapper.
|
|
|
|
func MakeParagraph (x *_ae .CT_TextParagraph )Paragraph {return Paragraph {x }};
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2021-07-30 17:03:26 +00:00
|
|
|
// 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 );};
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2021-06-16 07:10:52 +00:00
|
|
|
// AddRun adds a new run to a paragraph.
|
2021-07-30 17:03:26 +00:00
|
|
|
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 };
|
2021-04-23 20:00:00 +00:00
|
|
|
|
2021-07-30 17:03:26 +00:00
|
|
|
// Paragraph is a paragraph within a document.
|
|
|
|
type Paragraph struct{_ca *_ae .CT_TextParagraph };
|
2021-03-16 20:51:18 +00:00
|
|
|
|
2021-07-30 17:03:26 +00:00
|
|
|
// SetLevel sets the level of indentation of a paragraph.
|
|
|
|
func (_bd ParagraphProperties )SetLevel (idx int32 ){_bd ._aag .LvlAttr =_a .Int32 (idx )};
|
2021-03-16 20:51:18 +00:00
|
|
|
|
2021-07-30 17:03:26 +00:00
|
|
|
// 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 ;};};
|
2020-11-09 01:00:18 +00:00
|
|
|
|
2021-05-31 16:22:30 +00:00
|
|
|
// SetWidth sets the line width, MS products treat zero as the minimum width
|
|
|
|
// that can be displayed.
|
2021-07-30 17:03:26 +00:00
|
|
|
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 };
|