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-09-22 16:41:01 +00:00
|
|
|
package vmldrawing ;import (_d "encoding/xml";_g "fmt";_ga "github.com/unidoc/unioffice";_ee "github.com/unidoc/unioffice/schema/soo/ofc/sharedTypes";_f "github.com/unidoc/unioffice/schema/urn/schemas_microsoft_com/office/excel";_dd "github.com/unidoc/unioffice/schema/urn/schemas_microsoft_com/vml";_a "strconv";_ec "strings";);
|
2021-07-30 17:03:26 +00:00
|
|
|
|
2021-09-22 16:41:01 +00:00
|
|
|
// SetFontSize sets text's fontSize.
|
|
|
|
func (_bcg *TextpathStyle )SetFontSize (fontSize int64 ){_bcg ._ac =fontSize };
|
2021-07-30 17:03:26 +00:00
|
|
|
|
2021-09-22 16:41:01 +00:00
|
|
|
// Width return width of shape.
|
|
|
|
func (_bcd *ShapeStyle )Width ()int64 {return _bcd ._cc };
|
2021-07-30 17:03:26 +00:00
|
|
|
|
2021-09-22 16:41:01 +00:00
|
|
|
// TextpathStyle is style attribute of element v:textpath.
|
|
|
|
type TextpathStyle struct{_dcf string ;_ac int64 ;_bce bool ;_cf bool ;};
|
2021-07-30 17:03:26 +00:00
|
|
|
|
2021-09-22 16:41:01 +00:00
|
|
|
// SetBold sets text to bold.
|
|
|
|
func (_cff *TextpathStyle )SetBold (bold bool ){_cff ._bce =bold };
|
2021-08-23 20:44:48 +00:00
|
|
|
|
2021-09-22 16:41:01 +00:00
|
|
|
// CreateFormula creates F element for typeFormulas.
|
|
|
|
func CreateFormula (s string )*_dd .CT_F {_ae :=_dd .NewCT_F ();_ae .EqnAttr =&s ;return _ae };func (_fa *Container )MarshalXML (e *_d .Encoder ,start _d .StartElement )error {start .Attr =append (start .Attr ,_d .Attr {Name :_d .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 ,_d .Attr {Name :_d .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 ,_d .Attr {Name :_d .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 _fa .Layout !=nil {_fb :=_d .StartElement {Name :_d .Name {Local :"\u006f\u003a\u0073\u0068\u0061\u0070\u0065\u006c\u0061\u0079\u006f\u0075\u0074"}};e .EncodeElement (_fa .Layout ,_fb );};if _fa .ShapeType !=nil {_bb :=_d .StartElement {Name :_d .Name {Local :"v\u003a\u0073\u0068\u0061\u0070\u0065\u0074\u0079\u0070\u0065"}};e .EncodeElement (_fa .ShapeType ,_bb );};for _ ,_bbb :=range _fa .Shape {_aag :=_d .StartElement {Name :_d .Name {Local :"\u0076:\u0073\u0068\u0061\u0070\u0065"}};e .EncodeElement (_bbb ,_aag );};return e .EncodeToken (_d .EndElement {Name :start .Name });};
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2021-09-22 16:41:01 +00:00
|
|
|
// FontFamily returns fontFamily of the text.
|
|
|
|
func (_cce *TextpathStyle )FontFamily ()string {return _cce ._dcf };
|
2021-07-30 17:03:26 +00:00
|
|
|
|
2021-09-22 16:41:01 +00:00
|
|
|
// Height return height of shape.
|
|
|
|
func (_dbe *ShapeStyle )Height ()int64 {return _dbe ._bc };
|
2021-07-30 17:03:26 +00:00
|
|
|
|
2021-09-22 16:41:01 +00:00
|
|
|
// SetItalic sets text to italic.
|
|
|
|
func (_bge *TextpathStyle )SetItalic (italic bool ){_bge ._cf =italic };func (_afg *Container )UnmarshalXML (d *_d .Decoder ,start _d .StartElement )error {_afg .Shape =nil ;_fc :for {_c ,_da :=d .Token ();if _da !=nil {return _da ;};switch _ddd :=_c .(type ){case _d .StartElement :switch _ddd .Name .Local {case "s\u0068\u0061\u0070\u0065\u006c\u0061\u0079\u006f\u0075\u0074":_afg .Layout =_dd .NewOfcShapelayout ();if _be :=d .DecodeElement (_afg .Layout ,&_ddd );_be !=nil {return _be ;};case "\u0073h\u0061\u0070\u0065\u0074\u0079\u0070e":_afg .ShapeType =_dd .NewShapetype ();if _ce :=d .DecodeElement (_afg .ShapeType ,&_ddd );_ce !=nil {return _ce ;};case "\u0073\u0068\u0061p\u0065":_dg :=_dd .NewShape ();if _dc :=d .DecodeElement (_dg ,&_ddd );_dc !=nil {return _dc ;};_afg .Shape =append (_afg .Shape ,_dg );};case _d .EndElement :break _fc ;};};return nil ;};
|
|
|
|
|
|
|
|
// IsItalic returns true if text is italic.
|
|
|
|
func (_ccg *TextpathStyle )IsItalic ()bool {return _ccg ._cf };
|
2021-07-30 17:03:26 +00:00
|
|
|
|
2021-08-23 20:44:48 +00:00
|
|
|
// SetFontFamily sets text's fontFamily.
|
2021-09-22 16:41:01 +00:00
|
|
|
func (_fdc *TextpathStyle )SetFontFamily (fontFamily string ){_fdc ._dcf =fontFamily };
|
2021-07-30 17:03:26 +00:00
|
|
|
|
2021-09-22 16:41:01 +00:00
|
|
|
// ToString generate string of TextpathStyle.
|
|
|
|
func (_aeb *TextpathStyle )String ()string {_cda :="";_cda +=_g .Sprintf ("\u0066o\u006et\u002d\u0066\u0061\u006d\u0069\u006c\u0079\u003a\u0025\u0073\u003b",_aeb ._dcf );_cda +=_g .Sprintf ("\u0066o\u006et\u002d\u0073\u0069\u007a\u0065\u003a\u0025\u0064\u0070\u0074\u003b",_aeb ._ac );if _aeb ._cf {_cda +=_g .Sprintf ("\u0066o\u006et\u002d\u0073\u0074\u0079\u006ce\u003a\u0069t\u0061\u006c\u0069\u0063\u003b");};if _aeb ._bce {_cda +=_g .Sprintf ("\u0066\u006f\u006e\u0074\u002d\u0077\u0065\u0069\u0067\u0068\u0074\u003ab\u006f\u006c\u0064\u003b");};return _cda ;};
|
2021-07-30 17:03:26 +00:00
|
|
|
|
2021-09-22 16:41:01 +00:00
|
|
|
// NewShapeStyle accept value of string style attribute in v:shape and format it to generate ShapeStyle.
|
|
|
|
func NewShapeStyle (style string )ShapeStyle {_ggg :=ShapeStyle {_cc :0,_bc :0};_afc :=_ec .Split (style ,"\u003b");for _ ,_fac :=range _afc {_ccd :=_ec .Split (_fac ,"\u003a");if len (_ccd )!=2{continue ;};switch _ccd [0]{case "\u0070\u006f\u0073\u0069\u0074\u0069\u006f\u006e":_ggg ._fcg =_ccd [1];break ;case "m\u0061\u0072\u0067\u0069\u006e\u002d\u006c\u0065\u0066\u0074":_ggg ._cb ,_ =_a .ParseInt (_ccd [1],10,64);break ;case "\u006d\u0061\u0072\u0067\u0069\u006e\u002d\u0074\u006f\u0070":_ggg ._de ,_ =_a .ParseInt (_ccd [1],10,64);break ;case "\u0077\u0069\u0064t\u0068":_ggg ._cc ,_ =_a .ParseInt (_ec .ReplaceAll (_ccd [1],"\u0070\u0074",""),10,64);break ;case "\u0068\u0065\u0069\u0067\u0068\u0074":_ggg ._bc ,_ =_a .ParseInt (_ec .ReplaceAll (_ccd [1],"\u0070\u0074",""),10,64);break ;case "\u007a-\u0069\u006e\u0064\u0065\u0078":_ggg ._bdd ,_ =_a .ParseInt (_ccd [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":_ggg ._cg =_ccd [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":_ggg ._gg =_ccd [1];break ;case "m\u0073\u006f\u002d\u0070os\u0069t\u0069\u006f\u006e\u002d\u0076e\u0072\u0074\u0069\u0063\u0061\u006c":_ggg ._cd =_ccd [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":_ggg ._fe =_ccd [1];break ;};};return _ggg ;};type Container struct{Layout *_dd .OfcShapelayout ;ShapeType *_dd .Shapetype ;Shape []*_dd .Shape ;};
|
2021-07-30 17:03:26 +00:00
|
|
|
|
2021-09-22 16:41:01 +00:00
|
|
|
// ToString formatting ShapeStyle to string.
|
|
|
|
func (_bg *ShapeStyle )String ()string {_cbc :="";_cbc +=_g .Sprintf ("\u0070\u006f\u0073i\u0074\u0069\u006f\u006e\u003a\u0025\u0073\u003b",_bg ._fcg );_cbc +=_g .Sprintf ("\u006da\u0072g\u0069\u006e\u002d\u006c\u0065\u0066\u0074\u003a\u0025\u0064\u003b",_bg ._cb );_cbc +=_g .Sprintf ("\u006d\u0061\u0072\u0067\u0069\u006e\u002d\u0074\u006fp\u003a\u0025\u0064\u003b",_bg ._de );_cbc +=_g .Sprintf ("w\u0069\u0064\u0074\u0068\u003a\u0025\u0064\u0070\u0074\u003b",_bg ._cc );_cbc +=_g .Sprintf ("\u0068\u0065\u0069g\u0068\u0074\u003a\u0025\u0064\u0070\u0074\u003b",_bg ._bc );_cbc +=_g .Sprintf ("z\u002d\u0069\u006e\u0064\u0065\u0078\u003a\u0025\u0064\u003b",_bg ._bdd );_cbc +=_g .Sprintf ("m\u0073\u006f\u002d\u0070\u006f\u0073i\u0074\u0069\u006f\u006e\u002d\u0068\u006f\u0072\u0069z\u006f\u006e\u0074a\u006c:\u0025\u0073\u003b",_bg ._cg );_cbc +=_g .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",_bg ._gg );_cbc +=_g .Sprintf ("\u006ds\u006f\u002d\u0070\u006fs\u0069\u0074\u0069\u006f\u006e-\u0076e\u0072t\u0069\u0063\u0061\u006c\u003a\u0025\u0073;",_bg ._cd );_cbc +=_g .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",_bg ._fe );return _cbc ;};
|
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.
|
|
|
|
func NewCommentShape (col ,row int64 )*_dd .Shape {_fd :=_dd .NewShape ();_fd .IdAttr =_ga .String (_g .Sprintf ("\u0063\u0073\u005f\u0025\u0064\u005f\u0025\u0064",col ,row ));_fd .TypeAttr =_ga .String ("\u0023\u005f\u00780\u0030\u0030\u0030\u005f\u0074\u0032\u0030\u0032");_fd .StyleAttr =_ga .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");_fd .FillcolorAttr =_ga .String ("\u0023f\u0062\u0066\u0036\u0064\u0036");_fd .StrokecolorAttr =_ga .String ("\u0023e\u0064\u0065\u0061\u0061\u0031");_aa :=_dd .NewEG_ShapeElements ();_aa .Fill =_dd .NewFill ();_aa .Fill .Color2Attr =_ga .String ("\u0023f\u0062\u0066\u0065\u0038\u0032");_aa .Fill .AngleAttr =_ga .Float64 (-180);_aa .Fill .TypeAttr =_dd .ST_FillTypeGradient ;_aa .Fill .Fill =_dd .NewOfcFill ();_aa .Fill .Fill .ExtAttr =_dd .ST_ExtView ;_aa .Fill .Fill .TypeAttr =_dd .OfcST_FillTypeGradientUnscaled ;_fd .EG_ShapeElements =append (_fd .EG_ShapeElements ,_aa );_b :=_dd .NewEG_ShapeElements ();_b .Shadow =_dd .NewShadow ();_b .Shadow .OnAttr =_ee .ST_TrueFalseT ;_b .Shadow .ObscuredAttr =_ee .ST_TrueFalseT ;_fd .EG_ShapeElements =append (_fd .EG_ShapeElements ,_b );_bd :=_dd .NewEG_ShapeElements ();_bd .Path =_dd .NewPath ();_bd .Path .ConnecttypeAttr =_dd .OfcST_ConnectTypeNone ;_fd .EG_ShapeElements =append (_fd .EG_ShapeElements ,_bd );_db :=_dd .NewEG_ShapeElements ();_db .Textbox =_dd .NewTextbox ();_db .Textbox .StyleAttr =_ga .String ("\u006d\u0073\u006f\u002ddi\u0072\u0065\u0063\u0074\u0069\u006f\u006e\u002d\u0061\u006c\u0074\u003a\u0061\u0075t\u006f");_fd .EG_ShapeElements =append (_fd .EG_ShapeElements ,_db );_eee :=_dd .NewEG_ShapeElements ();_eee .ClientData =_f .NewClientData ();_eee .ClientData .ObjectTypeAttr =_f .ST_ObjectTypeNote ;_eee .ClientData .MoveWithCells =_ee .ST_TrueFalseBlankT ;_eee .ClientData .SizeWithCells =_ee .ST_TrueFalseBlankT ;_eee .ClientData .Anchor =_ga .String ("\u0031,\u0020\u0031\u0035\u002c\u0020\u0030\u002c\u0020\u0032\u002c\u00202\u002c\u0020\u0035\u0034\u002c\u0020\u0035\u002c\u0020\u0033");_eee .ClientData .AutoFill =_ee .ST_TrueFalseBlankFalse ;_eee .ClientData .Row =_ga .Int64 (row );_eee .ClientData .Column =_ga .Int64 (col );_fd .EG_ShapeElements =append (_fd .EG_ShapeElements ,_eee );return _fd ;};
|
2021-07-30 17:03:26 +00:00
|
|
|
|
2021-09-22 16:41:01 +00:00
|
|
|
// SetWidth set width of shape.
|
|
|
|
func (_eag *ShapeStyle )SetWidth (width int64 ){_eag ._cc =width };
|
2021-07-30 17:03:26 +00:00
|
|
|
|
2021-09-22 16:41:01 +00:00
|
|
|
// FontSize returns fontSize of the text.
|
|
|
|
func (_bde *TextpathStyle )FontSize ()int64 {return _bde ._ac };
|
2021-08-23 20:44:48 +00:00
|
|
|
|
2021-09-22 16:41:01 +00:00
|
|
|
// NewTextpathStyle accept value of string style attribute of element v:textpath and format it to generate TextpathStyle.
|
|
|
|
func NewTextpathStyle (style string )TextpathStyle {_aaf :=TextpathStyle {_dcf :"\u0022C\u0061\u006c\u0069\u0062\u0072\u0069\"",_ac :44,_bce :false ,_cf :false };_fbd :=_ec .Split (style ,"\u003b");for _ ,_dad :=range _fbd {_fdg :=_ec .Split (_dad ,"\u003a");if len (_fdg )!=2{continue ;};switch _fdg [0]{case "f\u006f\u006e\u0074\u002d\u0066\u0061\u006d\u0069\u006c\u0079":_aaf ._dcf =_fdg [1];break ;case "\u0066o\u006e\u0074\u002d\u0073\u0069\u007ae":_aaf ._ac ,_ =_a .ParseInt (_ec .ReplaceAll (_fdg [1],"\u0070\u0074",""),10,64);break ;case "f\u006f\u006e\u0074\u002d\u0077\u0065\u0069\u0067\u0068\u0074":_aaf ._bce =_fdg [1]=="\u0062\u006f\u006c\u0064";break ;case "\u0066\u006f\u006e\u0074\u002d\u0073\u0074\u0079\u006c\u0065":_aaf ._cf =_fdg [1]=="\u0069\u0074\u0061\u006c\u0069\u0063";break ;};};return _aaf ;};func NewContainer ()*Container {return &Container {}};
|
2021-08-23 20:44:48 +00:00
|
|
|
|
|
|
|
// SetHeight set height of shape.
|
2021-09-22 16:41:01 +00:00
|
|
|
func (_cdb *ShapeStyle )SetHeight (height int64 ){_cdb ._bc =height };
|
2021-07-30 17:03:26 +00:00
|
|
|
|
|
|
|
// ShapeStyle is style attribute of v:shape element.
|
2021-09-22 16:41:01 +00:00
|
|
|
type ShapeStyle struct{_fcg string ;_cb int64 ;_de int64 ;_cc int64 ;_bc int64 ;_bdd int64 ;_cg string ;_gg string ;_cd string ;_fe string ;};
|
2021-07-30 17:03:26 +00:00
|
|
|
|
2021-09-22 16:41:01 +00:00
|
|
|
// IsBold returns true if text is bold.
|
|
|
|
func (_cee *TextpathStyle )IsBold ()bool {return _cee ._bce };
|
2021-08-23 20:44:48 +00:00
|
|
|
|
2021-09-22 16:41:01 +00:00
|
|
|
// NewCommentDrawing constructs a new comment drawing.
|
|
|
|
func NewCommentDrawing ()*Container {_gf :=NewContainer ();_gf .Layout =_dd .NewOfcShapelayout ();_gf .Layout .ExtAttr =_dd .ST_ExtEdit ;_gf .Layout .Idmap =_dd .NewOfcCT_IdMap ();_gf .Layout .Idmap .DataAttr =_ga .String ("\u0031");_gf .Layout .Idmap .ExtAttr =_dd .ST_ExtEdit ;_gf .ShapeType =_dd .NewShapetype ();_gf .ShapeType .IdAttr =_ga .String ("_\u0078\u0030\u0030\u0030\u0030\u005f\u0074\u0032\u0030\u0032");_gf .ShapeType .CoordsizeAttr =_ga .String ("2\u0031\u0036\u0030\u0030\u002c\u0032\u0031\u0036\u0030\u0030");_gf .ShapeType .SptAttr =_ga .Float32 (202);_gf .ShapeType .PathAttr =_ga .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");_ea :=_dd .NewEG_ShapeElements ();_gf .ShapeType .EG_ShapeElements =append (_gf .ShapeType .EG_ShapeElements ,_ea );_ea .Path =_dd .NewPath ();_ea .Path .GradientshapeokAttr =_ee .ST_TrueFalseT ;_ea .Path .ConnecttypeAttr =_dd .OfcST_ConnectTypeRect ;return _gf ;};
|