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/
|
|
|
|
|
2022-02-05 13:05:36 +00:00
|
|
|
package vmldrawing ;import (_fe "encoding/xml";_fa "fmt";_b "github.com/unidoc/unioffice";_d "github.com/unidoc/unioffice/schema/soo/ofc/sharedTypes";_bb "github.com/unidoc/unioffice/schema/urn/schemas_microsoft_com/office/excel";_a "github.com/unidoc/unioffice/schema/urn/schemas_microsoft_com/vml";_g "strconv";_e "strings";);
|
2021-07-30 17:03:26 +00:00
|
|
|
|
2022-02-05 13:05:36 +00:00
|
|
|
// FontFamily returns fontFamily of the text.
|
|
|
|
func (_ea *TextpathStyle )FontFamily ()string {return _ea ._afc };
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2022-02-05 13:05:36 +00:00
|
|
|
// ShapeStyle is style attribute of v:shape element.
|
|
|
|
type ShapeStyle struct{_ec string ;_dg int64 ;_c int64 ;_cf int64 ;_bg int64 ;_afe int64 ;_ecg string ;_bcgf string ;_aga string ;_aad string ;};
|
2021-07-30 17:03:26 +00:00
|
|
|
|
2021-11-10 11:45:21 +00:00
|
|
|
// IsBold returns true if text is bold.
|
2022-02-05 13:05:36 +00:00
|
|
|
func (_fcc *TextpathStyle )IsBold ()bool {return _fcc ._gad };type Container struct{Layout *_a .OfcShapelayout ;ShapeType *_a .Shapetype ;Shape []*_a .Shape ;};
|
2021-07-30 17:03:26 +00:00
|
|
|
|
2022-02-05 13:05:36 +00:00
|
|
|
// SetFontFamily sets text's fontFamily.
|
|
|
|
func (_bac *TextpathStyle )SetFontFamily (fontFamily string ){_bac ._afc =fontFamily };
|
2021-07-30 17:03:26 +00:00
|
|
|
|
2022-02-05 13:05:36 +00:00
|
|
|
// NewCommentDrawing constructs a new comment drawing.
|
|
|
|
func NewCommentDrawing ()*Container {_bc :=NewContainer ();_bc .Layout =_a .NewOfcShapelayout ();_bc .Layout .ExtAttr =_a .ST_ExtEdit ;_bc .Layout .Idmap =_a .NewOfcCT_IdMap ();_bc .Layout .Idmap .DataAttr =_b .String ("\u0031");_bc .Layout .Idmap .ExtAttr =_a .ST_ExtEdit ;_bc .ShapeType =_a .NewShapetype ();_bc .ShapeType .IdAttr =_b .String ("_\u0078\u0030\u0030\u0030\u0030\u005f\u0074\u0032\u0030\u0032");_bc .ShapeType .CoordsizeAttr =_b .String ("2\u0031\u0036\u0030\u0030\u002c\u0032\u0031\u0036\u0030\u0030");_bc .ShapeType .SptAttr =_b .Float32 (202);_bc .ShapeType .PathAttr =_b .String ("\u006d\u0030\u002c0l\u0030\u002c\u0032\u0031\u0036\u0030\u0030\u002c\u00321\u00360\u0030,\u00321\u0036\u0030\u0030\u002c\u0032\u0031\u0036\u0030\u0030\u002c\u0030\u0078\u0065");_fd :=_a .NewEG_ShapeElements ();_bc .ShapeType .EG_ShapeElements =append (_bc .ShapeType .EG_ShapeElements ,_fd );_fd .Path =_a .NewPath ();_fd .Path .GradientshapeokAttr =_d .ST_TrueFalseT ;_fd .Path .ConnecttypeAttr =_a .OfcST_ConnectTypeRect ;return _bc ;};func NewContainer ()*Container {return &Container {}};
|
2022-01-15 21:17:38 +00:00
|
|
|
|
2022-02-05 13:05:36 +00:00
|
|
|
// Height return height of shape.
|
|
|
|
func (_gc *ShapeStyle )Height ()int64 {return _gc ._bg };
|
2022-01-15 21:17:38 +00:00
|
|
|
|
2022-02-05 13:05:36 +00:00
|
|
|
// FontSize returns fontSize of the text.
|
|
|
|
func (_gb *TextpathStyle )FontSize ()int64 {return _gb ._eff };
|
2021-07-30 17:03:26 +00:00
|
|
|
|
2021-11-10 11:45:21 +00:00
|
|
|
// ToString formatting ShapeStyle to string.
|
2022-02-05 13:05:36 +00:00
|
|
|
func (_bca *ShapeStyle )String ()string {_cd :="";_cd +=_fa .Sprintf ("\u0070\u006f\u0073i\u0074\u0069\u006f\u006e\u003a\u0025\u0073\u003b",_bca ._ec );_cd +=_fa .Sprintf ("\u006da\u0072g\u0069\u006e\u002d\u006c\u0065\u0066\u0074\u003a\u0025\u0064\u003b",_bca ._dg );_cd +=_fa .Sprintf ("\u006d\u0061\u0072\u0067\u0069\u006e\u002d\u0074\u006fp\u003a\u0025\u0064\u003b",_bca ._c );_cd +=_fa .Sprintf ("w\u0069\u0064\u0074\u0068\u003a\u0025\u0064\u0070\u0074\u003b",_bca ._cf );_cd +=_fa .Sprintf ("\u0068\u0065\u0069g\u0068\u0074\u003a\u0025\u0064\u0070\u0074\u003b",_bca ._bg );_cd +=_fa .Sprintf ("z\u002d\u0069\u006e\u0064\u0065\u0078\u003a\u0025\u0064\u003b",_bca ._afe );_cd +=_fa .Sprintf ("m\u0073\u006f\u002d\u0070\u006f\u0073i\u0074\u0069\u006f\u006e\u002d\u0068\u006f\u0072\u0069z\u006f\u006e\u0074a\u006c:\u0025\u0073\u003b",_bca ._ecg );_cd +=_fa .Sprintf ("\u006d\u0073o-\u0070\u006f\u0073i\u0074\u0069\u006f\u006e-ho\u0072iz\u006f\u006e\u0074\u0061\u006c\u002d\u0072el\u0061\u0074\u0069\u0076\u0065\u003a\u0025s\u003b",_bca ._bcgf );_cd +=_fa .Sprintf ("\u006ds\u006f\u002d\u0070\u006fs\u0069\u0074\u0069\u006f\u006e-\u0076e\u0072t\u0069\u0063\u0061\u006c\u003a\u0025\u0073;",_bca ._aga );_cd +=_fa .Sprintf ("\u006d\u0073\u006f-p\u006f\u0073\u0069\u0074\u0069\u006f\u006e\u002d\u0076e\u0072t\u0069c\u0061l\u002d\u0072\u0065\u006c\u0061\u0074\u0069\u0076\u0065\u003a\u0025\u0073\u003b",_bca ._aad );return _cd ;};func (_af *Container )MarshalXML (e *_fe .Encoder ,start _fe .StartElement )error {start .Attr =append (start .Attr ,_fe .Attr {Name :_fe .Name {Local :"\u0078m\u006c\u006e\u0073\u003a\u0076"},Value :"\u0075\u0072n\u003a\u0073\u0063\u0068\u0065\u006d\u0061\u0073\u002d\u006d\u0069\u0063\u0072\u006f\u0073\u006f\u0066\u0074\u002d\u0063\u006f\u006d:v\u006d\u006c"});start .Attr =append (start .Attr ,_fe .Attr {Name :_fe .Name {Local :"\u0078m\u006c\u006e\u0073\u003a\u006f"},Value :"\u0075\u0072\u006e\u003a\u0073\u0063\u0068\u0065\u006d\u0061\u0073\u002d\u006di\u0063\u0072\u006f\u0073\u006f\u0066t\u002d\u0063\u006f\u006d\u003a\u006f\u0066\u0066\u0069\u0063\u0065\u003a\u006ff\u0066\u0069\u0063\u0065"});start .Attr =append (start .Attr ,_fe .Attr {Name :_fe .Name {Local :"\u0078m\u006c\u006e\u0073\u003a\u0078"},Value :"\u0075\u0072\u006e\u003a\u0073\u0063\u0068\u0065\u006d\u0061\u0073\u002d\u006d\u0069\u0063\u0072\u006f\u0073\u006f\u0066\u0074\u002d\u0063\u006fm\u003a\u006f\u0066\u0066\u0069c\u0065\u003ae\u0078\u0063\u0065\u006c"});start .Name .Local ="\u0078\u006d\u006c";e .EncodeToken (start );if _af .Layout !=nil {_ge :=_fe .StartElement {Name :_fe .Name {Local :"\u006f\u003a\u0073\u0068\u0061\u0070\u0065\u006c\u0061\u0079\u006f\u0075\u0074"}};e .EncodeElement (_af .Layout ,_ge );};if _af .ShapeType !=nil {_beg :=_fe .StartElement {Name :_fe .Name {Local :"v\u003a\u0073\u0068\u0061\u0070\u0065\u0074\u0079\u0070\u0065"}};e .EncodeElement (_af .ShapeType ,_beg );};for _ ,_ag :=range _af .Shape {_ef :=_fe .StartElement {Name :_fe .Name {Local :"\u0076:\u0073\u0068\u0061\u0070\u0065"}};e .EncodeElement (_ag ,_ef );};return e .EncodeToken (_fe .EndElement {Name :start .Name });};
|
2022-01-15 21:17:38 +00:00
|
|
|
|
2022-02-05 13:05:36 +00:00
|
|
|
// SetWidth set width of shape.
|
|
|
|
func (_fdg *ShapeStyle )SetWidth (width int64 ){_fdg ._cf =width };
|
2021-07-30 17:03:26 +00:00
|
|
|
|
2021-09-22 16:41:01 +00:00
|
|
|
// NewCommentShape creates a new comment shape for a given cell index. The
|
|
|
|
// indices here are zero based.
|
2022-02-05 13:05:36 +00:00
|
|
|
func NewCommentShape (col ,row int64 )*_a .Shape {_be :=_a .NewShape ();_be .IdAttr =_b .String (_fa .Sprintf ("\u0063\u0073\u005f\u0025\u0064\u005f\u0025\u0064",col ,row ));_be .TypeAttr =_b .String ("\u0023\u005f\u00780\u0030\u0030\u0030\u005f\u0074\u0032\u0030\u0032");_be .StyleAttr =_b .String ("\u0070\u006f\u0073i\u0074\u0069\u006f\u006e\u003a\u0061\u0062\u0073\u006f\u006cu\u0074\u0065\u003b\u006d\u0061\u0072\u0067\u0069\u006e\u002d\u006c\u0065\u0066\u0074:\u0038\u0030\u0070\u0074;\u006d\u0061\u0072\u0067\u0069n-\u0074o\u0070\u003a\u0032pt\u003b\u0077\u0069\u0064\u0074\u0068\u003a1\u0030\u0034\u0070\u0074\u003b\u0068\u0065\u0069\u0067\u0068\u0074\u003a\u0037\u0036\u0070\u0074\u003b\u007a\u002d\u0069\u006e\u0064\u0065x\u003a\u0031\u003bv\u0069\u0073\u0069\u0062\u0069\u006c\u0069t\u0079\u003a\u0068\u0069\u0064\u0064\u0065\u006e");_be .FillcolorAttr =_b .String ("\u0023f\u0062\u0066\u0036\u0064\u0036");_be .StrokecolorAttr =_b .String ("\u0023e\u0064\u0065\u0061\u0061\u0031");_ga :=_a .NewEG_ShapeElements ();_ga .Fill =_a .NewFill ();_ga .Fill .Color2Attr =_b .String ("\u0023f\u0062\u0066\u0065\u0038\u0032");_ga .Fill .AngleAttr =_b .Float64 (-180);_ga .Fill .TypeAttr =_a .ST_FillTypeGradient ;_ga .Fill .Fill =_a .NewOfcFill ();_ga .Fill .Fill .ExtAttr =_a .ST_ExtView ;_ga .Fill .Fill .TypeAttr =_a .OfcST_FillTypeGradientUnscaled ;_be .EG_ShapeElements =append (_be .EG_ShapeElements ,_ga );_ba :=_a .NewEG_ShapeElements ();_ba .Shadow =_a .NewShadow ();_ba .Shadow .OnAttr =_d .ST_TrueFalseT ;_ba .Shadow .ObscuredAttr =_d .ST_TrueFalseT ;_be .EG_ShapeElements =append (_be .EG_ShapeElements ,_ba );_dd :=_a .NewEG_ShapeElements ();_dd .Path =_a .NewPath ();_dd .Path .ConnecttypeAttr =_a .OfcST_ConnectTypeNone ;_be .EG_ShapeElements =append (_be .EG_ShapeElements ,_dd );_ddf :=_a .NewEG_ShapeElements ();_ddf .Textbox =_a .NewTextbox ();_ddf .Textbox .StyleAttr =_b .String ("\u006d\u0073\u006f\u002ddi\u0072\u0065\u0063\u0074\u0069\u006f\u006e\u002d\u0061\u006c\u0074\u003a\u0061\u0075t\u006f");_be .EG_ShapeElements =append (_be .EG_ShapeElements ,_ddf );_de :=_a .NewEG_ShapeElements ();_de .ClientData =_bb .NewClientData ();_de .ClientData .ObjectTypeAttr =_bb .ST_ObjectTypeNote ;_de .ClientData .MoveWithCells =_d .ST_TrueFalseBlankT ;_de .ClientData .SizeWithCells =_d .ST_TrueFalseBlankT ;_de .ClientData .Anchor =_b .String ("\u0031,\u0020\u0031\u0035\u002c\u0020\u0030\u002c\u0020\u0032\u002c\u00202\u002c\u0020\u0035\u0034\u002c\u0020\u0035\u002c\u0020\u0033");_de .ClientData .AutoFill =_d .ST_TrueFalseBlankFalse ;_de .ClientData .Row =_b .Int64 (row );_de .ClientData .Column =_b .Int64 (col );_be .EG_ShapeElements =append (_be .EG_ShapeElements ,_de );return _be ;};
|
|
|
|
|
|
|
|
// ToString generate string of TextpathStyle.
|
|
|
|
func (_ged *TextpathStyle )String ()string {_aab :="";_aab +=_fa .Sprintf ("\u0066o\u006et\u002d\u0066\u0061\u006d\u0069\u006c\u0079\u003a\u0025\u0073\u003b",_ged ._afc );_aab +=_fa .Sprintf ("\u0066o\u006et\u002d\u0073\u0069\u007a\u0065\u003a\u0025\u0064\u0070\u0074\u003b",_ged ._eff );if _ged ._bd {_aab +=_fa .Sprintf ("\u0066o\u006et\u002d\u0073\u0074\u0079\u006ce\u003a\u0069t\u0061\u006c\u0069\u0063\u003b");};if _ged ._gad {_aab +=_fa .Sprintf ("\u0066\u006f\u006e\u0074\u002d\u0077\u0065\u0069\u0067\u0068\u0074\u003ab\u006f\u006c\u0064\u003b");};return _aab ;};
|
|
|
|
|
|
|
|
// NewTextpathStyle accept value of string style attribute of element v:textpath and format it to generate TextpathStyle.
|
|
|
|
func NewTextpathStyle (style string )TextpathStyle {_baa :=TextpathStyle {_afc :"\u0022C\u0061\u006c\u0069\u0062\u0072\u0069\"",_eff :44,_gad :false ,_bd :false };_ab :=_e .Split (style ,"\u003b");for _ ,_gdd :=range _ab {_dcf :=_e .Split (_gdd ,"\u003a");if len (_dcf )!=2{continue ;};switch _dcf [0]{case "f\u006f\u006e\u0074\u002d\u0066\u0061\u006d\u0069\u006c\u0079":_baa ._afc =_dcf [1];break ;case "\u0066o\u006e\u0074\u002d\u0073\u0069\u007ae":_baa ._eff ,_ =_g .ParseInt (_e .ReplaceAll (_dcf [1],"\u0070\u0074",""),10,64);break ;case "f\u006f\u006e\u0074\u002d\u0077\u0065\u0069\u0067\u0068\u0074":_baa ._gad =_dcf [1]=="\u0062\u006f\u006c\u0064";break ;case "\u0066\u006f\u006e\u0074\u002d\u0073\u0074\u0079\u006c\u0065":_baa ._bd =_dcf [1]=="\u0069\u0074\u0061\u006c\u0069\u0063";break ;};};return _baa ;};
|
2021-07-30 17:03:26 +00:00
|
|
|
|
2022-01-15 21:17:38 +00:00
|
|
|
// Width return width of shape.
|
2022-02-05 13:05:36 +00:00
|
|
|
func (_dbc *ShapeStyle )Width ()int64 {return _dbc ._cf };
|
2021-07-30 17:03:26 +00:00
|
|
|
|
2022-02-05 13:05:36 +00:00
|
|
|
// SetHeight set height of shape.
|
|
|
|
func (_fc *ShapeStyle )SetHeight (height int64 ){_fc ._bg =height };
|
2021-08-23 20:44:48 +00:00
|
|
|
|
2022-02-05 13:05:36 +00:00
|
|
|
// CreateFormula creates F element for typeFormulas.
|
|
|
|
func CreateFormula (s string )*_a .CT_F {_gf :=_a .NewCT_F ();_gf .EqnAttr =&s ;return _gf };
|
2021-07-30 17:03:26 +00:00
|
|
|
|
2022-02-05 13:05:36 +00:00
|
|
|
// IsItalic returns true if text is italic.
|
|
|
|
func (_cag *TextpathStyle )IsItalic ()bool {return _cag ._bd };
|
2021-07-30 17:03:26 +00:00
|
|
|
|
2022-02-05 13:05:36 +00:00
|
|
|
// TextpathStyle is style attribute of element v:textpath.
|
|
|
|
type TextpathStyle struct{_afc string ;_eff int64 ;_gad bool ;_bd bool ;};
|
2022-01-15 21:17:38 +00:00
|
|
|
|
2022-02-05 13:05:36 +00:00
|
|
|
// NewShapeStyle accept value of string style attribute in v:shape and format it to generate ShapeStyle.
|
|
|
|
func NewShapeStyle (style string )ShapeStyle {_afb :=ShapeStyle {_cf :0,_bg :0};_dc :=_e .Split (style ,"\u003b");for _ ,_dgc :=range _dc {_db :=_e .Split (_dgc ,"\u003a");if len (_db )!=2{continue ;};switch _db [0]{case "\u0070\u006f\u0073\u0069\u0074\u0069\u006f\u006e":_afb ._ec =_db [1];break ;case "m\u0061\u0072\u0067\u0069\u006e\u002d\u006c\u0065\u0066\u0074":_afb ._dg ,_ =_g .ParseInt (_db [1],10,64);break ;case "\u006d\u0061\u0072\u0067\u0069\u006e\u002d\u0074\u006f\u0070":_afb ._c ,_ =_g .ParseInt (_db [1],10,64);break ;case "\u0077\u0069\u0064t\u0068":_afb ._cf ,_ =_g .ParseInt (_e .ReplaceAll (_db [1],"\u0070\u0074",""),10,64);break ;case "\u0068\u0065\u0069\u0067\u0068\u0074":_afb ._bg ,_ =_g .ParseInt (_e .ReplaceAll (_db [1],"\u0070\u0074",""),10,64);break ;case "\u007a-\u0069\u006e\u0064\u0065\u0078":_afb ._afe ,_ =_g .ParseInt (_db [1],10,64);break ;case "\u006d\u0073\u006f-p\u006f\u0073\u0069\u0074\u0069\u006f\u006e\u002d\u0068\u006f\u0072\u0069\u007a\u006f\u006e\u0074\u0061\u006c":_afb ._ecg =_db [1];break ;case "\u006d\u0073\u006f\u002d\u0070\u006f\u0073\u0069\u0074\u0069\u006f\u006e\u002d\u0068\u006fr\u0069z\u006f\u006e\u0074\u0061\u006c\u002d\u0072\u0065\u006c\u0061\u0074\u0069\u0076\u0065":_afb ._bcgf =_db [1];break ;case "m\u0073\u006f\u002d\u0070os\u0069t\u0069\u006f\u006e\u002d\u0076e\u0072\u0074\u0069\u0063\u0061\u006c":_afb ._aga =_db [1];break ;case "\u006d\u0073\u006f\u002d\u0070\u006f\u0073\u0069\u0074\u0069o\u006e\u002d\u0076\u0065\u0072\u0074\u0069c\u0061\u006c\u002d\u0072\u0065\u006c\u0061\u0074\u0069\u0076\u0065":_afb ._aad =_db [1];break ;};};return _afb ;};func (_aa *Container )UnmarshalXML (d *_fe .Decoder ,start _fe .StartElement )error {_aa .Shape =nil ;_df :for {_ae ,_bef :=d .Token ();if _bef !=nil {return _bef ;};switch _bcg :=_ae .(type ){case _fe .StartElement :switch _bcg .Name .Local {case "s\u0068\u0061\u0070\u0065\u006c\u0061\u0079\u006f\u0075\u0074":_aa .Layout =_a .NewOfcShapelayout ();if _bf :=d .DecodeElement (_aa .Layout ,&_bcg );_bf !=nil {return _bf ;};case "\u0073h\u0061\u0070\u0065\u0074\u0079\u0070e":_aa .ShapeType =_a .NewShapetype ();if _bbg :=d .DecodeElement (_aa .ShapeType ,&_bcg );_bbg !=nil {return _bbg ;};case "\u0073\u0068\u0061p\u0065":_gd :=_a .NewShape ();if _ddg :=d .DecodeElement (_gd ,&_bcg );_ddg !=nil {return _ddg ;};_aa .Shape =append (_aa .Shape ,_gd );};case _fe .EndElement :break _df ;};};return nil ;};
|
2022-01-15 21:17:38 +00:00
|
|
|
|
2022-02-05 13:05:36 +00:00
|
|
|
// SetBold sets text to bold.
|
|
|
|
func (_fafa *TextpathStyle )SetBold (bold bool ){_fafa ._gad =bold };
|
2022-01-15 21:17:38 +00:00
|
|
|
|
|
|
|
// SetItalic sets text to italic.
|
2022-02-05 13:05:36 +00:00
|
|
|
func (_bdb *TextpathStyle )SetItalic (italic bool ){_bdb ._bd =italic };
|
|
|
|
|
|
|
|
// SetFontSize sets text's fontSize.
|
|
|
|
func (_ff *TextpathStyle )SetFontSize (fontSize int64 ){_ff ._eff =fontSize };
|