
    ,h                     |    d Z ddlmZmZmZmZ ddl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y)z-Base shape-related objects such as BaseShape.    )absolute_importdivisionprint_functionunicode_literals)ActionSetting)ShadowFormat)ElementProxy)lazypropertyc                       e Zd ZdZ fdZd Zd Zed        Ze	d        Z
e	d        Ze	d        Ze	d	        Ze	d
        Zej                  d        Ze	d        Ze	d        Zej                  d        Ze	d        Zej                  d        Ze	d        Ze	d        Ze	d        Zej                  d        Zed        Ze	d        Ze	d        Ze	d        Zej                  d        Ze	d        Zej                  d        Z xZS )	BaseShapezbBase class for shape objects.

    Subclasses include |Shape|, |Picture|, and |GraphicFrame|.
    c                 F    t         t        |           || _        || _        y N)superr   __init___element_parent)self	shape_elmparent	__class__s      R/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/pptx/shapes/base.pyr   zBaseShape.__init__   s    i')!    c                 T    t        |t              sy| j                  |j                  u S )z|True| if this shape object proxies the same element as *other*.

        Equality for proxy objects is defined as referring to the same XML
        element, whether or not they are the same proxy object instance.
        F
isinstancer   r   r   others     r   __eq__zBaseShape.__eq__   s$     %+}}..r   c                 T    t        |t              sy| j                  |j                  uS )NTr   r   s     r   __ne__zBaseShape.__ne__"   s"    %+}}ENN22r   c                 Z    | j                   j                  j                  }t        ||       S )a  |ActionSetting| instance providing access to click behaviors.

        Click behaviors are hyperlink-like behaviors including jumping to
        a hyperlink (web page) or to another slide in the presentation. The
        click action is that defined on the overall shape, not a run of text
        within the shape. An |ActionSetting| object is always returned, even
        when no click behavior is defined on the shape.
        )r   _nvXxPrcNvPrr   )r   r#   s     r   click_actionzBaseShape.click_action'   s&     %%++UD))r   c                     | j                   S )a  `lxml` element for this shape, e.g. a CT_Shape instance.

        Note that manipulating this element improperly can produce an invalid
        presentation file. Make sure you know what you're doing if you use
        this to change the underlying XML.
        )r   r   s    r   elementzBaseShape.element4   s     }}r   c                      y)z
        |True| if this shape is a graphic frame containing a chart object.
        |False| otherwise. When |True|, the chart object can be accessed
        using the ``.chart`` property.
        F r&   s    r   	has_chartzBaseShape.has_chart>        r   c                      y)z
        |True| if this shape is a graphic frame containing a table object.
        |False| otherwise. When |True|, the table object can be accessed
        using the ``.table`` property.
        Fr)   r&   s    r   	has_tablezBaseShape.has_tableI   r+   r   c                      y)z8
        |True| if this shape can contain text.
        Fr)   r&   s    r   has_text_framezBaseShape.has_text_frameT   s     r   c                 .    | j                   j                  S )zf
        Read/write. Integer distance between top and bottom extents of shape
        in EMUs
        r   cyr&   s    r   heightzBaseShape.height\        }}r   c                 &    || j                   _        y r   r1   r   values     r   r3   zBaseShape.heightd        r   c                 .    | j                   j                  S )zs
        True if this shape is a placeholder. A shape is a placeholder if it
        has a <p:ph> element.
        )r   
has_ph_elmr&   s    r   is_placeholderzBaseShape.is_placeholderh   s     }}'''r   c                 .    | j                   j                  S )z
        Read/write. Integer distance of the left edge of this shape from the
        left edge of the slide, in English Metric Units (EMU)
        r   xr&   s    r   leftzBaseShape.leftp        }}r   c                 &    || j                   _        y r   r=   r6   s     r   r?   zBaseShape.leftx       r   c                 .    | j                   j                  S )z6
        Name of this shape, e.g. 'Picture 7'
        )r   
shape_namer&   s    r   namezBaseShape.name|   s    
 }}'''r   c                 N    || j                   j                  j                  _        y r   )r   r"   r#   rE   r6   s     r   rE   zBaseShape.name   s    +0##(r   c                 .    | j                   j                  S )zThe package part containing this shape.

        A |BaseSlidePart| subclass in this case. Access to a slide part
        should only be required if you are extending the behavior of |pp| API
        objects.
        )r   partr&   s    r   rH   zBaseShape.part   s     ||   r   c                 n    | j                   st        d      t        | j                  j                        S )z
        A |_PlaceholderFormat| object providing access to
        placeholder-specific properties such as placeholder type. Raises
        |ValueError| on access if the shape is not a placeholder.
        zshape is not a placeholder)r;   
ValueError_PlaceholderFormatr   phr&   s    r   placeholder_formatzBaseShape.placeholder_format   s.     ""9::!$--"2"233r   c                 .    | j                   j                  S )z
        Read/write float. Degrees of clockwise rotation. Negative values can
        be assigned to indicate counter-clockwise rotation, e.g. assigning
        -45.0 will change setting to 315.0.
        r   rotr&   s    r   rotationzBaseShape.rotation   s     }}   r   c                 &    || j                   _        y r   rO   r6   s     r   rQ   zBaseShape.rotation   s    !r   c                 @    t        | j                  j                        S )z|ShadowFormat| object providing access to shadow for this shape.

        A |ShadowFormat| object is always returned, even when no shadow is
        explicitly defined on this shape (i.e. it inherits its shadow
        behavior).
        )r   r   spPrr&   s    r   shadowzBaseShape.shadow   s     DMM..//r   c                 .    | j                   j                  S )z}Read-only positive integer identifying this shape.

        The id of a shape is unique among all shapes on a slide.
        )r   shape_idr&   s    r   rW   zBaseShape.shape_id   s     }}%%%r   c                      y)z
        Unique integer identifying the type of this shape, like
        ``MSO_SHAPE_TYPE.CHART``. Must be implemented by subclasses.
        Nr)   r&   s    r   
shape_typezBaseShape.shape_type   s     r   c                 .    | j                   j                  S )z
        Read/write. Integer distance of the top edge of this shape from the
        top edge of the slide, in English Metric Units (EMU)
        r   yr&   s    r   topzBaseShape.top   r@   r   c                 &    || j                   _        y r   r[   r6   s     r   r]   zBaseShape.top   rB   r   c                 .    | j                   j                  S )zf
        Read/write. Integer distance between left and right extents of shape
        in EMUs
        r   cxr&   s    r   widthzBaseShape.width   r4   r   c                 &    || j                   _        y r   r`   r6   s     r   rb   zBaseShape.width   r8   r   )__name__
__module____qualname____doc__r   r   r    r
   r$   propertyr'   r*   r-   r/   r3   setterr;   r?   rE   rH   rM   rQ   rU   rW   rY   r]   rb   __classcell__r   s   @r   r   r      s   

/3
 
* 
*             ]]! ! ( (   
[[    ( ( 
[[1 1 ! ! 4 4 ! ! __" " 0 0 & & 
 
   	ZZ        \\! !r   r   c                   L     e Zd ZdZe fd       Zed        Zed        Z xZS )rK   z
    Accessed via the :attr:`~.BaseShape.placeholder_format` property of
    a placeholder shape, provides properties specific to placeholders, such
    as the placeholder type.
    c                      t         t        | 
  S )z<
        The `p:ph` element proxied by this object.
        )r   rK   r'   )r   r   s    r   r'   z_PlaceholderFormat.element   s    
 '66r   c                 .    | j                   j                  S )z6
        Integer placeholder 'idx' attribute.
        )r   idxr&   s    r   ro   z_PlaceholderFormat.idx   s    
 }}   r   c                 .    | j                   j                  S )z{
        Placeholder type, a member of the :ref:`PpPlaceholderType`
        enumeration, e.g. PP_PLACEHOLDER.CHART
        )r   typer&   s    r   rq   z_PlaceholderFormat.type   s     }}!!!r   )	rd   re   rf   rg   rh   r'   ro   rq   rj   rk   s   @r   rK   rK      sD     7 7 ! ! " "r   rK   N)rg   
__future__r   r   r   r   pptx.actionr   pptx.dml.effectr   pptx.sharedr	   	pptx.utilr
   objectr   rK   r)   r   r   <module>rx      s7    4 R R % ( $ "Q! Q!h" "r   