1+ from typing import Self
2+
13from pptx .enum .text import MSO_AUTO_SIZE , MSO_VERTICAL_ANCHOR
24from pptx .text .text import TextFrame as PptxTextFrame
35from pptx .util import Length as PptxLength
@@ -28,6 +30,10 @@ def auto_size(self) -> MSO_AUTO_SIZE | None:
2830 def auto_size (self , value : MSO_AUTO_SIZE | None ) -> None :
2931 self ._pptx .auto_size = value
3032
33+ def set_auto_size (self , value : MSO_AUTO_SIZE | None ) -> Self :
34+ self .auto_size = value
35+ return self
36+
3137 def clear (self ) -> None :
3238 self ._pptx .clear ()
3339
@@ -49,6 +55,10 @@ def margin_bottom(self) -> EnglishMetricUnits:
4955 def margin_bottom (self , value : Length | LiteralLength | PptxLength ) -> None :
5056 self ._pptx .margin_bottom = to_pptx_length (value )
5157
58+ def set_margin_bottom (self , value : Length | LiteralLength | PptxLength ) -> Self :
59+ self .margin_bottom = value
60+ return self
61+
5262 @property
5363 def margin_left (self ) -> EnglishMetricUnits :
5464 return to_english_metric_units (self ._pptx .margin_left )
@@ -57,6 +67,10 @@ def margin_left(self) -> EnglishMetricUnits:
5767 def margin_left (self , value : Length | LiteralLength | PptxLength ) -> None :
5868 self ._pptx .margin_left = to_pptx_length (value )
5969
70+ def set_margin_left (self , value : Length | LiteralLength | PptxLength ) -> Self :
71+ self .margin_left = value
72+ return self
73+
6074 @property
6175 def margin_right (self ) -> EnglishMetricUnits :
6276 return to_english_metric_units (self ._pptx .margin_right )
@@ -65,6 +79,10 @@ def margin_right(self) -> EnglishMetricUnits:
6579 def margin_right (self , value : Length | LiteralLength | PptxLength ) -> None :
6680 self ._pptx .margin_right = to_pptx_length (value )
6781
82+ def set_margin_right (self , value : Length | LiteralLength | PptxLength ) -> Self :
83+ self .margin_right = value
84+ return self
85+
6886 @property
6987 def margin_top (self ) -> EnglishMetricUnits :
7088 return to_english_metric_units (self ._pptx .margin_top )
@@ -73,6 +91,10 @@ def margin_top(self) -> EnglishMetricUnits:
7391 def margin_top (self , value : Length | LiteralLength | PptxLength ) -> None :
7492 self ._pptx .margin_top = to_pptx_length (value )
7593
94+ def set_margin_top (self , value : Length | LiteralLength | PptxLength ) -> Self :
95+ self .margin_top = value
96+ return self
97+
7698 @property
7799 def paragraphs (self ) -> tuple [Paragraph , ...]:
78100 return tuple (Paragraph (paragraph ) for paragraph in self ._pptx .paragraphs )
@@ -85,6 +107,10 @@ def text(self) -> str:
85107 def text (self , text : str ) -> None :
86108 self ._pptx .text = text
87109
110+ def set_text (self , text : str ) -> Self :
111+ self .text = text
112+ return self
113+
88114 @property
89115 def vertical_anchor (self ) -> MSO_VERTICAL_ANCHOR | None :
90116 return self ._pptx .vertical_anchor
@@ -93,10 +119,18 @@ def vertical_anchor(self) -> MSO_VERTICAL_ANCHOR | None:
93119 def vertical_anchor (self , value : MSO_VERTICAL_ANCHOR | None ) -> None :
94120 self ._pptx .vertical_anchor = value
95121
122+ def set_vertical_anchor (self , value : MSO_VERTICAL_ANCHOR | None ) -> Self :
123+ self .vertical_anchor = value
124+ return self
125+
96126 @property
97127 def word_wrap (self ) -> bool | None :
98128 return self ._pptx .word_wrap
99129
100130 @word_wrap .setter
101131 def word_wrap (self , value : bool | None ) -> None :
102132 self ._pptx .word_wrap = value
133+
134+ def set_word_wrap (self , value : bool | None ) -> Self :
135+ self .word_wrap = value
136+ return self
0 commit comments