2017-08-28 20:56:18 -05:00
//
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/
2023-05-26 09:49:04 +00:00
package presentation ; import ( _cg "archive/zip" ; _bd "bytes" ; _cf "encoding/xml" ; _gg "errors" ; _da "fmt" ; _gb "github.com/unidoc/unioffice" ; _ea "github.com/unidoc/unioffice/common" ; _e "github.com/unidoc/unioffice/common/logger" ; _gcb "github.com/unidoc/unioffice/common/tempstorage" ; _ed "github.com/unidoc/unioffice/drawing" ; _b "github.com/unidoc/unioffice/internal/license" ; _acb "github.com/unidoc/unioffice/measurement" ; _fd "github.com/unidoc/unioffice/schema/soo/dml" ; _a "github.com/unidoc/unioffice/schema/soo/dml/chart" ; _cb "github.com/unidoc/unioffice/schema/soo/ofc/sharedTypes" ; _d "github.com/unidoc/unioffice/schema/soo/pkg/relationships" ; _cc "github.com/unidoc/unioffice/schema/soo/pml" ; _gc "github.com/unidoc/unioffice/zippkg" ; _ab "image" ; _bb "image/jpeg" ; _ad "io" ; _cgg "math" ; _ada "os" ; _f "path" ; _ff "sort" ; _ac "strconv" ; _g "strings" ; ) ; func _cgab ( _ggb [ ] * _cc . CT_GroupShapeChoice ) [ ] * _cc . CT_GroupShapeChoice { var _edb [ ] * _cc . CT_GroupShapeChoice ; for _ , _gcec := range _ggb { if len ( _gcec . Pic ) == 0 { _edb = append ( _edb , _gcec ) ; } ; } ; return _edb ; } ;
2020-08-23 14:15:53 +00:00
2023-05-26 09:49:04 +00:00
// X returns the inner wrapped XML type.
func ( _bgg PlaceHolder ) X ( ) * _cc . CT_Shape { return _bgg . _gdg } ;
2021-05-31 16:22:30 +00:00
2023-05-26 09:49:04 +00:00
// SlideLayouts returns the slide layouts defined in the presentation.
func ( _gaf * Presentation ) SlideLayouts ( ) [ ] SlideLayout { _egc := [ ] SlideLayout { } ; for _ , _fdf := range _gaf . _geg { _egc = append ( _egc , SlideLayout { _fdf } ) ; } ; return _egc ; } ;
2021-05-31 16:22:30 +00:00
2023-05-26 09:49:04 +00:00
// LastViewAttr returns the LastViewAttr property.
func ( _fgaaf ViewProperties ) LastViewAttr ( ) _cc . ST_ViewType { return _fgaaf . _gdaf . LastViewAttr } ;
2022-01-15 21:17:38 +00:00
2023-05-26 09:49:04 +00:00
// TextItem is used for keeping text with references to a paragraph and run, a shape or a table, a row and a cell where it is located.
type TextItem struct { Text string ; Presentation * Presentation ; Shape * _cc . CT_Shape ; GraphicFrame * _cc . CT_GraphicalObjectFrame ; Paragraph * _fd . CT_TextParagraph ; Run * _fd . CT_RegularTextRun ; TableInfo * TableInfo ; _be [ ] rectangle ; _abf int ; _ccgb int ; } ;
2022-09-02 11:46:53 +00:00
2023-05-26 09:49:04 +00:00
// AddTable adds an empty table to a slide.
func ( _caac Slide ) AddTable ( ) * _ea . Table { _fgaa := _cc . NewCT_GroupShapeChoice ( ) ; _caac . _bffe . CSld . SpTree . Choice = append ( _caac . _bffe . CSld . SpTree . Choice , _fgaa ) ; _ffagf := _cc . NewCT_GraphicalObjectFrame ( ) ; _fgaa . GraphicFrame = append ( _fgaa . GraphicFrame , _ffagf ) ; _ffagf . Xfrm . Off = _fd . NewCT_Point2D ( ) ; _abbaa := int64 ( 1 ) ; _ffagf . Xfrm . Off . XAttr = _fd . ST_Coordinate { ST_CoordinateUnqualified : & _abbaa } ; _ffagf . Xfrm . Off . YAttr = _fd . ST_Coordinate { ST_CoordinateUnqualified : & _abbaa } ; _cdbc := _ffagf . Graphic . CT_GraphicalObject . GraphicData ; _cdbc . UriAttr = "\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073\u002eo\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073.\u006f\u0072\u0067\u002f\u0064\u0072\u0061\u0077\u0069\u006e\u0067\u006dl/\u0032\u0030\u0030\u0036\u002f\u0074\u0061\u0062\u006c\u0065" ; _fcce := _ea . NewTableWithXfrm ( _ffagf . Xfrm ) ; _cdbc . Any = append ( _cdbc . Any , _fcce . X ( ) ) ; return _fcce ; } ;
2022-04-09 14:27:46 +00:00
2023-05-26 09:49:04 +00:00
// Open opens and reads a document from a file (.pptx).
func Open ( filename string ) ( * Presentation , error ) { _dff , _fba := _ada . Open ( filename ) ; if _fba != nil { return nil , _da . Errorf ( "e\u0072r\u006f\u0072\u0020\u006f\u0070\u0065\u006e\u0069n\u0067\u0020\u0025\u0073: \u0025\u0073" , filename , _fba ) ; } ; defer _dff . Close ( ) ; _aba , _fba := _ada . Stat ( filename ) ; if _fba != nil { return nil , _da . Errorf ( "e\u0072r\u006f\u0072\u0020\u006f\u0070\u0065\u006e\u0069n\u0067\u0020\u0025\u0073: \u0025\u0073" , filename , _fba ) ; } ; _ = _aba ; return Read ( _dff , _aba . Size ( ) ) ; } ;
2022-04-09 14:27:46 +00:00
2023-05-26 09:49:04 +00:00
// GetImageByRelID returns an ImageRef with the associated relation ID in the
// document.
func ( _ded * Presentation ) GetImageByRelID ( relID string ) ( _ea . ImageRef , bool ) { for _ , _gef := range _ded . Images { if _gef . RelID ( ) == relID { return _gef , true ; } ; } ; return _ea . ImageRef { } , false ; } ; func ( _bdc * chart ) Target ( ) string { return _bdc . _abd } ;
2022-04-09 14:27:46 +00:00
2023-05-26 09:49:04 +00:00
// SlideSize returns presentation slide size.
func ( _dag * Presentation ) SlideSize ( ) SlideSize { if _dag . _bbf . SldSz == nil { _dag . _bbf . SldSz = _cc . NewCT_SlideSize ( ) ; } ; return SlideSize { _dag . _bbf . SldSz , _dag } ; } ;
2020-08-23 14:15:53 +00:00
2023-05-26 09:49:04 +00:00
// GridSpacing returns the GridSpacing property.
func ( _edac ViewProperties ) GridSpacing ( ) * _fd . CT_PositiveSize2D { return _edac . _gdaf . GridSpacing } ;
2023-03-01 18:42:44 +00:00
2023-05-26 09:49:04 +00:00
// ClearAll completely clears a placeholder. To be useable, at least one
// paragraph must be added after ClearAll via AddParagraph.
func ( _bfd PlaceHolder ) ClearAll ( ) { _bfd . _gdg . SpPr = _fd . NewCT_ShapeProperties ( ) ; _bfd . _gdg . TxBody = _fd . NewCT_TextBody ( ) ; _bfd . _gdg . TxBody . LstStyle = _fd . NewCT_TextListStyle ( ) ; } ; const _fcac float64 = 500000 ;
2020-08-23 14:15:53 +00:00
2023-05-26 09:49:04 +00:00
// Presentation is the a presentation base document.
type Presentation struct { _ea . DocBase ; _bbf * _cc . Presentation ; _cbdb _ea . Relationships ; _aab [ ] * _cc . Sld ; _abba [ ] _ea . Relationships ; _fda [ ] * _cc . SldMaster ; _dde [ ] _ea . Relationships ; _geg [ ] * _cc . SldLayout ; _bgf [ ] _ea . Relationships ; _gfb [ ] * _fd . Theme ; _gbf [ ] _ea . Relationships ; _ace _ea . TableStyles ; _cbde PresentationProperties ; _cfe ViewProperties ; _gced [ ] * _fd . CT_Hyperlink ; _eab [ ] * chart ; _acea [ ] * _cc . HandoutMaster ; _gaa [ ] * _cc . NotesMaster ; _gaaa [ ] * _gb . XSDAny ; _fed map [ string ] string ; _aec string ; } ;
2020-08-23 14:15:53 +00:00
2023-05-26 09:49:04 +00:00
// AddTextBox adds an empty textbox to a slide.
func ( _ggg Slide ) AddTextBox ( ) TextBox { _feac := _cc . NewCT_GroupShapeChoice ( ) ; _ggg . _bffe . CSld . SpTree . Choice = append ( _ggg . _bffe . CSld . SpTree . Choice , _feac ) ; _fgag := _cc . NewCT_Shape ( ) ; _feac . Sp = append ( _feac . Sp , _fgag ) ; _fgag . SpPr = _fd . NewCT_ShapeProperties ( ) ; _fgag . SpPr . Xfrm = _fd . NewCT_Transform2D ( ) ; _fgag . SpPr . PrstGeom = _fd . NewCT_PresetGeometry2D ( ) ; _fgag . SpPr . PrstGeom . PrstAttr = _fd . ST_ShapeTypeRect ; _fgag . NvSpPr = _cc . NewCT_ShapeNonVisual ( ) ; _fgag . NvSpPr . CNvSpPr = _fd . NewCT_NonVisualDrawingShapeProps ( ) ; _bedb := true ; _fgag . NvSpPr . CNvSpPr . TxBoxAttr = & _bedb ; _fgag . TxBody = _fd . NewCT_TextBody ( ) ; _fgag . TxBody . BodyPr = _fd . NewCT_TextBodyProperties ( ) ; _fgag . TxBody . BodyPr . WrapAttr = _fd . ST_TextWrappingTypeSquare ; _fgag . TxBody . BodyPr . SpAutoFit = _fd . NewCT_TextShapeAutofit ( ) ; _bdac := TextBox { _fgag } ; _bdac . Properties ( ) . SetWidth ( 3 * _acb . Inch ) ; _bdac . Properties ( ) . SetHeight ( 1 * _acb . Inch ) ; _bdac . Properties ( ) . SetPosition ( 0 , 0 ) ; return _bdac ; } ;
2022-04-09 14:27:46 +00:00
2023-05-26 09:49:04 +00:00
// Type returns the type of the slide layout.
func ( _eca SlideLayout ) Type ( ) _cc . ST_SlideLayoutType { return _eca . _aecga . TypeAttr } ;
2022-04-09 14:27:46 +00:00
2023-05-26 09:49:04 +00:00
// Width returns slide screen size width in EMU units.
func ( _dffa * SlideScreenSize ) Width ( ) int32 { return _dffa [ 0 ] } ;
2022-04-09 14:27:46 +00:00
2023-05-26 09:49:04 +00:00
// Read reads a document from an io.Reader.
func Read ( r _ad . ReaderAt , size int64 ) ( * Presentation , error ) { const _dfc = "\u0070\u0072\u0065\u0073\u0065\u006e\u0074\u0061\u0074\u0069\u006f\u006e:\u0052\u0065\u0061\u0064" ; if ! _b . GetLicenseKey ( ) . IsLicensed ( ) && ! _cgac { _da . Println ( "\u0055\u006e\u006ci\u0063\u0065\u006e\u0073e\u0064\u0020\u0076\u0065\u0072\u0073\u0069o\u006e\u0020\u006f\u0066\u0020\u0055\u006e\u0069\u004f\u0066\u0066\u0069\u0063\u0065" ) ; _da . Println ( "\u002d\u0020\u0047e\u0074\u0020\u0061\u0020\u0074\u0072\u0069\u0061\u006c\u0020\u006c\u0069\u0063\u0065\u006e\u0073\u0065\u0020\u006f\u006e\u0020\u0068\u0074\u0074\u0070\u0073\u003a\u002f\u002fu\u006e\u0069\u0064\u006f\u0063\u002e\u0069\u006f" ) ; return nil , _gg . New ( "\u0075\u006e\u0069\u006f\u0066\u0066\u0069\u0063\u0065\u0020\u006ci\u0063\u0065\u006e\u0073\u0065\u0020\u0072\u0065\u0071\u0075i\u0072\u0065\u0064" ) ; } ; _adaa := _ccf ( ) ; _dec , _bef := _b . GenRefId ( "\u0070\u0072" ) ; if _bef != nil { _e . Log . Error ( "\u0045R\u0052\u004f\u0052\u003a\u0020\u0025v" , _bef ) ; return nil , _bef ; } ; _adaa . _aec = _dec ; if _fdcc := _b . Track ( _adaa . _aec , _dfc ) ; _fdcc != nil { _e . Log . Error ( "\u0045R\u0052\u004f\u0052\u003a\u0020\u0025v" , _fdcc ) ; return nil , _fdcc ; } ; _dga , _bef := _gcb . TempDir ( "\u0075\u006e\u0069\u006f\u0066\u0066\u0069\u0063\u0065-\u0070\u0070\u0074\u0078" ) ; if _bef != nil { return nil , _bef ; } ; _adaa . TmpPath = _dga ; _eeee , _bef := _cg . NewReader ( r , size ) ; if _bef != nil { return nil , _da . Errorf ( "\u0070a\u0072s\u0069\u006e\u0067\u0020\u007a\u0069\u0070\u003a\u0020\u0025\u0073" , _bef ) ; } ; _edcc := [ ] * _cg . File { } ; _edcc = append ( _edcc , _eeee . File ... ) ; _cgeb := false ; for _ , _ccd := range _edcc { if _ccd . FileHeader . Name == "\u0064\u006f\u0063\u0050ro\u0070\u0073\u002f\u0063\u0075\u0073\u0074\u006f\u006d\u002e\u0078\u006d\u006c" { _cgeb = true ; break ; } ; } ; if _cgeb { _adaa . CreateCustomProperties ( ) ; } ; _abg := _gc . DecodeMap { } ; _abg . SetOnNewRelationshipFunc ( _adaa . onNewRelationship ) ; _abg . AddTarget ( _gb . ContentTypesFilename , _adaa . ContentTypes . X ( ) , "" , 0 ) ; _abg . AddTarget ( _gb . BaseRelsFilename , _adaa . Rels . X ( ) , "" , 0 ) ; if _cdg := _abg . Decode ( _edcc ) ; _cdg != nil { return nil , _cdg ; } ; for _ , _agbce := range _edcc { if _agbce == nil { continue ; } ; if _cgbe := _adaa . AddExtraFileFromZip ( _agbce ) ; _cgbe != nil { return nil , _cgbe ; } ; } ; if _cgeb { _gba := false ; for _ , _ecda := range _adaa . Rels . X ( ) . Relationship { if _ecda . TargetAttr == "\u0064\u006f\u0063\u0050ro\u0070\u0073\u002f\u0063\u0075\u0073\u0074\u006f\u006d\u002e\u0078\u006d\u006c" { _gba = true ; break ; } ; } ; if ! _gba { _adaa . AddCustomRelationships ( ) ; } ; } ; return _adaa , nil ; } ;
2020-08-23 14:15:53 +00:00
2023-05-26 09:49:04 +00:00
// SetOffsetY sets vertical offset of text box in distance units (see measurement package).
func ( _dbce TextBox ) SetOffsetY ( offY float64 ) { _fggca := _dbce . getOff ( ) ; _acf := _acb . ToEMU ( offY ) ; _fggca . YAttr = _fd . ST_Coordinate { ST_CoordinateUnqualified : & _acf } ; } ;
2022-02-25 19:20:45 +00:00
2023-05-26 09:49:04 +00:00
// AddDefaultSlideWithLayout tries to replicate what PowerPoint does when
// inserting a slide with a new style by clearing placeholder content and removing
// some placeholders. Use AddSlideWithLayout if you need more control.
func ( _edba * Presentation ) AddDefaultSlideWithLayout ( l SlideLayout ) ( Slide , error ) { _aad , _cecac := _edba . AddSlideWithLayout ( l ) ; for _ , _afaf := range _aad . PlaceHolders ( ) { _afaf . Clear ( ) ; switch _afaf . Type ( ) { case _cc . ST_PlaceholderTypeFtr , _cc . ST_PlaceholderTypeDt , _cc . ST_PlaceholderTypeSldNum : _afaf . Remove ( ) ; } ; } ; return _aad , _cecac ; } ; func _fb ( _ee * Presentation , _ffa [ ] * _cc . CT_GroupShapeChoice , _caf [ ] rectangle , _bf [ ] * TextItem ) [ ] * TextItem { for _ , _af := range _ffa { _aeg := append ( [ ] rectangle { } , _caf ... ) ; for _ , _bed := range _af . Sp { _bf = append ( _bf , _eed ( _ee , _bed , nil , nil , _bed . SpPr . Xfrm , 0 , _caf , _bed . TxBody . P ) ... ) ; } ; for _ , _edg := range _af . GraphicFrame { if _edg != nil && _edg . Graphic != nil && _edg . Graphic . GraphicData != nil { _cba := _edg . Xfrm ; for _ , _fa := range _edg . Graphic . GraphicData . Any { if _bff , _agb := _fa . ( * _fd . Tbl ) ; _agb { _cga := & _bff . CT_Table ; _fac := 0 ; for _fab , _dcf := range _bff . Tr { for _bba , _dg := range _dcf . Tc { _dgd := & TableInfo { Table : _cga , Row : _dcf , Cell : _dg , RowIndex : _fab , ColIndex : _bba } ; _bf = append ( _bf , _eed ( _ee , nil , _edg , _dgd , _cba , _fac , _caf , _dg . TxBody . P ) ... ) ; _fac ++ ; } ; } ; } ; } ; } ; } ; for _ , _beg := range _af . GrpSp { if _beg . GrpSpPr != nil { _bbb := _beg . GrpSpPr . Xfrm ; var _dacb , _bg int64 ; if _bbb . Off != nil { _dgde , _agc := _bbb . Off . XAttr . ST_CoordinateUnqualified , _bbb . Off . YAttr . ST_CoordinateUnqualified ; if _dgde != nil && _agc != nil { if _edc := _bbb . Ext ; _edc != nil { _dacb , _bg = _edc . CxAttr , _edc . CyAttr ; } ; _aeg = append ( _aeg , rectangle { _dc : * _dgde , _bec : * _agc , _ec : * _dgde + _dacb , _ca : * _agc + _bg } ) ; } ; } ; } ; _bf = _fb ( _ee , _beg . Choice , _aeg , _bf ) ; } ; } ; return _bf ; } ;
// Properties returns the properties of the TextBox.
func ( _bgeg TextBox ) Properties ( ) _ed . ShapeProperties { if _bgeg . _abde . SpPr == nil { _bgeg . _abde . SpPr = _fd . NewCT_ShapeProperties ( ) ; } ; return _ed . MakeShapeProperties ( _bgeg . _abde . SpPr ) ; } ;
// SaveToFileAsTemplate writes the Presentation out to a file as a template.
func ( _edd * Presentation ) SaveToFileAsTemplate ( path string ) error { return _edd . saveToFile ( path , true ) } ;
// GetTableStyleById returns *dml.CT_TableStyle by its style id.
func ( _aaag * Presentation ) GetTableStyleById ( id string ) * _fd . CT_TableStyle { _afbg := _aaag . _ace . TblStyle ( ) ; for _ , _acg := range _afbg { if _acg . StyleIdAttr == id { return _acg ; } ; } ; return nil ; } ;
2022-09-02 11:46:53 +00:00
2023-04-15 17:27:31 +00:00
// Name returns the name of the slide layout.
2023-05-26 09:49:04 +00:00
func ( _dfgb SlideLayout ) Name ( ) string { if _dfgb . _aecga . CSld != nil && _dfgb . _aecga . CSld . NameAttr != nil { return * _dfgb . _aecga . CSld . NameAttr ; } ; return "" ; } ;
2022-02-25 19:20:45 +00:00
2023-05-26 09:49:04 +00:00
// SlideText is an array of extracted text items which has some methods for representing extracted text from a slide.
type SlideText struct { Items [ ] * TextItem ; } ;
2022-04-09 14:27:46 +00:00
2023-05-26 09:49:04 +00:00
// Text returns text from a slide as one string separated with line breaks.
func ( _ced * SlideText ) Text ( ) string { _bdb := _bd . NewBuffer ( [ ] byte { } ) ; for _ , _fca := range _ced . Items { if _fca . Text != "" { _bdb . WriteString ( _fca . Text ) ; _bdb . WriteString ( "\u000a" ) ; } ; } ; return _bdb . String ( ) ; } ;
2022-02-25 19:20:45 +00:00
2023-05-26 09:49:04 +00:00
// PresentationText is an array of extracted text items which has some methods for representing extracted text.
type PresentationText struct { Slides [ ] * SlideText ; } ; func ( _cecaa * Slide ) getSlideRels ( ) _ea . Relationships { _edf := _cecaa . _gag ; for _eggb , _fcee := range _edf . Slides ( ) { if * _cecaa . _bffe == * _fcee . _bffe { return _edf . _abba [ len ( _edf . _abba ) - _eggb - 1 ] ; } ; } ; return _ea . Relationships { } ; } ;
2020-08-23 14:15:53 +00:00
2023-05-26 09:49:04 +00:00
// Paragraphs returns the paragraphs defined in the placeholder.
func ( _eac PlaceHolder ) Paragraphs ( ) [ ] _ed . Paragraph { _fae := [ ] _ed . Paragraph { } ; for _ , _fga := range _eac . _gdg . TxBody . P { _fae = append ( _fae , _ed . MakeParagraph ( _fga ) ) ; } ; return _fae ; } ;
2022-01-15 21:17:38 +00:00
2023-05-26 09:49:04 +00:00
// X returns the inner wrapped XML type.
func ( _acege ViewProperties ) X ( ) * _cc . ViewPr { return _acege . _gdaf } ;
2020-08-23 14:15:53 +00:00
2023-05-26 09:49:04 +00:00
// AddImage adds an image to the document package, returning a reference that
// can be used to add the image to a run and place it in the document contents.
func ( _dcfa * Presentation ) AddImage ( i _ea . Image ) ( _ea . ImageRef , error ) { _egb := _ea . MakeImageRef ( i , & _dcfa . DocBase , _dcfa . _cbdb ) ; if i . Data == nil && i . Path == "" { return _egb , _gg . New ( "\u0069\u006d\u0061\u0067\u0065\u0020\u006d\u0075\u0073\u0074 \u0068\u0061\u0076\u0065\u0020\u0064\u0061t\u0061\u0020\u006f\u0072\u0020\u0061\u0020\u0070\u0061\u0074\u0068" ) ; } ; if i . Format == "" { return _egb , _gg . New ( "\u0069\u006d\u0061\u0067\u0065\u0020\u006d\u0075\u0073\u0074 \u0068\u0061\u0076\u0065\u0020\u0061\u0020v\u0061\u006c\u0069\u0064\u0020\u0066\u006f\u0072\u006d\u0061\u0074" ) ; } ; if i . Size . X == 0 || i . Size . Y == 0 { return _egb , _gg . New ( "\u0069\u006d\u0061\u0067e\u0020\u006d\u0075\u0073\u0074\u0020\u0068\u0061\u0076\u0065 \u0061 \u0076\u0061\u006c\u0069\u0064\u0020\u0073i\u007a\u0065" ) ; } ; if i . Path != "" { _edaf := _gcb . Add ( i . Path ) ; if _edaf != nil { return _egb , _edaf ; } ; } ; _dcfa . Images = append ( _dcfa . Images , _egb ) ; _dcfa . ContentTypes . EnsureDefault ( "\u0070\u006e\u0067" , "\u0069m\u0061\u0067\u0065\u002f\u0070\u006eg" ) ; _dcfa . ContentTypes . EnsureDefault ( "\u006a\u0070\u0065\u0067" , "\u0069\u006d\u0061\u0067\u0065\u002f\u006a\u0070\u0065\u0067" ) ; _dcfa . ContentTypes . EnsureDefault ( "\u006a\u0070\u0067" , "\u0069\u006d\u0061\u0067\u0065\u002f\u006a\u0070\u0065\u0067" ) ; _dcfa . ContentTypes . EnsureDefault ( "\u0077\u006d\u0066" , "i\u006d\u0061\u0067\u0065\u002f\u0078\u002d\u0077\u006d\u0066" ) ; _dcfa . ContentTypes . EnsureDefault ( i . Format , "\u0069\u006d\u0061\u0067\u0065\u002f" + i . Format ) ; return _egb , nil ; } ;
2020-11-09 01:00:18 +00:00
2023-05-26 09:49:04 +00:00
// Size returns slide size value as SlideScreenSize.
func ( _cdc * SlideSize ) Size ( ) SlideScreenSize { return SlideScreenSize { _cdc . _daef . CxAttr , _cdc . _daef . CyAttr } ; } ;
2021-03-16 20:51:18 +00:00
2023-05-26 09:49:04 +00:00
// SlideMasters returns the slide masters defined in the presentation.
func ( _gda * Presentation ) SlideMasters ( ) [ ] SlideMaster { _gcd := [ ] SlideMaster { } ; for _gdaa , _cafd := range _gda . _fda { _gcd = append ( _gcd , SlideMaster { _gda , _gda . _dde [ _gdaa ] , _cafd } ) ; } ; return _gcd ; } ;
// NotesViewPr returns the NotesViewPr property.
func ( _cbb ViewProperties ) NotesViewPr ( ) * _cc . CT_NotesViewProperties { return _cbb . _gdaf . NotesViewPr } ;
2022-02-25 19:20:45 +00:00
2023-04-15 17:27:31 +00:00
// GetColorBySchemeColor returns *dml.CT_Color mapped to scheme colors like dk1, lt1 etc. depending on what theme is used in the presentation.
2023-05-26 09:49:04 +00:00
func ( _bbfeb * Presentation ) GetColorBySchemeColor ( schClr _fd . ST_SchemeColorVal ) * _fd . CT_Color { if len ( _bbfeb . _fda ) == 0 || len ( _bbfeb . _gfb ) == 0 { return nil ; } ; var _dcfd _fd . ST_ColorSchemeIndex ; _aecg := _bbfeb . _fda [ 0 ] ; _dad := _aecg . ClrMap ; switch schClr . String ( ) { case "\u0062\u0067\u0031" : _dcfd = _dad . Bg1Attr ; case "\u0062\u0067\u0032" : _dcfd = _dad . Bg2Attr ; case "\u0074\u0078\u0031" : _dcfd = _dad . Tx1Attr ; case "\u0074\u0078\u0032" : _dcfd = _dad . Tx2Attr ; case "\u0061c\u0063\u0065\u006e\u0074\u0031" : _dcfd = _dad . Accent1Attr ; case "\u0061c\u0063\u0065\u006e\u0074\u0032" : _dcfd = _dad . Accent2Attr ; case "\u0061c\u0063\u0065\u006e\u0074\u0033" : _dcfd = _dad . Accent3Attr ; case "\u0061c\u0063\u0065\u006e\u0074\u0034" : _dcfd = _dad . Accent4Attr ; case "\u0061c\u0063\u0065\u006e\u0074\u0035" : _dcfd = _dad . Accent5Attr ; case "\u0061c\u0063\u0065\u006e\u0074\u0036" : _dcfd = _dad . Accent6Attr ; case "\u0068\u006c\u0069n\u006b" : _dcfd = _dad . HlinkAttr ; case "\u0066\u006f\u006c\u0048\u006c\u0069\u006e\u006b" : _dcfd = _dad . FolHlinkAttr ; case "\u0064\u006b\u0031" : _dcfd = _fd . ST_ColorSchemeIndexDk1 ; case "\u0064\u006b\u0032" : _dcfd = _fd . ST_ColorSchemeIndexDk2 ; case "\u006c\u0074\u0031" : _dcfd = _fd . ST_ColorSchemeIndexLt1 ; case "\u006c\u0074\u0032" : _dcfd = _fd . ST_ColorSchemeIndexLt2 ; default : _dcfd = _fd . ST_ColorSchemeIndexUnset ; } ; _eddg := _bbfeb . _gfb [ 0 ] ; _bfc := _eddg . ThemeElements ; if _bfc == nil { return nil ; } ; var _edge * _fd . CT_Color ; _fceb := _bfc . ClrScheme ; switch _dcfd . String ( ) { case "\u0064\u006b\u0031" : _edge = _fceb . Dk1 ; case "\u0064\u006b\u0032" : _edge = _fceb . Dk2 ; case "\u006c\u0074\u0031" : _edge = _fceb . Lt1 ; case "\u006c\u0074\u0032" : _edge = _fceb . Lt2 ; case "\u0061c\u0063\u0065\u006e\u0074\u0031" : _edge = _fceb . Accent1 ; case "\u0061c\u0063\u0065\u006e\u0074\u0032" : _edge = _fceb . Accent2 ; case "\u0061c\u0063\u0065\u006e\u0074\u0033" : _edge = _fceb . Accent3 ; case "\u0061c\u0063\u0065\u006e\u0074\u0034" : _edge = _fceb . Accent4 ; case "\u0061c\u0063\u0065\u006e\u0074\u0035" : _edge = _fceb . Accent5 ; case "\u0061c\u0063\u0065\u006e\u0074\u0036" : _edge = _fceb . Accent6 ; case "\u0068\u006c\u0069n\u006b" : _edge = _fceb . Hlink ; case "\u0066\u006f\u006c\u0048\u006c\u0069\u006e\u006b" : _edge = _fceb . FolHlink ; default : return nil ; } ; return _edge ; } ;
2022-02-25 19:20:45 +00:00
2023-05-26 09:49:04 +00:00
// ExtractText returns text from a presentation as a PresentationText object.
func ( _fg * Presentation ) ExtractText ( ) * PresentationText { _ag := [ ] * SlideText { } ; for _ , _age := range _fg . Slides ( ) { _ga := _age . ExtractText ( ) ; if _ga != nil { _ag = append ( _ag , _ga ) ; } ; } ; return & PresentationText { Slides : _ag } ; } ;
2020-08-23 14:15:53 +00:00
2023-05-26 09:49:04 +00:00
// HtmlPubPr returns the HtmlPubPr property.
func ( _ebe PresentationProperties ) HtmlPubPr ( ) * _cc . CT_HtmlPublishProperties { return _ebe . _cfbe . HtmlPubPr ; } ;
2020-08-23 14:15:53 +00:00
2023-05-26 09:49:04 +00:00
// AddSlide adds a new slide to the presentation.
func ( _cbag * Presentation ) AddSlide ( ) Slide { _aef := _cc . NewCT_SlideIdListEntry ( ) ; _aef . IdAttr = _cbag . nextSlideID ( ) ; _cbag . _bbf . SldIdLst . SldId = append ( _cbag . _bbf . SldIdLst . SldId , _aef ) ; _aee := _cc . NewSld ( ) ; _aee . CSld . SpTree . NvGrpSpPr . CNvPr . IdAttr = 1 ; _aee . CSld . SpTree . GrpSpPr . Xfrm = _fd . NewCT_GroupTransform2D ( ) ; _aee . CSld . SpTree . GrpSpPr . Xfrm . Off = _fd . NewCT_Point2D ( ) ; _aee . CSld . SpTree . GrpSpPr . Xfrm . Off . XAttr . ST_CoordinateUnqualified = _gb . Int64 ( 0 ) ; _aee . CSld . SpTree . GrpSpPr . Xfrm . Off . YAttr . ST_CoordinateUnqualified = _gb . Int64 ( 0 ) ; _aee . CSld . SpTree . GrpSpPr . Xfrm . Ext = _fd . NewCT_PositiveSize2D ( ) ; _aee . CSld . SpTree . GrpSpPr . Xfrm . Ext . CxAttr = int64 ( 0 * _acb . Point ) ; _aee . CSld . SpTree . GrpSpPr . Xfrm . Ext . CyAttr = int64 ( 0 * _acb . Point ) ; _aee . CSld . SpTree . GrpSpPr . Xfrm . ChOff = _aee . CSld . SpTree . GrpSpPr . Xfrm . Off ; _aee . CSld . SpTree . GrpSpPr . Xfrm . ChExt = _aee . CSld . SpTree . GrpSpPr . Xfrm . Ext ; _cbag . _aab = append ( _cbag . _aab , _aee ) ; _fff := _cbag . _cbdb . AddAutoRelationship ( _gb . DocTypePresentation , _gb . OfficeDocumentType , len ( _cbag . _aab ) , _gb . SlideType ) ; _aef . RIdAttr = _fff . ID ( ) ; _fee := _gb . AbsoluteFilename ( _gb . DocTypePresentation , _gb . SlideType , len ( _cbag . _aab ) ) ; _cbag . ContentTypes . AddOverride ( _fee , _gb . SlideContentType ) ; _cfda := _ea . NewRelationships ( ) ; _cbag . _abba = append ( _cbag . _abba , _cfda ) ; _cfda . AddAutoRelationship ( _gb . DocTypePresentation , _gb . SlideType , len ( _cbag . _geg ) , _gb . SlideLayoutType ) ; return Slide { _aef , _aee , _cbag , nil } ; } ; func ( _acc * Presentation ) save ( _fgdd _ad . Writer , _efa bool ) error { const _cadg = "\u0050\u0072\u0065\u0073en\u0074\u0061\u0074\u0069\u006f\u006e\u003a\u0070\u002e\u0053\u0061\u0076\u0065" ; if _dca := _acc . _bbf . Validate ( ) ; _dca != nil { _e . Log . Debug ( "\u0076\u0061\u006c\u0069\u0064\u0061\u0074\u0069\u006f\u006e\u0020\u0065\u0072\u0072\u006fr\u0020i\u006e\u0020\u0064\u006f\u0063\u0075\u006d\u0065\u006e\u0074\u003a\u0020\u0025\u0073" , _dca ) ; } ; if ! _b . GetLicenseKey ( ) . IsLicensed ( ) && ! _cgac { _da . Println ( "\u0055\u006e\u006ci\u0063\u0065\u006e\u0073e\u0064\u0020\u0076\u0065\u0072\u0073\u0069o\u006e\u0020\u006f\u0066\u0020\u0055\u006e\u0069\u004f\u0066\u0066\u0069\u0063\u0065" ) ; _da . Println ( "\u002d\u0020\u0047e\u0074\u0020\u0061\u0020\u0074\u0072\u0069\u0061\u006c\u0020\u006c\u0069\u0063\u0065\u006e\u0073\u0065\u0020\u006f\u006e\u0020\u0068\u0074\u0074\u0070\u0073\u003a\u002f\u002fu\u006e\u0069\u0064\u006f\u0063\u002e\u0069\u006f" ) ; return _gg . New ( "\u0075\u006e\u0069\u006f\u0066\u0066\u0069\u0063\u0065\u0020\u006ci\u0063\u0065\u006e\u0073\u0065\u0020\u0072\u0065\u0071\u0075i\u0072\u0065\u0064" ) ; } ; if len ( _acc . _aec ) == 0 { _dbb , _fcf := _b . GenRefId ( "\u0070\u0077" ) ; if _fcf != nil { _e . Log . Error ( "\u0045R\u0052\u004f\u0052\u003a\u0020\u0025v" , _fcf ) ; return _fcf ; } ; _acc . _aec = _dbb ; } ; if _dgc := _b . Track ( _acc . _aec , _cadg ) ; _dgc != nil { _e . Log . Error ( "\u0045R\u0052\u004f\u0052\u003a\u0020\u0025v" , _dgc ) ; return _dgc ; } ; if _efa { _acc . ContentTypes . RemoveOverride ( "\u0061\u0070\u0070\u006c\u0069\u0063\u0061t\u0069\u006f\u006e\u002f\u0076\u006e\u0064\u002e\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072m\u0061\u0074\u0073\u002d\u006ff\u0066\u0069\u0063\u0065\u0064\u006f\u0063\u0075\u006de\u006e\u0074\u002e\u0070\u0072\u0065\u0073\u0065\u006e\u0074\u0061\u0074\u0069\u006f\u006e\u006d\u006c\u002e\u0070\u0072\u0065\u0073\u0065\u006e\u0074\u0061\u0074\u0069\u006f\u006e\u002e\u006d\u0061\u0069\u006e\u002b\u0078\u006d\u006c" ) ; _acc . ContentTypes . EnsureOverride ( "/\u0070\u0070\u0074\u002fpr\u0065s\u0065\u006e\u0074\u0061\u0074i\u006f\u006e\u002e\u0078\u006d\u006c" , "\u0061\u0070pl\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u002f\u0076\u006e\u0064\u002e\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066o\u0072\u006d\u0061\u0074s\u002d\u006f\u0066\u0066ic\u0065\u0064o\u0063u\u006d\u0065\u006e\u0074\u002e\u0070r\u0065\u0073\u0065n\u0074\u0061t\u0069\u006f\u006e\u006d\u006c\u002e\u0074\u0065\u006d\u0070\u006c\u0061\u0074\u0065.\u006d\u0061\u0069\u006e\u002b\u0078\u006d\u006c" ) ; } else { _acc . ContentTypes . RemoveOverride ( " \ u0061 \ u0070pl \ u
2020-08-23 14:15:53 +00:00
2023-05-26 09:49:04 +00:00
// X returns the inner wrapped XML type.
func ( _cbd PresentationProperties ) X ( ) * _cc . PresentationPr { return _cbd . _cfbe } ;
2021-08-23 20:44:48 +00:00
2023-05-26 09:49:04 +00:00
// GetChartSpaceByRelId returns a *crt.ChartSpace with the associated relation ID in the
// slide.
func ( _agdd * Slide ) GetChartSpaceByRelId ( relId string ) * _a . ChartSpace { _egbe := _agdd . getSlideRels ( ) ; if ( _egbe == _ea . Relationships { } ) { return nil ; } ; _bbfabc := _egbe . GetTargetByRelId ( relId ) ; for _ , _ccfdd := range _agdd . _gag . _eab { if _bbfabc == _ccfdd . Target ( ) { return _ccfdd . _eda ; } ; } ; return nil ; } ;
2022-06-27 19:44:23 +00:00
2023-04-15 17:27:31 +00:00
// X returns the inner wrapped XML type.
2023-05-26 09:49:04 +00:00
func ( _adfb * SlideSize ) X ( ) * _cc . CT_SlideSize { return _adfb . _daef } ;
2022-06-27 19:44:23 +00:00
2023-05-26 09:49:04 +00:00
// OpenTemplate opens a template file.
func OpenTemplate ( fn string ) ( * Presentation , error ) { _ge , _bge := Open ( fn ) ; if _bge != nil { return nil , _bge ; } ; return _ge , nil ; } ;
2021-08-23 20:44:48 +00:00
2023-05-26 09:49:04 +00:00
// X returns the inner wrapped XML type.
func ( _eaec SlideMaster ) X ( ) * _cc . SldMaster { return _eaec . _bffb } ;
2021-11-10 11:45:21 +00:00
2023-05-26 09:49:04 +00:00
// SaveToFile writes the Presentation out to a file.
func ( _acbb * Presentation ) SaveToFile ( path string ) error { return _acbb . saveToFile ( path , false ) } ; func ( _ddf * Presentation ) nextSlideID ( ) uint32 { _gec := uint32 ( 256 ) ; for _ , _facb := range _ddf . _bbf . SldIdLst . SldId { if _facb . IdAttr >= _gec { _gec = _facb . IdAttr + 1 ; } ; } ; return _gec ; } ;
2021-08-23 20:44:48 +00:00
2023-05-26 09:49:04 +00:00
// SaveAsTemplate writes the presentation out to a writer in the Zip package format as a template
func ( _cbfc * Presentation ) SaveAsTemplate ( w _ad . Writer ) error { return _cbfc . save ( w , true ) } ; func ( _dae sort2d ) Len ( ) int { return len ( _dae ) } ;
2020-12-17 22:07:08 +00:00
2023-05-26 09:49:04 +00:00
// TextBox is a text box within a slide.
type TextBox struct { _abde * _cc . CT_Shape } ;
2021-06-16 07:10:52 +00:00
2023-05-26 09:49:04 +00:00
// Save writes the presentation out to a writer in the Zip package format
func ( _cda * Presentation ) Save ( w _ad . Writer ) error { return _cda . save ( w , false ) } ;
2021-01-04 16:11:39 +00:00
2023-05-26 09:49:04 +00:00
// GetColorBySchemeColor returns *dml.CT_Color mapped to scheme colors like dk1, lt1 etc. depending on what theme is used in the presentation.
func ( _gca * Slide ) GetColorBySchemeColor ( schClr _fd . ST_SchemeColorVal ) * _fd . CT_Color { _gca . ensureClrMap ( ) ; _bcb := _gca . _dcee ; if _bcb == nil { return nil ; } ; var _babd _fd . ST_ColorSchemeIndex ; switch schClr . String ( ) { case "\u0062\u0067\u0031" : _babd = _bcb . Bg1Attr ; case "\u0062\u0067\u0032" : _babd = _bcb . Bg2Attr ; case "\u0074\u0078\u0031" : _babd = _bcb . Tx1Attr ; case "\u0074\u0078\u0032" : _babd = _bcb . Tx2Attr ; case "\u0061c\u0063\u0065\u006e\u0074\u0031" : _babd = _bcb . Accent1Attr ; case "\u0061c\u0063\u0065\u006e\u0074\u0032" : _babd = _bcb . Accent2Attr ; case "\u0061c\u0063\u0065\u006e\u0074\u0033" : _babd = _bcb . Accent3Attr ; case "\u0061c\u0063\u0065\u006e\u0074\u0034" : _babd = _bcb . Accent4Attr ; case "\u0061c\u0063\u0065\u006e\u0074\u0035" : _babd = _bcb . Accent5Attr ; case "\u0061c\u0063\u0065\u006e\u0074\u0036" : _babd = _bcb . Accent6Attr ; case "\u0068\u006c\u0069n\u006b" : _babd = _bcb . HlinkAttr ; case "\u0066\u006f\u006c\u0048\u006c\u0069\u006e\u006b" : _babd = _bcb . FolHlinkAttr ; case "\u0064\u006b\u0031" : _babd = _fd . ST_ColorSchemeIndexDk1 ; case "\u0064\u006b\u0032" : _babd = _fd . ST_ColorSchemeIndexDk2 ; case "\u006c\u0074\u0031" : _babd = _fd . ST_ColorSchemeIndexLt1 ; case "\u006c\u0074\u0032" : _babd = _fd . ST_ColorSchemeIndexLt2 ; default : _babd = _fd . ST_ColorSchemeIndexUnset ; } ; _gfab := _gca . _gag . _gfb [ 0 ] ; _daea := _gfab . ThemeElements ; if _daea == nil { return nil ; } ; var _bbff * _fd . CT_Color ; _eaef := _daea . ClrScheme ; switch _babd . String ( ) { case "\u0064\u006b\u0031" : _bbff = _eaef . Dk1 ; case "\u0064\u006b\u0032" : _bbff = _eaef . Dk2 ; case "\u006c\u0074\u0031" : _bbff = _eaef . Lt1 ; case "\u006c\u0074\u0032" : _bbff = _eaef . Lt2 ; case "\u0061c\u0063\u0065\u006e\u0074\u0031" : _bbff = _eaef . Accent1 ; case "\u0061c\u0063\u0065\u006e\u0074\u0032" : _bbff = _eaef . Accent2 ; case "\u0061c\u0063\u0065\u006e\u0074\u0033" : _bbff = _eaef . Accent3 ; case "\u0061c\u0063\u0065\u006e\u0074\u0034" : _bbff = _eaef . Accent4 ; case "\u0061c\u0063\u0065\u006e\u0074\u0035" : _bbff = _eaef . Accent5 ; case "\u0061c\u0063\u0065\u006e\u0074\u0036" : _bbff = _eaef . Accent6 ; case "\u0068\u006c\u0069n\u006b" : _bbff = _eaef . Hlink ; case "\u0066\u006f\u006c\u0048\u006c\u0069\u006e\u006b" : _bbff = _eaef . FolHlink ; default : return nil ; } ; return _bbff ; } ;
2022-02-05 13:05:36 +00:00
2023-05-26 09:49:04 +00:00
// SetSize sets the slide size, take argument of SlideScreenSize.
func ( _adb * SlideSize ) SetSize ( sz SlideScreenSize ) { _adb . _daef . CxAttr = sz [ 0 ] ; _adb . _daef . CyAttr = sz [ 1 ] ; } ; func ( _cdba * Presentation ) onNewRelationship ( _efee * _gc . DecodeMap , _cca , _fag string , _aaec [ ] * _cg . File , _ccge * _d . Relationship , _bdcc _gc . Target ) error { _dcd := _gb . DocTypePresentation ; switch _fag { case _gb . OfficeDocumentType : _cdba . _bbf = _cc . NewPresentation ( ) ; _efee . AddTarget ( _cca , _cdba . _bbf , _fag , 0 ) ; _efee . AddTarget ( _gc . RelationsPathFor ( _cca ) , _cdba . _cbdb . X ( ) , _fag , 0 ) ; _ccge . TargetAttr = _gb . RelativeFilename ( _dcd , _bdcc . Typ , _fag , 0 ) ; case _gb . CorePropertiesType : _efee . AddTarget ( _cca , _cdba . CoreProperties . X ( ) , _fag , 0 ) ; _ccge . TargetAttr = _gb . RelativeFilename ( _dcd , _bdcc . Typ , _fag , 0 ) ; case _gb . CustomPropertiesType : _efee . AddTarget ( _cca , _cdba . CustomProperties . X ( ) , _fag , 0 ) ; _ccge . TargetAttr = _gb . RelativeFilename ( _dcd , _bdcc . Typ , _fag , 0 ) ; case _gb . PresentationPropertiesType : _efee . AddTarget ( _cca , _cdba . _cbde . X ( ) , _fag , 0 ) ; _ccge . TargetAttr = _gb . RelativeFilename ( _dcd , _bdcc . Typ , _fag , 0 ) ; case _gb . ViewPropertiesType : _efee . AddTarget ( _cca , _cdba . _cfe . X ( ) , _fag , 0 ) ; _ccge . TargetAttr = _gb . RelativeFilename ( _dcd , _bdcc . Typ , _fag , 0 ) ; case _gb . TableStylesType : _efee . AddTarget ( _cca , _cdba . _ace . X ( ) , _fag , 0 ) ; _ccge . TargetAttr = _gb . RelativeFilename ( _dcd , _bdcc . Typ , _fag , 0 ) ; case _gb . HyperLinkType : _dda := _fd . NewCT_Hyperlink ( ) ; _afe := uint32 ( len ( _cdba . _gced ) ) ; _efee . AddTarget ( _cca , _dda , _fag , _afe ) ; _cdba . _gced = append ( _cdba . _gced , _dda ) ; case _gb . CustomXMLType : _bfdb := & _gb . XSDAny { } ; _caca := uint32 ( len ( _cdba . _gaaa ) ) ; _efee . AddTarget ( _cca , _bfdb , _fag , _caca ) ; _cdba . _gaaa = append ( _cdba . _gaaa , _bfdb ) ; _ccge . TargetAttr = _gb . RelativeFilename ( _dcd , _bdcc . Typ , _fag , len ( _cdba . _gaaa ) ) ; case _gb . ChartType : _adgd := chart { _eda : _a . NewChartSpace ( ) } ; _ega := uint32 ( len ( _cdba . _eab ) ) ; _efee . AddTarget ( _cca , _adgd . _eda , _fag , _ega ) ; _cdba . _eab = append ( _cdba . _eab , & _adgd ) ; _ccge . TargetAttr = _gb . RelativeFilename ( _dcd , _bdcc . Typ , _fag , len ( _cdba . _eab ) ) ; _adgd . _abd = _ccge . TargetAttr ; case _gb . HandoutMasterType : _aag := _cc . NewHandoutMaster ( ) ; _cef := uint32 ( len ( _cdba . _acea ) ) ; _efee . AddTarget ( _cca , _aag , _fag , _cef ) ; _cdba . _acea = append ( _cdba . _acea , _aag ) ; _ccge . TargetAttr = _gb . RelativeFilename ( _dcd , _bdcc . Typ , _fag , len ( _cdba . _acea ) ) ; case _gb . NotesMasterType : _eff := _cc . NewNotesMaster ( ) ; _egg := uint32 ( len ( _cdba . _gaa ) ) ; _efee . AddTarget ( _cca , _eff , _fag , _egg ) ; _cdba . _gaa = append ( _cdba . _gaa , _eff ) ; _ccge . TargetAttr = _gb . RelativeFilename ( _dcd , _bdcc . Typ , _fag , len ( _cdba . _gaa ) ) ; case _gb . ExtendedPropertiesType : _efee . AddTarget ( _cca , _cdba . AppProperties . X ( ) , _fag , 0 ) ; _ccge . TargetAttr = _gb . RelativeFilename ( _dcd , _bdcc . Typ , _fag , 0 ) ; case _gb . SlideType : _cgaf := _cc . NewSld ( ) ; _cdba . _aab = append ( _cdba . _aab , _cgaf ) ; _efee . AddTarget ( _cca , _cgaf , _fag , uint32 ( len ( _cdba . _aab ) ) ) ; _ccge . TargetAttr = _gb . RelativeFilename ( _dcd , _bdcc . Typ , _fag , len ( _cdba . _aab ) ) ; _gfec := _ea . NewRelationships ( ) ; _efee . AddTarget ( _gc . RelationsPathFor ( _cca ) , _gfec . X ( ) , _fag , 0 ) ; _cdba . _abba = append ( _cdba . _abba , _gfec ) ; case _gb . SlideMasterType : _eag := _cc . NewSldMaster ( ) ; if ! _efee . AddTarget ( _cca , _eag , _fag , uint32 ( len ( _cdba . _fda ) + 1 ) ) { return nil ; } ; _cdba . _fda = append ( _cdba . _fda , _eag ) ; _ccge . TargetAttr = _gb . RelativeFilename ( _dcd , _bdcc . Typ , _fag , len ( _cdba . _fda ) ) ; _fadb := _ea . NewRelationships ( ) ; _efee . AddTarget ( _gc . RelationsPathFor ( _cca ) , _fadb . X ( ) , _fag , 0 ) ; _cdba . _dde = append ( _cdba . _dde , _fadb ) ; case _gb . SlideLayoutType : _dced := _cc . NewSldLayout ( ) ; if ! _efee . AddTarget ( _cca , _dced , _fag , uint32 ( len ( _cdba . _geg ) + 1 ) ) { return nil ; } ; _cdba . _geg = append ( _cdba . _geg , _dced ) ; _ccge . TargetAttr = _gb . RelativeFilename ( _dcd , _bdcc . Typ , _fag , len ( _cdba . _geg ) ) ; _agfb := _ea . NewRelationships ( ) ; _efee . AddTarget ( _gc . RelationsPathFor ( _cca ) , _agfb . X ( ) , _fag , 0 ) ; _cdba . _bgf = append ( _cdba . _bgf , _agfb ) ; case _gb . ThumbnailType : for _abdf , _gaag := range _aaec { if _gaag == nil { continue ; } ; if
2021-01-04 16:11:39 +00:00
2023-05-26 09:49:04 +00:00
// Remove removes a placeholder from a presentation.
func ( _dba PlaceHolder ) Remove ( ) error { for _fce , _aea := range _dba . _cdf . CSld . SpTree . Choice { for _ , _daec := range _aea . Sp { if _daec == _dba . _gdg { copy ( _dba . _cdf . CSld . SpTree . Choice [ _fce : ] , _dba . _cdf . CSld . SpTree . Choice [ _fce + 1 : ] ) ; _dba . _cdf . CSld . SpTree . Choice = _dba . _cdf . CSld . SpTree . Choice [ 0 : len ( _dba . _cdf . CSld . SpTree . Choice ) - 1 ] ; return nil ; } ; } ; } ; return _gg . New ( "\u0070\u006c\u0061\u0063\u0065\u0068\u006f\u006c\u0064\u0065r\u0020\u006e\u006f\u0074\u0020\u0066\u006fu\u006e\u0064\u0020\u0069\u006e\u0020\u0073\u006c\u0069\u0064\u0065" ) ; } ;
2021-01-04 16:11:39 +00:00
2023-05-26 09:49:04 +00:00
// ViewProperties contains presentation specific properties.
type ViewProperties struct { _gdaf * _cc . ViewPr } ; func ( _cbf * chart ) RelId ( ) string { return _cbf . _ccg } ;
2021-01-04 16:11:39 +00:00
2023-04-15 17:27:31 +00:00
// SetTextAnchor controls the text anchoring
2023-05-26 09:49:04 +00:00
func ( _egefe TextBox ) SetTextAnchor ( a _fd . ST_TextAnchoringType ) { _egefe . _abde . TxBody . BodyPr = _fd . NewCT_TextBodyProperties ( ) ; _egefe . _abde . TxBody . BodyPr . AnchorAttr = a ; } ;
2020-08-23 14:15:53 +00:00
2023-05-26 09:49:04 +00:00
// Text returns text from a presentation as one string separated with line breaks.
func ( _agf * PresentationText ) Text ( ) string { _eadd := _bd . NewBuffer ( [ ] byte { } ) ; for _ , _gfa := range _agf . Slides { _eadd . WriteString ( _gfa . Text ( ) ) ; } ; return _eadd . String ( ) ; } ; func _ccf ( ) * Presentation { _ffc := & Presentation { _bbf : _cc . NewPresentation ( ) } ; _ffc . _bbf . SldIdLst = _cc . NewCT_SlideIdList ( ) ; _ffc . _bbf . ConformanceAttr = _cb . ST_ConformanceClassTransitional ; _ffc . AppProperties = _ea . NewAppProperties ( ) ; _ffc . CoreProperties = _ea . NewCoreProperties ( ) ; _ffc . _ace = _ea . NewTableStyles ( ) ; _ffc . ContentTypes = _ea . NewContentTypes ( ) ; _ffc . Rels = _ea . NewRelationships ( ) ; _ffc . _cbdb = _ea . NewRelationships ( ) ; _ffc . _cbde = NewPresentationProperties ( ) ; _ffc . _cfe = NewViewProperties ( ) ; _ffc . _fed = map [ string ] string { } ; return _ffc ; } ;
2023-04-15 17:27:31 +00:00
2023-05-26 09:49:04 +00:00
// OutlineViewPr returns the OutlineViewPr property.
func ( _cagd ViewProperties ) OutlineViewPr ( ) * _cc . CT_OutlineViewProperties { return _cagd . _gdaf . OutlineViewPr ; } ;
2020-08-23 14:15:53 +00:00
2023-05-26 09:49:04 +00:00
// SlideSize represents a slide size of a presentation.
type SlideSize struct { _daef * _cc . CT_SlideSize ; _afbb * Presentation ; } ;
2020-08-23 14:15:53 +00:00
2023-05-26 09:49:04 +00:00
// Themes returns an array of presentation themes.
func ( _cffa * Presentation ) Themes ( ) [ ] * _fd . Theme { return _cffa . _gfb } ;
2021-08-23 20:44:48 +00:00
2023-05-26 09:49:04 +00:00
// NewSlideScreenSizeWithValue returns slide screen size with given width and height.
// Width and Height value is in EMU units, use our measurement.ToEMU to convert the -
// width and height value.
func NewSlideScreenSizeWithValue ( width , height int32 ) SlideScreenSize { return SlideScreenSize { width , height } ; } ;
2022-04-09 14:27:46 +00:00
2023-05-26 09:49:04 +00:00
// AddImage adds an image textbox to a slide.
func ( _cgacf Slide ) AddImage ( img _ea . ImageRef ) Image { _ccfd := _cc . NewCT_GroupShapeChoice ( ) ; _cgacf . _bffe . CSld . SpTree . Choice = append ( _cgacf . _bffe . CSld . SpTree . Choice , _ccfd ) ; _aaagd := _cc . NewCT_Picture ( ) ; _ccfd . Pic = append ( _ccfd . Pic , _aaagd ) ; _aaagd . NvPicPr . CNvPicPr = _fd . NewCT_NonVisualPictureProperties ( ) ; _aaagd . NvPicPr . CNvPicPr . PicLocks = _fd . NewCT_PictureLocking ( ) ; _aaagd . NvPicPr . CNvPicPr . PicLocks . NoChangeAspectAttr = _gb . Bool ( true ) ; _aaagd . BlipFill = _fd . NewCT_BlipFillProperties ( ) ; _aaagd . BlipFill . Blip = _fd . NewCT_Blip ( ) ; _dee := _cgacf . AddImageToRels ( img ) ; _aaagd . BlipFill . Blip . EmbedAttr = _gb . String ( _dee ) ; _aaagd . BlipFill . Stretch = _fd . NewCT_StretchInfoProperties ( ) ; _aaagd . BlipFill . Stretch . FillRect = _fd . NewCT_RelativeRect ( ) ; _aaagd . SpPr = _fd . NewCT_ShapeProperties ( ) ; _aaagd . SpPr . PrstGeom = _fd . NewCT_PresetGeometry2D ( ) ; _aaagd . SpPr . PrstGeom . PrstAttr = _fd . ST_ShapeTypeRect ; _fecg := Image { _aaagd } ; _dbag := img . Size ( ) ; _fecg . Properties ( ) . SetWidth ( _acb . Distance ( _dbag . X ) * _acb . Pixel72 ) ; _fecg . Properties ( ) . SetHeight ( _acb . Distance ( _dbag . Y ) * _acb . Pixel72 ) ; _fecg . Properties ( ) . SetPosition ( 0 , 0 ) ; return _fecg ; } ; func ( _ccbb * Slide ) ensureClrMap ( ) { if len ( _ccbb . _gag . _fda ) == 0 || len ( _ccbb . _gag . _gfb ) == 0 { return ; } ; _dded := _ccbb . _gag . _fda [ 0 ] ; _gdeg := _dded . ClrMap ; if _eaedc := _ccbb . _bffe . ClrMapOvr ; _eaedc != nil { if _bccc := _eaedc . Choice ; _bccc != nil { if _bccc . MasterClrMapping == nil { if _dbbg := _bccc . OverrideClrMapping ; _dbbg != nil { if _dbbg . Bg1Attr != _fd . ST_ColorSchemeIndexUnset { _gdeg . Bg1Attr = _dbbg . Bg1Attr ; } ; if _dbbg . Tx1Attr != _fd . ST_ColorSchemeIndexUnset { _gdeg . Tx1Attr = _dbbg . Tx1Attr ; } ; if _dbbg . Bg2Attr != _fd . ST_ColorSchemeIndexUnset { _gdeg . Bg2Attr = _dbbg . Bg2Attr ; } ; if _dbbg . Tx2Attr != _fd . ST_ColorSchemeIndexUnset { _gdeg . Tx2Attr = _dbbg . Tx2Attr ; } ; if _dbbg . Accent1Attr != _fd . ST_ColorSchemeIndexUnset { _gdeg . Accent1Attr = _dbbg . Accent1Attr ; } ; if _dbbg . Accent2Attr != _fd . ST_ColorSchemeIndexUnset { _gdeg . Accent2Attr = _dbbg . Accent2Attr ; } ; if _dbbg . Accent3Attr != _fd . ST_ColorSchemeIndexUnset { _gdeg . Accent3Attr = _dbbg . Accent3Attr ; } ; if _dbbg . Accent4Attr != _fd . ST_ColorSchemeIndexUnset { _gdeg . Accent4Attr = _dbbg . Accent4Attr ; } ; if _dbbg . Accent5Attr != _fd . ST_ColorSchemeIndexUnset { _gdeg . Accent5Attr = _dbbg . Accent5Attr ; } ; if _dbbg . Accent6Attr != _fd . ST_ColorSchemeIndexUnset { _gdeg . Accent6Attr = _dbbg . Accent6Attr ; } ; if _dbbg . HlinkAttr != _fd . ST_ColorSchemeIndexUnset { _gdeg . HlinkAttr = _dbbg . HlinkAttr ; } ; if _dbbg . FolHlinkAttr != _fd . ST_ColorSchemeIndexUnset { _gdeg . FolHlinkAttr = _dbbg . FolHlinkAttr ; } ; } ; } ; } ; } ; _ccbb . _dcee = _gdeg ; } ; func ( _cbg sort2d ) Swap ( i , j int ) { _cbg [ i ] , _cbg [ j ] = _cbg [ j ] , _cbg [ i ] } ; type chart struct { _eda * _a . ChartSpace ; _ccg string ; _abd string ; } ;
2022-01-15 21:17:38 +00:00
2023-05-26 09:49:04 +00:00
// SetWidth sets width of slide screen size with given value in EMU units.
func ( _ebad * SlideScreenSize ) SetWidth ( val int32 ) { _ebad [ 0 ] = val } ;
2021-09-22 16:41:01 +00:00
2023-05-26 09:49:04 +00:00
// ShowCommentsAttr returns the WebPr property.
func ( _cbef ViewProperties ) ShowCommentsAttr ( ) * bool { return _cbef . _gdaf . ShowCommentsAttr } ;
2023-03-01 18:42:44 +00:00
2023-04-15 17:27:31 +00:00
// GetImageByRelID returns an ImageRef with the associated relation ID in the
2023-05-26 09:49:04 +00:00
// slide.
func ( _gee * Slide ) GetImageByRelID ( relID string ) ( _ea . ImageRef , bool ) { _face := _gee . getSlideRels ( ) ; if ( _face == _ea . Relationships { } ) { return _ea . ImageRef { } , false ; } ; var _efd string ; for _ , _cabf := range _face . X ( ) . Relationship { if _cabf . IdAttr == relID { _efd = _cabf . TargetAttr ; break ; } ; } ; for _ , _cgde := range _gee . _gag . Images { if _cgde . Target ( ) == _efd { return _cgde , true ; } ; } ; return _ea . ImageRef { } , false ; } ;
2023-03-01 18:42:44 +00:00
2023-05-26 09:49:04 +00:00
// PlaceHolders returns all of the content place holders within a given slide.
func ( _aeea Slide ) PlaceHolders ( ) [ ] PlaceHolder { _bbfab := [ ] PlaceHolder { } ; for _ , _gccd := range _aeea . _bffe . CSld . SpTree . Choice { for _ , _fccf := range _gccd . Sp { if _fccf . NvSpPr != nil && _fccf . NvSpPr . NvPr != nil && _fccf . NvSpPr . NvPr . Ph != nil { _bbfab = append ( _bbfab , PlaceHolder { _fccf , _aeea . _bffe } ) ; } ; } ; } ; return _bbfab ; } ;
2022-02-25 19:20:45 +00:00
2023-05-26 09:49:04 +00:00
// PrnPr returns the PrnPr property.
func ( _gce PresentationProperties ) PrnPr ( ) * _cc . CT_PrintProperties { return _gce . _cfbe . PrnPr } ;
2020-08-31 22:58:25 +00:00
2023-04-15 17:27:31 +00:00
// X returns the inner wrapped XML type.
2023-05-26 09:49:04 +00:00
func ( _aafe * Presentation ) X ( ) * _cc . Presentation { return _aafe . _bbf } ;
2020-08-23 14:15:53 +00:00
2023-05-26 09:49:04 +00:00
// ClrMru returns the ClrMru property.
func ( _fbea PresentationProperties ) ClrMru ( ) * _fd . CT_ColorMRU { return _fbea . _cfbe . ClrMru } ;
2020-08-23 14:15:53 +00:00
2023-05-26 09:49:04 +00:00
// X returns TextBox's underlying *pml.CT_Shape.
func ( _egef TextBox ) X ( ) * _cc . CT_Shape { return _egef . _abde } ;
2020-08-23 14:15:53 +00:00
2023-05-26 09:49:04 +00:00
// NewPresentationProperties constructs a new PresentationProperties.
func NewPresentationProperties ( ) PresentationProperties { return PresentationProperties { _cfbe : _cc . NewPresentationPr ( ) } ; } ;
2020-08-23 14:15:53 +00:00
2023-05-26 09:49:04 +00:00
// Properties returns the properties of the TextBox.
func ( _cdd Image ) Properties ( ) _ed . ShapeProperties { if _cdd . _cag . SpPr == nil { _cdd . _cag . SpPr = _fd . NewCT_ShapeProperties ( ) ; } ; return _ed . MakeShapeProperties ( _cdd . _cag . SpPr ) ; } ;
2020-08-23 14:15:53 +00:00
2023-05-26 09:49:04 +00:00
// NewSlideScreenSize returns slide screen size with default MS PowerPoint slide screen size 16x9.
func NewSlideScreenSize ( ) SlideScreenSize { return NewSlideScreenSizeWithValue ( SlideScreenSize16x9 [ 0 ] , SlideScreenSize16x9 [ 1 ] ) ; } ;
2022-12-06 11:56:49 +00:00
2023-05-26 09:49:04 +00:00
// AddParagraph adds a paragraph to the text box
func ( _bgb TextBox ) AddParagraph ( ) _ed . Paragraph { _ddee := _fd . NewCT_TextParagraph ( ) ; _bgb . _abde . TxBody . P = append ( _bgb . _abde . TxBody . P , _ddee ) ; return _ed . MakeParagraph ( _ddee ) ; } ;
2020-08-23 14:15:53 +00:00
2023-05-26 09:49:04 +00:00
// GetPlaceholder returns a placeholder given its type. If there are multiplace
// placeholders of the same type, this method returns the first one. You must use the
// PlaceHolders() method to access the others.
func ( _fddc Slide ) GetPlaceholder ( t _cc . ST_PlaceholderType ) ( PlaceHolder , error ) { for _ , _aaecb := range _fddc . _bffe . CSld . SpTree . Choice { for _ , _gcee := range _aaecb . Sp { if _gcee . NvSpPr != nil && _gcee . NvSpPr . NvPr != nil && _gcee . NvSpPr . NvPr . Ph != nil { if _gcee . NvSpPr . NvPr . Ph . TypeAttr == t { return PlaceHolder { _gcee , _fddc . _bffe } , nil ; } ; } ; } ; } ; return PlaceHolder { } , _gg . New ( "\u0075\u006e\u0061\u0062\u006c\u0065\u0020\u0074\u006f\u0020\u0066i\u006e\u0064\u0020\u0070\u006c\u0061\u0063\u0065\u0068\u006fl\u0064\u0065\u0072" ) ; } ;
2020-08-23 14:15:53 +00:00
2023-05-26 09:49:04 +00:00
// GetTextBoxes returns a list of all text boxes from a slide.
func ( _fddf Slide ) GetTextBoxes ( ) [ ] * TextBox { _bcff := [ ] * TextBox { } ; _edea := _fddf . _bffe . CSld . SpTree . Choice ; for _ , _ggf := range _edea { for _ , _cffe := range _ggf . Sp { if _cffe . NvSpPr . CNvSpPr . TxBoxAttr != nil && * _cffe . NvSpPr . CNvSpPr . TxBoxAttr { _bcff = append ( _bcff , & TextBox { _cffe } ) ; } ; } ; } ; return _bcff ; } ;
2021-04-23 20:00:00 +00:00
2023-05-26 09:49:04 +00:00
// GetLayoutByName retrieves a slide layout given a layout name.
func ( _gdb * Presentation ) GetLayoutByName ( name string ) ( SlideLayout , error ) { for _ , _gdgc := range _gdb . _geg { if _gdgc . CSld . NameAttr != nil && name == * _gdgc . CSld . NameAttr { return SlideLayout { _gdgc } , nil ; } ; } ; return SlideLayout { } , _gg . New ( "\u0075\u006eab\u006c\u0065\u0020t\u006f\u0020\u0066\u0069nd \u006cay\u006f\u0075\u0074\u0020\u0077\u0069\u0074h \u0074\u0068\u0061\u0074\u0020\u006e\u0061m\u0065" ) ; } ;
2020-06-07 20:13:15 +07:00
2023-05-26 09:49:04 +00:00
// ValidateWithPath validates the slide passing path informaton for a better
// error message.
func ( _gdgg Slide ) ValidateWithPath ( path string ) error { if _dgded := _gdgg . _bffe . ValidateWithPath ( path ) ; _dgded != nil { return _dgded ; } ; for _ , _badd := range _gdgg . _bffe . CSld . SpTree . Choice { for _ , _cee := range _badd . Sp { if _cee . TxBody != nil { if len ( _cee . TxBody . P ) == 0 { return _gg . New ( path + "\u0020\u003a \u0073\u006c\u0069\u0064\u0065 \u0073\u0068\u0061\u0070\u0065 \u0077\u0069\u0074\u0068\u0020\u0061\u0020\u0074\u0078\u0062\u006f\u0064\u0079\u0020\u006d\u0075\u0073\u0074\u0020\u0063\u006f\u006e\u0074\u0061\u0069\u006e\u0020\u0070\u0061\u0072\u0061\u0067\u0072\u0061\u0070\u0068\u0073" ) ; } ; } ; } ; } ; return nil ; } ;
2017-10-03 09:55:27 -05:00
2023-05-26 09:49:04 +00:00
// SlideViewPr returns the SlideViewPr property.
func ( _fdb ViewProperties ) SlideViewPr ( ) * _cc . CT_SlideViewProperties { return _fdb . _gdaf . SlideViewPr } ;
2017-10-03 09:55:27 -05:00
2023-05-26 09:49:04 +00:00
// SetOffsetX sets horizontal offset of text box in distance units (see measurement package).
func ( _dbagg TextBox ) SetOffsetX ( offX float64 ) { _dgb := _dbagg . getOff ( ) ; _egcb := _acb . ToEMU ( offX ) ; _dgb . XAttr = _fd . ST_Coordinate { ST_CoordinateUnqualified : & _egcb } ; } ; var ( SlideScreenSize16x9 = SlideScreenSize { 12192000 , 6858000 } ; SlideScreenSize4x3 = SlideScreenSize { 9144000 , 6858000 } ; SlideScreenSizeA4 = SlideScreenSize { 9906000 , 6858000 } ; ) ;
2022-02-05 13:05:36 +00:00
2023-05-26 09:49:04 +00:00
// NewViewProperties constructs a new ViewProperties.
func NewViewProperties ( ) ViewProperties { return ViewProperties { _gdaf : _cc . NewViewPr ( ) } } ; var _cgac = false ;
2023-04-15 17:27:31 +00:00
2023-05-26 09:49:04 +00:00
// ExtLst returns the ExtLst property.
func ( _aeb PresentationProperties ) ExtLst ( ) * _cc . CT_ExtensionList { return _aeb . _cfbe . ExtLst } ;
2021-01-04 16:11:39 +00:00
2023-05-26 09:49:04 +00:00
// SlideLayout is a layout from which slides can be created.
type SlideLayout struct { _aecga * _cc . SldLayout } ;
2021-01-04 16:11:39 +00:00
2023-05-26 09:49:04 +00:00
// SlideMaster is the slide master for a presentation.
type SlideMaster struct { _cffd * Presentation ; _fgff _ea . Relationships ; _bffb * _cc . SldMaster ; } ;
2021-09-22 16:41:01 +00:00
2023-05-26 09:49:04 +00:00
// AddParagraph adds a new paragraph to a placeholder.
func ( _bab PlaceHolder ) AddParagraph ( ) _ed . Paragraph { _dge := _ed . MakeParagraph ( _fd . NewCT_TextParagraph ( ) ) ; _bab . _gdg . TxBody . P = append ( _bab . _gdg . TxBody . P , _dge . X ( ) ) ; return _dge ; } ;
2021-05-31 16:22:30 +00:00
2023-05-26 09:49:04 +00:00
// New initializes and reurns a new presentation
func New ( ) * Presentation { _caab := _ccf ( ) ; _caab . ContentTypes . AddOverride ( "/\u0070\u0070\u0074\u002fpr\u0065s\u0065\u006e\u0074\u0061\u0074i\u006f\u006e\u002e\u0078\u006d\u006c" , "\u0061\u0070\u0070\u006c\u0069\u0063\u0061t\u0069\u006f\u006e\u002f\u0076\u006e\u0064\u002e\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072m\u0061\u0074\u0073\u002d\u006ff\u0066\u0069\u0063\u0065\u0064\u006f\u0063\u0075\u006de\u006e\u0074\u002e\u0070\u0072\u0065\u0073\u0065\u006e\u0074\u0061\u0074\u0069\u006f\u006e\u006d\u006c\u002e\u0070\u0072\u0065\u0073\u0065\u006e\u0074\u0061\u0074\u0069\u006f\u006e\u002e\u006d\u0061\u0069\u006e\u002b\u0078\u006d\u006c" ) ; _caab . Rels . AddRelationship ( "\u0064\u006f\u0063\u0050\u0072\u006f\u0070\u0073\u002f\u0063\u006f\u0072e\u002e\u0078\u006d\u006c" , "\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061s\u002e\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066o\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006ba\u0067\u0065\u002f\u0032\u0030\u0030\u0036\u002f\u0072\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u0073\u002f\u006d\u0065\u0074\u0061\u0064\u0061\u0074\u0061/\u0063\u006f\u0072\u0065\u002d\u0070\u0072\u006f\u0070e\u0072\u0074i\u0065\u0073" ) ; _caab . Rels . AddRelationship ( "\u0064\u006fc\u0050\u0072\u006fp\u0073\u002f\u0061\u0070\u0070\u002e\u0078\u006d\u006c" , "\u0068t\u0074\u0070\u003a\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073\u002eo\u0070\u0065\u006ex\u006d\u006c\u0066\u006f\u0072\u006da\u0074\u0073.\u006f\u0072\u0067\u002f\u006f\u0066\u0066\u0069\u0063\u0065\u0044\u006f\u0063\u0075\u006d\u0065\u006e\u0074\u002f\u0032\u0030\u0030\u0036\u002f\u0072\u0065\u006c\u0061\u0074i\u006f\u006e\u0073\u0068\u0069p\u0073\u002f\u0065x\u0074\u0065\u006e\u0064\u0065d\u002d\u0070\u0072\u006f\u0070\u0065\u0072\u0074\u0069\u0065\u0073" ) ; _caab . Rels . AddRelationship ( "p\u0070t\u002f\u0070\u0072\u0065\u0073\u0065\u006e\u0074a\u0074\u0069\u006f\u006e.x\u006d\u006c" , "\u0068\u0074\u0074\u0070\u003a\u002f\u002fs\u0063\u0068\u0065\u006d\u0061\u0073\u002e\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006da\u0074\u0073\u002e\u006f\u0072g\u002f\u006f\u0066\u0066\u0069\u0063\u0065\u0044\u006fc\u0075\u006d\u0065\u006e\u0074\u002f\u0032\u0030\u0030\u0036\u002f\u0072\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u0073\u002f\u006f\u0066\u0066\u0069\u0063\u0065\u0044\u006f\u0063\u0075\u006d\u0065\u006e\u0074" ) ; _caab . Rels . AddRelationship ( "\u0070\u0070\u0074\u002f\u0070\u0072\u0065\u0073\u0050\u0072\u006f\u0070s\u002e\u0078\u006d\u006c" , "ht\u0074\u0070\u003a\u002f\u002f\u0073\u0063he\u006d\u0061\u0073\u002e\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006da\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u006f\u0066\u0066\u0069\u0063\u0065\u0044\u006f\u0063\u0075\u006d\u0065\u006et\u002f\u0032\u0030\u0030\u0036\u002fr\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073\u0068i\u0070s\u002f\u0070\u0072\u0065\u0073\u0050\u0072\u006f\u0070\u0073" ) ; _caab . Rels . AddRelationship ( "\u0070\u0070\u0074\u002f\u0076\u0069\u0065\u0077\u0050\u0072\u006f\u0070s\u002e\u0078\u006d\u006c" , "ht\u0074\u0070\u003a\u002f\u002f\u0073\u0063he\u006d\u0061\u0073\u002e\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006da\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u006f\u0066\u0066\u0069\u0063\u0065\u0044\u006f\u0063\u0075\u006d\u0065\u006et\u002f\u0032\u0030\u0030\u0036\u002fr\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073\u0068i\u0070s\u002f\u0076\u0069\u0065\u0077\u0050\u0072\u006f\u0070\u0073" ) ; _caab . Rels . AddRelationship ( "\u0070\u0070\u0074\u002fta\u0062\u006c\u0065\u0053\u0074\u0079\u006c\u0065\u0073\u002e\u0078\u006d\u006c" , " \ u0068 \ u0074 \ u0074 \ u0070 \ u003a \ u002f \ u002fs \ u0063 \ u0068 \ u0065 \ u006d \ u0061 \ u0073 \ u002e \ u006f \ u0070 \ u0065 \ u006e \ u0078 \ u006d \ u006cf \ u006fr \ u006d \ u0061 \ u0074 \ u0073 \ u002e \ u006fr \ u0067 \ u002f \ u006f \ u0066 \ u0066 \ u0069 \ u0063e \ u0044 \ u006f \ u0063 \ u0075 \ u006d \ u0065 \ u006e \ u0074 \ u002f \ u0032 \ u0030 \ u0030 \ u0036 \ u002f \ u0072 \ u0065 \ u006c \ u0061 \ u0074 \ u0069 \ u006f \ u006e \ u0073h \ u0069 \ u0070 \ u0073 \ u002f \ u0
2022-09-02 11:46:53 +00:00
2023-04-15 17:27:31 +00:00
// SetText sets the text of a placeholder for the initial paragraph. This is a
// shortcut method that is useful for things like titles which only contain a
// single paragraph.
2023-05-26 09:49:04 +00:00
func ( _cced PlaceHolder ) SetText ( text string ) { _cced . Clear ( ) ; _cgcda := _fd . NewEG_TextRun ( ) ; _cgcda . R = _fd . NewCT_RegularTextRun ( ) ; _cgcda . R . T = text ; if len ( _cced . _gdg . TxBody . P ) == 0 { _cced . _gdg . TxBody . P = append ( _cced . _gdg . TxBody . P , _fd . NewCT_TextParagraph ( ) ) ; } ; _cced . _gdg . TxBody . P [ 0 ] . EG_TextRun = nil ; _cced . _gdg . TxBody . P [ 0 ] . EG_TextRun = append ( _cced . _gdg . TxBody . P [ 0 ] . EG_TextRun , _cgcda ) ; } ;
2022-09-02 11:46:53 +00:00
2023-05-26 09:49:04 +00:00
// PresentationProperties contains document specific properties.
type PresentationProperties struct { _cfbe * _cc . PresentationPr } ;
2021-09-22 16:41:01 +00:00
2023-05-26 09:49:04 +00:00
// TableInfo is used for keep information about a table, a row and a cell where the text is located.
type TableInfo struct { Table * _fd . CT_Table ; Row * _fd . CT_TableRow ; Cell * _fd . CT_TableCell ; RowIndex int ; ColIndex int ; } ; func _eed ( _de * Presentation , _cgd * _cc . CT_Shape , _eb * _cc . CT_GraphicalObjectFrame , _cfd * TableInfo , _cd * _fd . CT_Transform2D , _db int , _dgg [ ] rectangle , _ebd [ ] * _fd . CT_TextParagraph ) [ ] * TextItem { _bdf := [ ] * TextItem { } ; var _gf , _ffag , _cce , _cfb , _ffd , _cgff int64 ; _afa := _cd == nil ; _fbe := 0 ; for _ , _dcb := range _ebd { for _ , _agbc := range _dcb . EG_TextRun { if _bfe := _agbc . R ; _bfe != nil { if ! _afa { if _cd . Off != nil { if _fc := _cd . Ext ; _fc != nil { _ffd , _cgff = _fc . CxAttr , _fc . CyAttr ; } ; if _cff := _cd . Off . XAttr . ST_CoordinateUnqualified ; _cff != nil { _gf = * _cff ; _ffag = _gf + _ffd ; _afa = true ; } ; if _cgc := _cd . Off . YAttr . ST_CoordinateUnqualified ; _cgc != nil { _cce = * _cgc ; _cfb = _cce + _cgff ; _afa = true ; } ; } ; } ; _ead := append ( [ ] rectangle { } , _dgg ... ) ; _ead = append ( _ead , rectangle { _dc : _gf , _ec : _ffag , _bec : _cce , _ca : _cfb } ) ; _bdf = append ( _bdf , & TextItem { Presentation : _de , Shape : _cgd , GraphicFrame : _eb , TableInfo : _cfd , Paragraph : _dcb , Run : _bfe , Text : _bfe . T , _be : _ead , _abf : _db , _ccgb : _fbe } ) ; _fbe ++ ; } ; } ; } ; return _bdf ; } ;
2021-09-22 16:41:01 +00:00
2023-05-26 09:49:04 +00:00
// ShowPr returns the ShowPr property.
func ( _abb PresentationProperties ) ShowPr ( ) * _cc . CT_ShowProperties { return _abb . _cfbe . ShowPr } ;
// X returns the inner wrapped XML type.
func ( _agbac SlideLayout ) X ( ) * _cc . SldLayout { return _agbac . _aecga } ; type rectangle struct { _dc int64 ; _bec int64 ; _ec int64 ; _ca int64 ; } ;
2021-09-22 16:41:01 +00:00
2023-04-15 17:27:31 +00:00
// WebPr returns the WebPr property.
2023-05-26 09:49:04 +00:00
func ( _ffagg PresentationProperties ) WebPr ( ) * _cc . CT_WebProperties { return _ffagg . _cfbe . WebPr } ;
2021-09-22 16:41:01 +00:00
2023-05-26 09:49:04 +00:00
// Less is for implementing sorting of two locations. Symbols share the same location if they are in the same paragraph or table. One location is 'less' than another first by y coordinate, if y coordinates are equal or differ by less than yEpsilon, then x coordinates are compared, then if they are also equal, indexes of locations in the table are compared, then positions of locations in a paragraph.
func ( _cgb sort2d ) Less ( i , j int ) bool { _cgcd , _dab := _cgb [ i ] , _cgb [ j ] ; _ceca , _abdc := _cgcd . _be , _dab . _be ; _aa , _ceb := len ( _ceca ) - 1 , len ( _abdc ) - 1 ; _df , _abfe := 0 , 0 ; for { _agec , _ecf , _ecd , _ba , _bc , _gbc , _cedc , _gad := _ceca [ _df ] . _bec , _abdc [ _abfe ] . _bec , _ceca [ _df ] . _ca , _abdc [ _abfe ] . _ca , _ceca [ _df ] . _dc , _abdc [ _abfe ] . _dc , _ceca [ _df ] . _ec , _abdc [ _abfe ] . _ec ; if _agec == _ecf || ( ( _cgg . Abs ( float64 ( _agec ) - float64 ( _ecf ) ) < _fcac ) && ( ( _agec >= _ecf && _agec <= _ba ) || ( _ecf >= _agec && _ecf <= _ecd ) ) && ( _cedc < _gbc || _bc > _gad ) ) { if _bc == _gbc { if _df < _aa && _abfe < _ceb { _df ++ ; _abfe ++ ; continue ; } ; if _df >= _aa && _abfe >= _ceb { break ; } ; return _df >= _aa ; } else { return _bc < _gbc ; } ; } else { return _agec < _ecf ; } ; } ; _cdb , _aae , _gfc , _fdc := _cgcd . _abf , _dab . _abf , _cgcd . _ccgb , _dab . _ccgb ; if _cdb == _aae { return _gfc <= _fdc ; } ; return _cdb < _aae ; } ;
2021-09-22 16:41:01 +00:00
2023-05-26 09:49:04 +00:00
// SlideScreenSize represents the slide screen size as a 2 element array
// representing the width and height in EMU units.
type SlideScreenSize [ 2 ] int32 ;
2021-09-22 16:41:01 +00:00
2023-05-26 09:49:04 +00:00
// SorterViewPr returns the SorterViewPr property.
func ( _ddaf ViewProperties ) SorterViewPr ( ) * _cc . CT_SlideSorterViewProperties { return _ddaf . _gdaf . SorterViewPr ; } ;
2021-09-22 16:41:01 +00:00
2023-05-26 09:49:04 +00:00
// Clear clears the placeholder contents and adds a single empty paragraph. The
// empty paragrah is required by PowerPoint or it will report the file as being
// invalid.
func ( _becb PlaceHolder ) Clear ( ) { _becb . ClearAll ( ) ; _fgf := _fd . NewCT_TextParagraph ( ) ; _becb . _gdg . TxBody . P = [ ] * _fd . CT_TextParagraph { _fgf } ; _fgf . EndParaRPr = _fd . NewCT_TextCharacterProperties ( ) ; _fgf . EndParaRPr . LangAttr = _gb . String ( "\u0065\u006e\u002dU\u0053" ) ; } ;
2021-09-22 16:41:01 +00:00
2023-05-26 09:49:04 +00:00
// GetPlaceholderByIndex returns a placeholder given its index. If there are multiplace
// placeholders of the same index, this method returns the first one. You must use the
// PlaceHolders() method to access the others.
func ( _gbb Slide ) GetPlaceholderByIndex ( idx uint32 ) ( PlaceHolder , error ) { for _ , _ggaf := range _gbb . _bffe . CSld . SpTree . Choice { for _ , _agba := range _ggaf . Sp { if _agba . NvSpPr != nil && _agba . NvSpPr . NvPr != nil && _agba . NvSpPr . NvPr . Ph != nil { if ( idx == 0 && _agba . NvSpPr . NvPr . Ph . IdxAttr == nil ) || ( _agba . NvSpPr . NvPr . Ph . IdxAttr != nil && * _agba . NvSpPr . NvPr . Ph . IdxAttr == idx ) { return PlaceHolder { _agba , _gbb . _bffe } , nil ; } ; } ; } ; } ; return PlaceHolder { } , _gg . New ( "\u0075\u006e\u0061\u0062\u006c\u0065\u0020\u0074\u006f\u0020\u0066i\u006e\u0064\u0020\u0070\u006c\u0061\u0063\u0065\u0068\u006fl\u0064\u0065\u0072" ) ; } ;
2022-09-02 11:46:53 +00:00
2023-05-26 09:49:04 +00:00
// NormalViewPr returns the NormalViewPr property.
func ( _effg ViewProperties ) NormalViewPr ( ) * _cc . CT_NormalViewProperties { return _effg . _gdaf . NormalViewPr ; } ;
2022-09-02 11:46:53 +00:00
2023-05-26 09:49:04 +00:00
// AddTable adds a new table to a placeholder.
func ( _caa PlaceHolder ) AddTable ( ) * _ea . Table { _caa . Clear ( ) ; _fbg := _cc . NewCT_GroupShapeChoice ( ) ; _caa . _cdf . CSld . SpTree . Choice = append ( _caa . _cdf . CSld . SpTree . Choice , _fbg ) ; _ggd := _cc . NewCT_GraphicalObjectFrame ( ) ; _fbg . GraphicFrame = append ( _fbg . GraphicFrame , _ggd ) ; _ggd . Xfrm . Off = _fd . NewCT_Point2D ( ) ; _gbe := int64 ( 1 ) ; _ggd . Xfrm . Off . XAttr = _fd . ST_Coordinate { ST_CoordinateUnqualified : & _gbe } ; _ggd . Xfrm . Off . YAttr = _fd . ST_Coordinate { ST_CoordinateUnqualified : & _gbe } ; _bbc := _ggd . Graphic . CT_GraphicalObject . GraphicData ; _bbc . UriAttr = "\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073\u002eo\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073.\u006f\u0072\u0067\u002f\u0064\u0072\u0061\u0077\u0069\u006e\u0067\u006dl/\u0032\u0030\u0030\u0036\u002f\u0074\u0061\u0062\u006c\u0065" ; _agcf := _ea . NewTableWithXfrm ( _ggd . Xfrm ) ; _bbc . Any = append ( _bbc . Any , _agcf . X ( ) ) ; return _agcf ; } ;
2022-12-06 11:56:49 +00:00
2023-05-26 09:49:04 +00:00
// Close closes the presentation, removing any temporary files that might have been
// created when opening a document.
func ( _eaed * Presentation ) Close ( ) error { if _eaed . TmpPath != "" { return _gcb . RemoveAll ( _eaed . TmpPath ) ; } ; return nil ; } ;
2022-02-05 13:05:36 +00:00
2023-05-26 09:49:04 +00:00
// SlideLayouts returns a slice of all layouts in SlideMaster.
func ( _dgf SlideMaster ) SlideLayouts ( ) [ ] SlideLayout { _bbd := map [ string ] int { } ; _add := [ ] SlideLayout { } ; for _ , _bde := range _dgf . _fgff . Relationships ( ) { _afeg := _g . Replace ( _bde . Target ( ) , ".\u002e\u002f\u0073\u006c\u0069\u0064e\u004c\u0061\u0079\u006f\u0075\u0074\u0073\u002f\u0073l\u0069\u0064\u0065L\u0061y\u006f\u0075\u0074" , "" , - 1 ) ; _afeg = _g . Replace ( _afeg , "\u002e\u0078\u006d\u006c" , "" , - 1 ) ; if _adff , _dabe := _ac . ParseInt ( _afeg , 10 , 32 ) ; _dabe == nil { _bbd [ _bde . ID ( ) ] = int ( _adff ) ; } ; } ; for _ , _bee := range _dgf . _bffb . SldLayoutIdLst . SldLayoutId { if _ddcf , _aada := _bbd [ _bee . RIdAttr ] ; _aada { _feace := _dgf . _cffd . _geg [ _ddcf - 1 ] ; _add = append ( _add , SlideLayout { _feace } ) ; } ; } ; return _add ; } ; func ( _abe * chart ) X ( ) * _a . ChartSpace { return _abe . _eda } ;
2022-02-05 13:05:36 +00:00
2023-05-26 09:49:04 +00:00
// RemoveSlide removes a slide from a presentation.
func ( _gga * Presentation ) RemoveSlide ( s Slide ) error { _faca := false ; _afb := 0 ; for _cbac , _caae := range _gga . _aab { if _caae == s . _bffe { if _gga . _bbf . SldIdLst . SldId [ _cbac ] != s . _egf { return _gg . New ( "i\u006e\u0063\u006f\u006e\u0073\u0069s\u0074\u0065\u006e\u0063\u0079\u0020i\u006e\u0020\u0073\u006c\u0069\u0064\u0065s\u0020\u0061\u006e\u0064\u0020\u0049\u0044\u0020\u006c\u0069s\u0074" ) ; } ; copy ( _gga . _aab [ _cbac : ] , _gga . _aab [ _cbac + 1 : ] ) ; _gga . _aab = _gga . _aab [ 0 : len ( _gga . _aab ) - 1 ] ; copy ( _gga . _abba [ _cbac : ] , _gga . _abba [ _cbac + 1 : ] ) ; _gga . _abba = _gga . _abba [ 0 : len ( _gga . _abba ) - 1 ] ; copy ( _gga . _bbf . SldIdLst . SldId [ _cbac : ] , _gga . _bbf . SldIdLst . SldId [ _cbac + 1 : ] ) ; _gga . _bbf . SldIdLst . SldId = _gga . _bbf . SldIdLst . SldId [ 0 : len ( _gga . _bbf . SldIdLst . SldId ) - 1 ] ; _faca = true ; _afb = _cbac ; } ; } ; if ! _faca { return _gg . New ( "u\u006ea\u0062\u006c\u0065\u0020\u0074\u006f\u0020\u0066i\u006e\u0064\u0020\u0073li\u0064\u0065" ) ; } ; _bcc := _gb . AbsoluteFilename ( _gb . DocTypePresentation , _gb . SlideType , 0 ) ; return _gga . ContentTypes . RemoveOverrideByIndex ( _bcc , _afb ) ; } ;
2021-09-22 16:41:01 +00:00
2023-05-26 09:49:04 +00:00
// SetHeight sets height of slide screen size with given value in EMU units.
func ( _bbcg * SlideScreenSize ) SetHeight ( val int32 ) { _bbcg [ 1 ] = val } ;
2023-04-15 17:27:31 +00:00
2023-05-26 09:49:04 +00:00
// Slides returns the slides in the presentation.
func ( _bbcb * Presentation ) Slides ( ) [ ] Slide { _edbb := [ ] Slide { } ; for _egd , _gcbd := range _bbcb . _aab { _edbb = append ( _edbb , Slide { _bbcb . _bbf . SldIdLst . SldId [ _egd ] , _gcbd , _bbcb , nil } ) ; } ; return _edbb ; } ;
2023-04-15 17:27:31 +00:00
2023-05-26 09:49:04 +00:00
// AddImageToRels adds an image relationship to a slide without putting image on the slide.
func ( _gbfa Slide ) AddImageToRels ( img _ea . ImageRef ) string { _ffgb := 0 ; for _dedf , _gfd := range _gbfa . _gag . Images { if _gfd == img { _ffgb = _dedf + 1 ; break ; } ; } ; var _baf string ; for _ccfg , _efc := range _gbfa . _gag . Slides ( ) { if _efc . _bffe == _gbfa . _bffe { _bdgf := _da . Sprintf ( "\u002e\u002e\u002f\u006ded\u0069\u0061\u002f\u0069\u006d\u0061\u0067\u0065\u0025\u0064\u002e\u0025\u0073" , _ffgb , img . Format ( ) ) ; _geae := _gbfa . _gag . _abba [ _ccfg ] . AddRelationship ( _bdgf , _gb . ImageType ) ; _baf = _geae . ID ( ) ; } ; } ; return _baf ; } ;
2021-11-10 11:45:21 +00:00
2023-05-26 09:49:04 +00:00
// Type returns the placeholder type
func ( _dcba PlaceHolder ) Type ( ) _cc . ST_PlaceholderType { return _dcba . _gdg . NvSpPr . NvPr . Ph . TypeAttr } ;
2022-02-05 13:05:36 +00:00
2023-05-26 09:49:04 +00:00
// NotesTextViewPr returns the NotesTextViewPr property.
func ( _abdb ViewProperties ) NotesTextViewPr ( ) * _cc . CT_NotesTextViewProperties { return _abdb . _gdaf . NotesTextViewPr ; } ;
2022-04-09 14:27:46 +00:00
2023-05-26 09:49:04 +00:00
// ExtLst returns the ExtLst property.
func ( _bea ViewProperties ) ExtLst ( ) * _cc . CT_ExtensionList { return _bea . _gdaf . ExtLst } ;
2022-02-05 13:05:36 +00:00
2023-05-26 09:49:04 +00:00
// Presentation returns a slide's presentation.
func ( _begc Slide ) Presentation ( ) * Presentation { return _begc . _gag } ; func ( _edeg * Presentation ) saveToFile ( _bffg string , _bfbc bool ) error { _edcb , _bce := _ada . Create ( _bffg ) ; if _bce != nil { return _bce ; } ; defer _edcb . Close ( ) ; return _edeg . save ( _edcb , _bfbc ) ; } ;
2022-02-05 13:05:36 +00:00
2023-05-26 09:49:04 +00:00
// GetSlideLayout returns a slide layout related to the slide.
func ( _fbf * Slide ) GetSlideLayout ( ) * _cc . SldLayout { for _cgcb , _gdec := range _fbf . _gag . Slides ( ) { if * _fbf == _gdec { return _fbf . _gag . _geg [ len ( _fbf . _gag . Slides ( ) ) - _cgcb - 1 ] ; } ; } ; return nil ; } ;
2022-02-05 13:05:36 +00:00
2023-05-26 09:49:04 +00:00
// Height returns slide screen size height in EMU units.
func ( _daae * SlideScreenSize ) Height ( ) int32 { return _daae [ 1 ] } ;
2022-04-09 14:27:46 +00:00
2023-05-26 09:49:04 +00:00
// X returns the inner wrapped XML type.
func ( _fggc Slide ) X ( ) * _cc . Sld { return _fggc . _bffe } ;
2023-04-15 17:27:31 +00:00
2023-05-26 09:49:04 +00:00
// PlaceHolder is a place holder from a slide.
type PlaceHolder struct { _gdg * _cc . CT_Shape ; _cdf * _cc . Sld ; } ;
2023-04-15 17:27:31 +00:00
2023-05-26 09:49:04 +00:00
// ExtractText returns text from a slide as a SlideText object.
func ( _cgf * Slide ) ExtractText ( ) * SlideText { _ae := _fb ( _cgf . _gag , _cgf . _bffe . CSld . SpTree . Choice , [ ] rectangle { } , [ ] * TextItem { } ) ; _ff . Sort ( sort2d ( _ae ) ) ; return & SlideText { Items : _ae } ; } ;
2023-04-15 17:27:31 +00:00
2023-05-26 09:49:04 +00:00
// AddSlideWithLayout adds a new slide with content copied from a layout. Normally you should
// use AddDefaultSlideWithLayout as it will do some post processing similar to PowerPoint to
// clear place holder text, etc.
func ( _dggd * Presentation ) AddSlideWithLayout ( l SlideLayout ) ( Slide , error ) { _gfbe := _cc . NewCT_SlideIdListEntry ( ) ; _gfbe . IdAttr = 256 ; for _ , _ffff := range _dggd . _bbf . SldIdLst . SldId { if _ffff . IdAttr >= _gfbe . IdAttr { _gfbe . IdAttr = _ffff . IdAttr + 1 ; } ; } ; _dggd . _bbf . SldIdLst . SldId = append ( _dggd . _bbf . SldIdLst . SldId , _gfbe ) ; _ede := _cc . NewSld ( ) ; _cdfd := _bd . Buffer { } ; _ebef := _cf . NewEncoder ( & _cdfd ) ; _eaca := _cf . StartElement { Name : _cf . Name { Local : "\u0073\u006c\u0069d\u0065" } } ; _eaca . Attr = append ( _eaca . Attr , _cf . Attr { Name : _cf . Name { Local : "\u0078\u006d\u006cn\u0073" } , Value : "\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073\u002e\u006f\u0070\u0065\u006e\u0078m\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002eo\u0072\u0067\u002f\u0070\u0072\u0065\u0073\u0065\u006e\u0074\u0061\u0074\u0069o\u006e\u006d\u006c\u002f\u0032\u00300\u0036\u002f\u006da\u0069\u006e" } ) ; _eaca . Attr = append ( _eaca . Attr , _cf . Attr { Name : _cf . Name { Local : "\u0078m\u006c\u006e\u0073\u003a\u0061" } , Value : "\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0073\u0063\u0068\u0065m\u0061\u0073\u002e\u006f\u0070\u0065\u006e\u0078m\u006cf\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0064\u0072\u0061\u0077\u0069\u006e\u0067m\u006c\u002f\u0032\u0030\u0030\u0036\u002f\u006d\u0061\u0069\u006e" } ) ; _eaca . Attr = append ( _eaca . Attr , _cf . Attr { Name : _cf . Name { Local : "\u0078m\u006c\u006e\u0073\u003a\u0070" } , Value : "\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073\u002e\u006f\u0070\u0065\u006e\u0078m\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002eo\u0072\u0067\u002f\u0070\u0072\u0065\u0073\u0065\u006e\u0074\u0061\u0074\u0069o\u006e\u006d\u006c\u002f\u0032\u00300\u0036\u002f\u006da\u0069\u006e" } ) ; _eaca . Attr = append ( _eaca . Attr , _cf . Attr { Name : _cf . Name { Local : "\u0078m\u006c\u006e\u0073\u003a\u0072" } , Value : "\u0068\u0074\u0074\u0070\u003a\u002f/\u0073\u0063\u0068\u0065\u006da\u0073\u002e\u006f\u0070\u0065\u006ex\u006d\u006c\u0066\u006f\u0072m\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u006f\u0066\u0066\u0069c\u0065\u0044\u006f\u0063\u0075\u006d\u0065\u006e\u0074\u002f\u0032\u0030\u0030\u0036\u002fr\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073h\u0069\u0070\u0073" } ) ; _eaca . Attr = append ( _eaca . Attr , _cf . Attr { Name : _cf . Name { Local : "\u0078\u006d\u006c\u006e\u0073\u003a\u0073\u0068" } , Value : "\u0068\u0074\u0074\u0070\u003a/\u002f\u0073\u0063\u0068\u0065m\u0061s\u002e\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067/\u006f\u0066\u0066\u0069\u0063\u0065\u0044\u006f\u0063\u0075\u006d\u0065\u006e\u0074\u002f\u0032\u0030\u0030\u0036\u002f\u0073\u0068\u0061\u0072e\u0064\u0054\u0079\u0070\u0065\u0073" } ) ; _eaca . Attr = append ( _eaca . Attr , _cf . Attr { Name : _cf . Name { Local : "\u0078m\u006c\u006e\u0073\u003a\u0078\u006dl" } , Value : "\u0068\u0074tp\u003a\u002f\u002fw\u0077\u0077\u002e\u00773.o\u0072g/\u0058\u004d\u004c\u002f\u0031\u0039\u00398/\u006e\u0061\u006d\u0065\u0073\u0070\u0061c\u0065" } ) ; if _eaa := l . _aecga . CSld . MarshalXML ( _ebef , _eaca ) ; _eaa != nil { return Slide { } , _eaa ; } ; _ebef . Flush ( ) ; _fec := _cf . NewDecoder ( & _cdfd ) ; _ede . CSld = _cc . NewCT_CommonSlideData ( ) ; if _dce := _fec . Decode ( _ede . CSld ) ; _dce != nil { return Slide { } , _dce ; } ; _ede . CSld . NameAttr = nil ; _ede . CSld . SpTree . Choice = _cgab ( _ede . CSld . SpTree . Choice ) ; _dggd . _aab = append ( _dggd . _aab , _ede ) ; _dcfe := _dggd . _cbdb . AddAutoRelationship ( _gb . DocTypePresentation , _gb . OfficeDocumentType , len ( _dggd . _aab ) , _gb . SlideType ) ; _gfbe . RIdAttr = _dcfe . ID ( ) ; _aafb := _gb . AbsoluteFilename ( _gb . DocTypePresentation , _gb . SlideType , len ( _dggd . _aab ) ) ; _dggd . ContentTypes . AddOverride ( _aafb , _gb . SlideContentType ) ; _agd := _ea . NewRelationships ( ) ; _dggd . _abba = append ( _dggd . _abba , _agd ) ; _daa := len ( _dggd . _abba ) - 1 ; for _baa , _dfg := range _dggd . _geg { if _dfg == l . X ( ) { _eaab := _dggd . _bgf [ _baa ] ; for _ , _dffc := range _eaab . X ( ) . Relationship { if _dffc . TypeAttr != _gb . SlideMasterType { _dggd . _abba [ _daa ] . X ( ) . Relationship = append (
2023-04-15 17:27:31 +00:00
2023-05-26 09:49:04 +00:00
// Slide represents a slide of a presentation.
type Slide struct { _egf * _cc . CT_SlideIdListEntry ; _bffe * _cc . Sld ; _gag * Presentation ; _dcee * _fd . CT_ColorMapping ; } ;
2023-04-15 17:27:31 +00:00
2023-05-26 09:49:04 +00:00
// Index returns the placeholder index
func ( _fad PlaceHolder ) Index ( ) uint32 { if _fad . _gdg . NvSpPr . NvPr . Ph . IdxAttr == nil { return 0 ; } ; return * _fad . _gdg . NvSpPr . NvPr . Ph . IdxAttr ; } ;
2023-04-15 17:27:31 +00:00
2023-05-26 09:49:04 +00:00
// Image is an image within a slide.
type Image struct { _cag * _cc . CT_Picture } ;