
    ~Zi                        S r SSKJr  SSKJrJrJr  SSKJr	  SSK
Jr  SSKJr  SSKJrJr  SSKJr  SS	KJr  \(       a  SS
KJr  SSKJrJrJrJr   " S S\5      rg)z4Presentation part, the main part in a .pptx package.    )annotations)IOTYPE_CHECKINGIterable)RELATIONSHIP_TYPE)XmlPart)PackURI)NotesMasterPart	SlidePart)Presentation)lazyproperty)CorePropertiesPart)NotesMasterSlideSlideLayoutSlideMasterc                      \ rS rSrSrSS jr\SS j5       rSS jr\	SS j5       r
\	SS j5       r\	S 5       rSS	 jrSS
 jrSS jrSS jrS r\S 5       rSrg)PresentationPart   zaTop level class in object model.

Represents the contents of the /ppt directory of a .pptx file.
c                    U R                   nUR                  n[        R                  " X R                  U5      nU R                  U[        R                  5      nXTR                  4$ )zmReturn (rId, slide) pair of a newly created blank slide.

New slide inherits appearance from `slide_layout`.
)	_next_slide_partnamepartr   newpackage	relate_toRTSLIDEslide)selfslide_layoutpartnameslide_layout_part
slide_partrIds         q/var/www/eduai.edurigo.com/question_generate/ques_gen_env/lib/python3.13/site-packages/pptx/parts/presentation.py	add_slidePresentationPart.add_slide   sS    
 ,,(--]]8\\;LM
nnZ2$$$$    c                .    U R                   R                  $ )zA |CoreProperties| object for the presentation.

Provides read/write access to the Dublin Core properties of this presentation.
)r   core_propertiesr   s    r%   r*    PresentationPart.core_properties$   s     ||+++r(   c                    U R                   R                   H:  nUR                  U:X  d  M  U R                  UR                  5      R
                  s  $    g)zReturn optional related |Slide| object identified by `slide_id`.

Returns |None| if no slide with `slide_id` is related to this presentation.
N)_elementsldIdLstidrelated_partr$   r   )r   slide_idsldIds      r%   	get_slidePresentationPart.get_slide,   sD    
 ]]++Exx8#((3999 , r(   c                .    U R                   R                  $ )z
Return the |NotesMaster| object for this presentation. If the
presentation does not have a notes master, one is created from
a default template. The same single instance is returned on each
call.
)notes_master_partnotes_masterr+   s    r%   r8   PresentationPart.notes_master6   s     %%222r(   c                     U R                  [        R                  5      $ ! [         aE    [        R
                  " U R                  5      nU R                  U[        R                  5        Us $ f = f)zReturn the |NotesMasterPart| object for this presentation.

If the presentation does not have a notes master, one is created from a default template.
The same single instance is returned on each call.
)part_related_byr   NOTES_MASTERKeyErrorr
   create_defaultr   r   )r   r7   s     r%   r7   "PresentationPart.notes_master_part@   sY    	%''88 	% / > >t|| LNN,boo>$$	%s   ! AA0/A0c                .    [        U R                  U 5      $ )zO
A |Presentation| object providing access to the content of this
presentation.
)r   r.   r+   s    r%   presentationPresentationPart.presentationN   s     DMM400r(   c                8    U R                  U5      R                  $ )z?Return |Slide| object for related |SlidePart| related by `rId`.)r1   r   r   r$   s     r%   related_slidePresentationPart.related_slideV   s      %+++r(   c                8    U R                  U5      R                  $ )zCReturn |SlideMaster| object for |SlideMasterPart| related by `rId`.)r1   slide_masterrD   s     r%   related_slide_master%PresentationPart.related_slide_masterZ   s      %222r(   c                z    [        U5       H,  u  p#U R                  U5      n[        SUS-   -  5      Ul        M.     g)aS  Assign incrementing partnames to the slide parts identified by `rIds`.

Partnames are like `/ppt/slides/slide9.xml` and are assigned in the order their id appears
in the `rIds` sequence. The name portion is always `slide`. The number part forms a
continuous sequence starting at 1 (e.g. 1, 2, ... 10, ...). The extension is always
`.xml`.
/ppt/slides/slide%d.xml   N)	enumerater1   r	   r!   )r   rIdsidxr$   r#   s        r%   rename_slide_parts#PresentationPart.rename_slide_parts^   s;     "$HC**3/J")*CsQw*O"PJ (r(   c                :    U R                   R                  U5        g)zSave this presentation package to `path_or_stream`.

`path_or_stream` can be either a path to a filesystem location (a string) or a
file-like object.
N)r   save)r   path_or_streams     r%   rT   PresentationPart.savej   s     	.)r(   c                    U R                   R                   H/  nU R                  UR                  5      UL d  M#  UR                  s  $    [        S5      e)z1Return the slide-id associated with `slide_part`.zmatching slide_part not found)r.   r/   r1   r$   r0   
ValueError)r   r#   r3   s      r%   r2   PresentationPart.slide_idr   sD    ]]++E  +z9xx , 899r(   c                n    U R                   R                  5       nS[        U5      S-   -  n[        U5      $ )zCReturn |PackURI| instance containing next available slide partname.rL   rM   )r.   get_or_add_sldIdLstlenr	   )r   r/   partname_strs      r%   r   %PresentationPart._next_slide_partnamey   s4     ==4460CMA4EF|$$r(    N)r    r   )returnr   )r2   intr`   zSlide | None)r`   r   )r`   r
   )r$   strr`   r   )r$   rb   r`   r   )rO   zIterable[str])rU   zstr | IO[bytes])__name__
__module____qualname____firstlineno____doc__r&   propertyr*   r4   r   r8   r7   rA   rE   rI   rQ   rT   r2   r   __static_attributes__r_   r(   r%   r   r      s    
	% , , 3 3 % % 1 1,3
Q*: % %r(   r   N)rg   
__future__r   typingr   r   r   pptx.opc.constantsr   r   pptx.opc.packager   pptx.opc.packurir	   pptx.parts.slider
   r   pptx.presentationr   	pptx.utilr   pptx.parts.corepropsr   
pptx.slider   r   r   r   r   r_   r(   r%   <module>rt      s=    : " . . 6 $ $ 7 * "7GGk%w k%r(   