mirror of
https://github.com/unidoc/unioffice.git
synced 2025-04-25 13:48:53 +08:00
127 lines
9.3 KiB
Go
127 lines
9.3 KiB
Go
//
|
|
// 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";_d "github.com/unidoc/unioffice/color";_e "github.com/unidoc/unioffice/measurement";_g "github.com/unidoc/unioffice/schema/soo/dml";);func (_ab LineProperties )clearFill (){_ab ._dd .NoFill =nil ;_ab ._dd .GradFill =nil ;_ab ._dd .SolidFill =nil ;_ab ._dd .PattFill =nil ;};
|
|
|
|
// MakeParagraphProperties constructs a new ParagraphProperties wrapper.
|
|
func MakeParagraphProperties (x *_g .CT_TextParagraphProperties )ParagraphProperties {return ParagraphProperties {x };};
|
|
|
|
// LineJoin is the type of line join
|
|
type LineJoin byte ;
|
|
|
|
// SetWidth sets the line width, MS products treat zero as the minimum width
|
|
// that can be displayed.
|
|
func (_ae LineProperties )SetWidth (w _e .Distance ){_ae ._dd .WAttr =_a .Int32 (int32 (w /_e .EMU ))};
|
|
|
|
// SetPosition sets the position of the shape.
|
|
func (_abg ShapeProperties )SetPosition (x ,y _e .Distance ){_abg .ensureXfrm ();if _abg ._ee .Xfrm .Off ==nil {_abg ._ee .Xfrm .Off =_g .NewCT_Point2D ();};_abg ._ee .Xfrm .Off .XAttr .ST_CoordinateUnqualified =_a .Int64 (int64 (x /_e .EMU ));_abg ._ee .Xfrm .Off .YAttr .ST_CoordinateUnqualified =_a .Int64 (int64 (y /_e .EMU ));};
|
|
|
|
// GetPosition gets the position of the shape in EMU.
|
|
func (_gee ShapeProperties )GetPosition ()(int64 ,int64 ){_gee .ensureXfrm ();if _gee ._ee .Xfrm .Off ==nil {_gee ._ee .Xfrm .Off =_g .NewCT_Point2D ();};return *_gee ._ee .Xfrm .Off .XAttr .ST_CoordinateUnqualified ,*_gee ._ee .Xfrm .Off .YAttr .ST_CoordinateUnqualified ;};const (LineJoinRound LineJoin =iota ;LineJoinBevel ;LineJoinMiter ;);func (_ef LineProperties )SetSolidFill (c _d .Color ){_ef .clearFill ();_ef ._dd .SolidFill =_g .NewCT_SolidColorFillProperties ();_ef ._dd .SolidFill .SrgbClr =_g .NewCT_SRgbColor ();_ef ._dd .SolidFill .SrgbClr .ValAttr =*c .AsRGBString ();};
|
|
|
|
// X returns the inner wrapped XML type.
|
|
func (_dde LineProperties )X ()*_g .CT_LineProperties {return _dde ._dd };
|
|
|
|
// Properties returns the paragraph properties.
|
|
func (_db Paragraph )Properties ()ParagraphProperties {if _db ._eb .PPr ==nil {_db ._eb .PPr =_g .NewCT_TextParagraphProperties ();};return MakeParagraphProperties (_db ._eb .PPr );};
|
|
|
|
// SetLevel sets the level of indentation of a paragraph.
|
|
func (_c ParagraphProperties )SetLevel (idx int32 ){_c ._af .LvlAttr =_a .Int32 (idx )};
|
|
|
|
// SetSize sets the font size of the run text
|
|
func (_cb RunProperties )SetSize (sz _e .Distance ){_cb ._ca .SzAttr =_a .Int32 (int32 (sz /_e .HundredthPoint ));};
|
|
|
|
// SetBold controls the bolding of a run.
|
|
func (_be RunProperties )SetBold (b bool ){_be ._ca .BAttr =_a .Bool (b )};
|
|
|
|
// X returns the inner wrapped XML type.
|
|
func (_aag Run )X ()*_g .EG_TextRun {return _aag ._fc };func (_dbc ShapeProperties )ensureXfrm (){if _dbc ._ee .Xfrm ==nil {_dbc ._ee .Xfrm =_g .NewCT_Transform2D ();};};
|
|
|
|
// SetAlign controls the paragraph alignment
|
|
func (_efb ParagraphProperties )SetAlign (a _g .ST_TextAlignType ){_efb ._af .AlgnAttr =a };
|
|
|
|
// RunProperties controls the run properties.
|
|
type RunProperties struct{_ca *_g .CT_TextCharacterProperties ;};func (_da LineProperties )SetNoFill (){_da .clearFill ();_da ._dd .NoFill =_g .NewCT_NoFillProperties ()};
|
|
|
|
// X returns the inner wrapped XML type.
|
|
func (_bf ParagraphProperties )X ()*_g .CT_TextParagraphProperties {return _bf ._af };
|
|
|
|
// X returns the inner wrapped XML type.
|
|
func (_eeg ShapeProperties )X ()*_g .CT_ShapeProperties {return _eeg ._ee };
|
|
|
|
// MakeRun constructs a new Run wrapper.
|
|
func MakeRun (x *_g .EG_TextRun )Run {return Run {x }};
|
|
|
|
// SetFlipHorizontal controls if the shape is flipped horizontally.
|
|
func (_ac ShapeProperties )SetFlipHorizontal (b bool ){_ac .ensureXfrm ();if !b {_ac ._ee .Xfrm .FlipHAttr =nil ;}else {_ac ._ee .Xfrm .FlipHAttr =_a .Bool (true );};};
|
|
|
|
// Paragraph is a paragraph within a document.
|
|
type Paragraph struct{_eb *_g .CT_TextParagraph };
|
|
|
|
// SetSolidFill controls the text color of a run.
|
|
func (_baf RunProperties )SetSolidFill (c _d .Color ){_baf ._ca .NoFill =nil ;_baf ._ca .BlipFill =nil ;_baf ._ca .GradFill =nil ;_baf ._ca .GrpFill =nil ;_baf ._ca .PattFill =nil ;_baf ._ca .SolidFill =_g .NewCT_SolidColorFillProperties ();_baf ._ca .SolidFill .SrgbClr =_g .NewCT_SRgbColor ();_baf ._ca .SolidFill .SrgbClr .ValAttr =*c .AsRGBString ();};
|
|
|
|
// MakeParagraph constructs a new paragraph wrapper.
|
|
func MakeParagraph (x *_g .CT_TextParagraph )Paragraph {return Paragraph {x }};
|
|
|
|
// SetFont controls the font of a run.
|
|
func (_bfe RunProperties )SetFont (s string ){_bfe ._ca .Latin =_g .NewCT_TextFont ();_bfe ._ca .Latin .TypefaceAttr =s ;};
|
|
|
|
// Properties returns the run's properties.
|
|
func (_cc Run )Properties ()RunProperties {if _cc ._fc .R ==nil {_cc ._fc .R =_g .NewCT_RegularTextRun ();};if _cc ._fc .R .RPr ==nil {_cc ._fc .R .RPr =_g .NewCT_TextCharacterProperties ();};return RunProperties {_cc ._fc .R .RPr };};type ShapeProperties struct{_ee *_g .CT_ShapeProperties };
|
|
|
|
// X returns the inner wrapped XML type.
|
|
func (_gg Paragraph )X ()*_g .CT_TextParagraph {return _gg ._eb };
|
|
|
|
// SetHeight sets the height of the shape.
|
|
func (_dce ShapeProperties )SetHeight (h _e .Distance ){_dce .ensureXfrm ();if _dce ._ee .Xfrm .Ext ==nil {_dce ._ee .Xfrm .Ext =_g .NewCT_PositiveSize2D ();};_dce ._ee .Xfrm .Ext .CyAttr =int64 (h /_e .EMU );};
|
|
|
|
// AddBreak adds a new line break to a paragraph.
|
|
func (_gf Paragraph )AddBreak (){_f :=_g .NewEG_TextRun ();_f .Br =_g .NewCT_TextLineBreak ();_gf ._eb .EG_TextRun =append (_gf ._eb .EG_TextRun ,_f );};
|
|
|
|
// SetGeometry sets the shape type of the shape
|
|
func (_bd ShapeProperties )SetGeometry (g _g .ST_ShapeType ){if _bd ._ee .PrstGeom ==nil {_bd ._ee .PrstGeom =_g .NewCT_PresetGeometry2D ();};_bd ._ee .PrstGeom .PrstAttr =g ;};func (_dcb ShapeProperties )clearFill (){_dcb ._ee .NoFill =nil ;_dcb ._ee .BlipFill =nil ;_dcb ._ee .GradFill =nil ;_dcb ._ee .GrpFill =nil ;_dcb ._ee .SolidFill =nil ;_dcb ._ee .PattFill =nil ;};func (_fg ShapeProperties )SetNoFill (){_fg .clearFill ();_fg ._ee .NoFill =_g .NewCT_NoFillProperties ()};
|
|
|
|
// MakeRunProperties constructs a new RunProperties wrapper.
|
|
func MakeRunProperties (x *_g .CT_TextCharacterProperties )RunProperties {return RunProperties {x }};
|
|
|
|
// Run is a run within a paragraph.
|
|
type Run struct{_fc *_g .EG_TextRun };
|
|
|
|
// SetSize sets the width and height of the shape.
|
|
func (_eg ShapeProperties )SetSize (w ,h _e .Distance ){_eg .SetWidth (w );_eg .SetHeight (h )};
|
|
|
|
// SetText sets the run's text contents.
|
|
func (_fa Run )SetText (s string ){_fa ._fc .Br =nil ;_fa ._fc .Fld =nil ;if _fa ._fc .R ==nil {_fa ._fc .R =_g .NewCT_RegularTextRun ();};_fa ._fc .R .T =s ;};
|
|
|
|
// SetBulletFont controls the font for the bullet character.
|
|
func (_bc ParagraphProperties )SetBulletFont (f string ){if f ==""{_bc ._af .BuFont =nil ;}else {_bc ._af .BuFont =_g .NewCT_TextFont ();_bc ._af .BuFont .TypefaceAttr =f ;};};
|
|
|
|
// SetJoin sets the line join style.
|
|
func (_aa LineProperties )SetJoin (e LineJoin ){_aa ._dd .Round =nil ;_aa ._dd .Miter =nil ;_aa ._dd .Bevel =nil ;switch e {case LineJoinRound :_aa ._dd .Round =_g .NewCT_LineJoinRound ();case LineJoinBevel :_aa ._dd .Bevel =_g .NewCT_LineJoinBevel ();case LineJoinMiter :_aa ._dd .Miter =_g .NewCT_LineJoinMiterProperties ();};};
|
|
|
|
// SetBulletChar sets the bullet character for the paragraph.
|
|
func (_ge ParagraphProperties )SetBulletChar (c string ){if c ==""{_ge ._af .BuChar =nil ;}else {_ge ._af .BuChar =_g .NewCT_TextCharBullet ();_ge ._af .BuChar .CharAttr =c ;};};type LineProperties struct{_dd *_g .CT_LineProperties };func MakeShapeProperties (x *_g .CT_ShapeProperties )ShapeProperties {return ShapeProperties {x }};
|
|
|
|
// ParagraphProperties allows controlling paragraph properties.
|
|
type ParagraphProperties struct{_af *_g .CT_TextParagraphProperties ;};
|
|
|
|
// SetWidth sets the width of the shape.
|
|
func (_gd ShapeProperties )SetWidth (w _e .Distance ){_gd .ensureXfrm ();if _gd ._ee .Xfrm .Ext ==nil {_gd ._ee .Xfrm .Ext =_g .NewCT_PositiveSize2D ();};_gd ._ee .Xfrm .Ext .CxAttr =int64 (w /_e .EMU );};
|
|
|
|
// AddRun adds a new run to a paragraph.
|
|
func (_ba Paragraph )AddRun ()Run {_dc :=MakeRun (_g .NewEG_TextRun ());_ba ._eb .EG_TextRun =append (_ba ._eb .EG_TextRun ,_dc .X ());return _dc ;};func (_dab ShapeProperties )SetSolidFill (c _d .Color ){_dab .clearFill ();_dab ._ee .SolidFill =_g .NewCT_SolidColorFillProperties ();_dab ._ee .SolidFill .SrgbClr =_g .NewCT_SRgbColor ();_dab ._ee .SolidFill .SrgbClr .ValAttr =*c .AsRGBString ();};
|
|
|
|
// SetNumbered controls if bullets are numbered or not.
|
|
func (_gb ParagraphProperties )SetNumbered (scheme _g .ST_TextAutonumberScheme ){if scheme ==_g .ST_TextAutonumberSchemeUnset {_gb ._af .BuAutoNum =nil ;}else {_gb ._af .BuAutoNum =_g .NewCT_TextAutonumberBullet ();_gb ._af .BuAutoNum .TypeAttr =scheme ;};};
|
|
|
|
// SetFlipVertical controls if the shape is flipped vertically.
|
|
func (_bag ShapeProperties )SetFlipVertical (b bool ){_bag .ensureXfrm ();if !b {_bag ._ee .Xfrm .FlipVAttr =nil ;}else {_bag ._ee .Xfrm .FlipVAttr =_a .Bool (true );};};func (_de ShapeProperties )LineProperties ()LineProperties {if _de ._ee .Ln ==nil {_de ._ee .Ln =_g .NewCT_LineProperties ();};return LineProperties {_de ._ee .Ln };}; |