3232from .shape .placeholder import SlidePlaceholder
3333from .shape .text import Text , TextData , TextProps
3434from .slide_layout import SlideLayout
35- from .snotes_slide import NotesSlide
3635from .table .table import DataFrame , Table , TableData , TableProps , dataframe2list
3736
3837if TYPE_CHECKING :
39- pass
38+ from tppt .pptx .shape .background import Background
39+
40+ from .notes_slide import NotesSlide
4041
4142_GenericPptxBaseSlide = TypeVar ("_GenericPptxBaseSlide" , bound = _PptxBaseSlide )
4243
4344
44- class _BaseSlide (PptxConvertible [_GenericPptxBaseSlide ]): ...
45+ class _BaseSlide (PptxConvertible [_GenericPptxBaseSlide ]):
46+ @property
47+ def background (self ) -> "Background" :
48+ """Background of the slide."""
49+ from tppt .pptx .shape .background import Background
50+
51+ return Background (self ._pptx .background )
52+
53+ @property
54+ def name (self ) -> str :
55+ return self ._pptx .name
56+
57+ @name .setter
58+ def name (self , value : str ) -> None :
59+ self ._pptx .name = value
4560
4661
4762class Slide (_BaseSlide [PptxSlide ]):
4863 """Slide wrapper with type safety."""
4964
5065 @property
51- def name (self ) -> str | None :
52- """String representing the internal name of this slide.
53-
54- Returns an empty string if no name is assigned.
55- """
56- if name := self ._pptx .name :
57- return name
58- return None
66+ def follow_master_background (self ) -> bool :
67+ return self ._pptx .follow_master_background
5968
6069 @property
61- def slide_id (self ) -> int :
62- """Get the slide id."""
63- return self ._pptx .slide_id
70+ def notes_slide (self ) -> "NotesSlide | None" :
71+ """Get the notes slide."""
72+ if not self ._pptx .has_notes_slide :
73+ return None
6474
65- @property
66- def shapes (self ) -> list [BaseShape ]:
67- """Get all shapes in the slide."""
68- return [BaseShape (shape ) for shape in self ._pptx .shapes ]
75+ from .notes_slide import NotesSlide
76+
77+ return NotesSlide (self ._pptx .notes_slide )
6978
7079 @property
7180 def placeholders (self ) -> list [SlidePlaceholder ]:
@@ -77,18 +86,21 @@ def placeholders(self) -> list[SlidePlaceholder]:
7786 for placeholder in self ._pptx .placeholders
7887 ]
7988
89+ @property
90+ def shapes (self ) -> list [BaseShape ]:
91+ """Get all shapes in the slide."""
92+ return [BaseShape (shape ) for shape in self ._pptx .shapes ]
93+
94+ @property
95+ def slide_id (self ) -> int :
96+ """Get the slide id."""
97+ return self ._pptx .slide_id
98+
8099 @property
81100 def slide_layout (self ) -> SlideLayout :
82101 """Get the slide layout."""
83102 return SlideLayout .from_pptx (self ._pptx .slide_layout )
84103
85- @property
86- def notes_slide (self ) -> NotesSlide | None :
87- """Get the notes slide."""
88- if not self ._pptx .has_notes_slide :
89- return None
90- return NotesSlide .from_pptx (self ._pptx .notes_slide )
91-
92104
93105class SlideBuilder :
94106 """Slide builder."""
0 commit comments