
    ,h                         d Z ddlmZmZmZm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 ddlmZ  G d d	e      Z G d
 de      Z G d de      Z G d de      Zy)zAShapes based on the `p:pic` element, including Picture and Movie.    )absolute_importdivisionprint_functionunicode_literals
LineFormat)	MSO_SHAPEMSO_SHAPE_TYPEPP_MEDIA_TYPE)	BaseShape)ParentedElementProxy)lazypropertyc                       e Zd ZdZ fdZed        Zej                  d        Zed        Zej                  d        Zed        Z	e	j                  d        Z	ed	        Z
e
j                  d
        Z
d Zed        Zed        Z xZS )_BasePicturez1Base class for shapes based on a `p:pic` element.c                 <    t         t        |   ||       || _        y N)superr   __init___pic)selfpicparent	__class__s      U/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/pptx/shapes/picture.pyr   z_BasePicture.__init__   s    lD*37	    c                 .    | j                   j                  S )z|float| representing relative portion cropped from shape bottom.

        Read/write. 1.0 represents 100%. For example, 25% is represented by
        0.25. Negative values are valid as are values greater than 1.0.
        _element	srcRect_br   s    r   crop_bottomz_BasePicture.crop_bottom        }}&&&r   c                 &    || j                   _        y r   r   r   values     r   r!   z_BasePicture.crop_bottom       "'r   c                 .    | j                   j                  S )z|float| representing relative portion cropped from left of shape.

        Read/write. 1.0 represents 100%. A negative value extends the side
        beyond the image boundary.
        r   	srcRect_lr    s    r   	crop_leftz_BasePicture.crop_left"   r"   r   c                 &    || j                   _        y r   r(   r$   s     r   r*   z_BasePicture.crop_left+   r&   r   c                 .    | j                   j                  S )zu|float| representing relative portion cropped from right of shape.

        Read/write. 1.0 represents 100%.
        r   	srcRect_rr    s    r   
crop_rightz_BasePicture.crop_right/        }}&&&r   c                 &    || j                   _        y r   r-   r$   s     r   r/   z_BasePicture.crop_right7   r&   r   c                 .    | j                   j                  S )zp|float| representing relative portion cropped from shape top.

        Read/write. 1.0 represents 100%.
        r   	srcRect_tr    s    r   crop_topz_BasePicture.crop_top;   r0   r   c                 &    || j                   _        y r   r3   r$   s     r   r5   z_BasePicture.crop_topC   r&   r   c                 6    | j                   j                         S )z{
        Return the `a:ln` element containing the line format properties XML
        for this `p:pic`-based shape.
        )r   get_or_add_lnr    s    r   r8   z_BasePicture.get_or_add_lnG   s    
 yy&&((r   c                     t        |       S )z
        An instance of |LineFormat|, providing access to the properties of
        the outline bordering this shape, such as its color and width.
        r   r    s    r   linez_BasePicture.lineN   s     $r   c                 .    | j                   j                  S )z
        The ``<a:ln>`` element containing the line format properties such as
        line color and width. |None| if no ``<a:ln>`` element is present.
        )r   lnr    s    r   r<   z_BasePicture.lnV   s     yy||r   )__name__
__module____qualname____doc__r   propertyr!   setterr*   r/   r5   r8   r   r:   r<   __classcell__)r   s   @r   r   r      s    ; ' ' ( ( ' ' ( ( ' ' ( ( ' ' __( ()      r   r   c                   P    e Zd ZdZed        Zed        Zed        Zed        Z	y)MoviezA movie shape, one that places a video on a slide.

    Like |Picture|, a movie shape is based on the `p:pic` element. A movie is
    composed of a video and a *poster frame*, the placeholder image that
    represents the video before it is played.
    c                 .    t        | j                  |       S )zThe |_MediaFormat| object for this movie.

        The |_MediaFormat| object provides access to formatting properties
        for the movie.
        )_MediaFormatr   r    s    r   media_formatzMovie.media_formatg   s     DMM400r   c                 "    t         j                  S )zMember of :ref:`PpMediaType` describing this shape.

        The return value is unconditionally `PP_MEDIA_TYPE.MOVIE` in this
        case.
        )r   MOVIEr    s    r   
media_typezMovie.media_typep   s     """r   c                 n    | j                   | j                  j                  }}|y|j                  |      S )zReturn |Image| object containing poster frame for this movie.

        Returns |None| if this movie has no poster frame (uncommon).
        N)partr   blip_rId	get_imager   
slide_partrIds      r   poster_framezMovie.poster_framey   s4     ))T]]%;%;C
;##C((r   c                 "    t         j                  S )zReturn member of :ref:`MsoShapeType` describing this shape.

        The return value is unconditionally ``MSO_SHAPE_TYPE.MEDIA`` in this
        case.
        )r
   MEDIAr    s    r   
shape_typezMovie.shape_type   s     ###r   N)
r=   r>   r?   r@   r   rH   rA   rK   rS   rV    r   r   rE   rE   _   sW     1 1 # # ) ) $ $r   rE   c                   d    e Zd ZdZed        Zej                  d        Zed        Zed        Zy)Picturez]A picture shape, one that places an image on a slide.

    Based on the `p:pic` element.
    c                 `    | j                   j                  j                  }|y|j                  S )a=  Member of MSO_SHAPE indicating masking shape.

        A picture can be masked by any of the so-called "auto-shapes"
        available in PowerPoint, such as an ellipse or triangle. When
        a picture is masked by a shape, the shape assumes the same dimensions
        as the picture and the portion of the picture outside the shape
        boundaries does not appear. Note the default value for
        a newly-inserted picture is `MSO_AUTO_SHAPE_TYPE.RECTANGLE`, which
        performs no cropping because the extents of the rectangle exactly
        correspond to the extents of the picture.

        The available shapes correspond to the members of
        :ref:`MsoAutoShapeType`.

        The return value can also be |None|, indicating the picture either
        has no geometry (not expected) or has custom geometry, like
        a freeform shape. A picture with no geometry will have no visible
        representation on the slide, although it can be selected. This is
        because without geometry, there is no "inside-the-shape" for it to
        appear in.
        N)r   spPrprstGeomprst)r   r\   s     r   auto_shape_typezPicture.auto_shape_type   s*    . 99>>**}}r   c                     t        j                  |       | j                  j                  }|j                  }| |j                          |j                         }||_        y r   )r	   validater   r[   r\   _remove_custGeom_add_prstGeomr]   )r   memberr[   r\   s       r   r^   zPicture.auto_shape_type   sM    6"yy~~==!!#))+Hr   c                     | j                   | j                  j                  }}|t        d      |j	                  |      S )z|
        An |Image| object providing access to the properties and bytes of the
        image in this picture shape.
        zno embedded image)rM   r   rN   
ValueErrorrO   rP   s      r   imagezPicture.image   s=     ))T]]%;%;C
;011##C((r   c                 "    t         j                  S )z
        Unique integer identifying the type of this shape, unconditionally
        ``MSO_SHAPE_TYPE.PICTURE`` in this case.
        )r
   PICTUREr    s    r   rV   zPicture.shape_type   s     %%%r   N)	r=   r>   r?   r@   rA   r^   rB   rf   rV   rW   r   r   rY   rY      s]    
  6   ) ) & &r   rY   c                       e Zd ZdZy)rG   zProvides access to formatting properties for a Media object.

    Media format properties are things like start point, volume, and
    compression type.
    N)r=   r>   r?   r@   rW   r   r   rG   rG      s    r   rG   N)r@   
__future__r   r   r   r   pptx.dml.liner   pptx.enum.shapesr	   r
   r   pptx.shapes.baser   pptx.sharedr   	pptx.utilr   r   rE   rY   rG   rW   r   r   <module>rp      sY    H R R $ E E & , "N9 Nb,$L ,$^=&l =&@' r   