o
    7 h                     @  s   d Z ddlmZ ddlmZmZmZ ddlmZ ddl	m
Z
mZ ddlmZ erDddlmZmZ ddlmZ dd	l	mZmZ dd
lmZ G dd deZdS )zMain presentation object.    )annotations)IOTYPE_CHECKINGcast)PartElementProxy)SlideMastersSlides)lazyproperty)CT_Presentation
CT_SlideId)PresentationPart)NotesMasterSlideLayouts)Lengthc                   @  s   e Zd ZU dZded< ded< edd Zed%d
dZd&ddZed'ddZ	e	j
d(ddZ	ed)ddZedd Zed*ddZedd Zej
d+d!dZed"d# Zd$S ),PresentationzPresentationML (PML) presentation.

    Not intended to be constructed directly. Use :func:`pptx.Presentation` to open or
    create a presentation.
    r
   _elementr   partc                 C     | j jS )z|CoreProperties| instance for this presentation.

        Provides read/write access to the Dublin Core document properties for the presentation.
        )r   core_propertiesself r   Y/var/www/html/figdemos/bartoux_crm/venv/lib/python3.10/site-packages/pptx/presentation.pyr      s   zPresentation.core_propertiesreturnr   c                 C  r   )zInstance of |NotesMaster| for this presentation.

        If the presentation does not have a notes master, one is created from a default template
        and returned. The same single instance is returned on each call.
        )r   notes_masterr   r   r   r   r   $   s   zPresentation.notes_masterfilestr | IO[bytes]c                 C  s   | j | dS )zWrites this presentation to `file`.

        `file` can be either a file-path or a file-like object open for writing bytes.
        N)r   save)r   r   r   r   r   r   -   s   zPresentation.saveLength | Nonec                 C     | j j}|du r
dS |jS )zHeight of slides in this presentation, in English Metric Units (EMU).

        Returns |None| if no slide width is defined. Read/write.
        N)r   sldSzcyr   r    r   r   r   slide_height4      zPresentation.slide_heightheightr   c                 C     | j  }||_d S N)r   get_or_add_sldSzr!   )r   r%   r    r   r   r   r#   ?      

r   c                 C  s   | j d jS )aE  |SlideLayouts| collection belonging to the first |SlideMaster| of this presentation.

        A presentation can have more than one slide master and each master will have its own set
        of layouts. This property is a convenience for the common case where the presentation has
        only a single slide master.
        r   )slide_mastersslide_layoutsr   r   r   r   r+   D   s   zPresentation.slide_layoutsc                 C  s
   | j d S )z
        First |SlideMaster| object belonging to this presentation. Typically,
        presentations have only a single slide master. This property provides
        simpler access in that common case.
        r   )r*   r   r   r   r   slide_masterN   s   
zPresentation.slide_masterr   c                 C  s   t | j | S )zJ|SlideMasters| collection of slide-masters belonging to this presentation.)r   r   get_or_add_sldMasterIdLstr   r   r   r   r*   W   s   zPresentation.slide_mastersc                 C  r   )z
        Width of slides in this presentation, in English Metric Units (EMU).
        Returns |None| if no slide width is defined. Read/write.
        N)r   r    cxr"   r   r   r   slide_width\   r$   zPresentation.slide_widthwidthc                 C  r&   r'   )r   r(   r.   )r   r0   r    r   r   r   r/   g   r)   c                 C  s*   | j  }| jdd |D  t|| S )z;|Slides| object containing the slides in this presentation.c                 S  s   g | ]}t d |jqS )r   )r   rId).0sldIdr   r   r   
<listcomp>p   s    z'Presentation.slides.<locals>.<listcomp>)r   get_or_add_sldIdLstr   rename_slide_partsr   )r   sldIdLstr   r   r   slidesl   s   

zPresentation.slidesN)r   r   )r   r   )r   r   )r%   r   )r   r   )r   r   )r0   r   )__name__
__module____qualname____doc____annotations__propertyr   r   r   r#   setterr+   r,   r	   r*   r/   r8   r   r   r   r   r      s2   
 


	


r   N)r<   
__future__r   typingr   r   r   pptx.sharedr   
pptx.slider   r   	pptx.utilr	   pptx.oxml.presentationr
   r   pptx.parts.presentationr   r   r   r   r   r   r   r   r   <module>   s    