
    hi                        d Z ddlmZ ddlmZmZ ddlmZ ddlm	Z	 ddl
mZ ddlmZ er&ddlmZmZ dd	l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dS )z-Base shape-related objects such as BaseShape.    )annotations)TYPE_CHECKINGcast)ActionSetting)ShadowFormat)ElementProxy)lazyproperty)MSO_SHAPE_TYPEPP_PLACEHOLDER)ShapeElement)CT_Placeholder)BaseSlidePart)ProvidesPart)Lengthc                      e Zd ZdZd. fdZd/dZd/dZed0d            Ze	d1d            Z
e	d2d            Ze	d2d            Ze	d2d            Ze	d3d            Zej        d4d            Ze	d2d            Ze	d3d            Zej        d4d            Ze	d5d            Zej        d6d            Ze	d7d            Ze	d8d             Ze	d9d"            Zej        d:d#            Zed;d%            Ze	d<d'            Ze	d=d)            Ze	d3d*            Zej        d4d+            Ze	d3d,            Zej        d4d-            Z xZS )>	BaseShapezbBase class for shape objects.

    Subclasses include |Shape|, |Picture|, and |GraphicFrame|.
    	shape_elmr   parentr   c                d    t                                                       || _        || _        d S N)super__init___element_parent)selfr   r   	__class__s      h/var/www/development/aibuddy-work/election-extract/venv/lib/python3.11/site-packages/pptx/shapes/base.pyr   zBaseShape.__init__   s+    !    otherobjectreturnboolc                L    t          |t                    sdS | 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   r   s     r   __eq__zBaseShape.__eq__    s*     %++ 	5}..r   c                L    t          |t                    sdS | j        |j        uS )NTr$   r&   s     r   __ne__zBaseShape.__ne__*   s(    %++ 	4}EN22r   r   c                D    | 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 )z`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.element;   s     }r   c                    dS )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_chartD   	     ur   c                    dS )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.
        Fr2   r/   s    r   	has_tablezBaseShape.has_tableO   r4   r   c                    dS )z&|True| if this shape can contain text.Fr2   r/   s    r   has_text_framezBaseShape.has_text_frameZ   s	     ur   r   c                    | j         j        S )zMRead/write. Integer distance between top and bottom extents of shape in EMUs.r   cyr/   s    r   heightzBaseShape.height`   s     }r   valuec                    || j         _        d S r   r:   r   r=   s     r   r<   zBaseShape.heighte        r   c                    | j         j        S )zkTrue 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_placeholderi   s     }''r   c                    | j         j        S )zInteger distance of the left edge of this shape from the left edge of the slide.

        Read/write. Expressed in English Metric Units (EMU)
        r   xr/   s    r   leftzBaseShape.leftq        }r   c                    || j         _        d S r   rE   r?   s     r   rG   zBaseShape.lefty       r   strc                    | j         j        S )z%Name of this shape, e.g. 'Picture 7'.)r   
shape_namer/   s    r   namezBaseShape.name}   s     }''r   c                2    || j         j        j        _        d S r   )r   r+   r,   rN   r?   s     r   rN   zBaseShape.name   s    +0#(((r   r   c                6    t          d| 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   )r   r   partr/   s    r   rQ   zBaseShape.part   s     OT\%6777r   _PlaceholderFormatc                Z    | j         j        }|t          d          t          |          S )zProvides access to placeholder-specific properties such as placeholder type.

        Raises |ValueError| on access if the shape is not a placeholder.
        Nzshape is not a placeholder)r   ph
ValueErrorrR   )r   rT   s     r   placeholder_formatzBaseShape.placeholder_format   s0     ]:9:::!"%%%r   floatc                    | j         j        S )zDegrees of clockwise rotation.

        Read/write float. 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         _        d S r   rY   r?   s     r   r[   zBaseShape.rotation   s    !r   r   c                4    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     DM.///r   intc                    | 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   rb   zBaseShape.shape_id   s     }%%r   r
   c                J    t          t          |           j         d          )zA member of MSO_SHAPE_TYPE classifying this shape by type.

        Like ``MSO_SHAPE_TYPE.CHART``. Must be implemented by subclasses.
        z! does not implement `.shape_type`)NotImplementedErrortype__name__r/   s    r   
shape_typezBaseShape.shape_type   s$     "T$ZZ%8"["["[\\\r   c                    | j         j        S )zDistance from the top edge of the slide to the top edge of this shape.

        Read/write. Expressed in English Metric Units (EMU)
        r   yr/   s    r   topzBaseShape.top   rH   r   c                    || j         _        d S r   ri   r?   s     r   rk   zBaseShape.top   rJ   r   c                    | j         j        S )z}Distance between left and right extents of this shape.

        Read/write. Expressed in English Metric Units (EMU).
        r   cxr/   s    r   widthzBaseShape.width   s     }r   c                    || j         _        d S r   rn   r?   s     r   rp   zBaseShape.width   r@   r   )r   r   r   r   )r   r    r!   r"   )r!   r   )r!   r   )r!   r"   )r!   r   )r=   r   )r!   rK   )r=   rK   )r!   r   )r!   rR   )r!   rW   )r=   rW   )r!   r   r!   r`   )r!   r
   )rf   
__module____qualname____doc__r   r'   r)   r	   r-   propertyr0   r3   r6   r8   r<   setterrC   rG   rN   rQ   rV   r[   r_   rb   rg   rk   rp   __classcell__r   s   @r   r   r      s_        
     
/ / / /3 3 3 3
 	* 	* 	* \	*    X    X    X    X
       X  ]! ! ! ]! ( ( ( X(    X 
[      [  ( ( ( X( 
[1 1 1 [1 8 8 8 X8 & & & X& ! ! ! X! _" " " _" 0 0 0 \0 & & & X& ] ] ] X]    X 	Z      Z        X  \! ! ! \! ! ! ! !r   r   c                  l     e Zd ZdZd fdZedd            Zedd            Zedd
            Z xZ	S )rR   zProvides properties specific to placeholders, such as the placeholder type.

    Accessed via the :attr:`~.BaseShape.placeholder_format` property of a placeholder shape,
    r0   r   c                X    t                                          |           || _        d S r   )r   r   _ph)r   r0   r   s     r   r   z_PlaceholderFormat.__init__   s&    !!!r   r!   c                    | j         S )z*The `p:ph` element proxied by this object.)r|   r/   s    r   r0   z_PlaceholderFormat.element   s     xr   r`   c                    | j         j        S )z$Integer placeholder 'idx' attribute.)r|   idxr/   s    r   r   z_PlaceholderFormat.idx   s     x|r   r   c                    | j         j        S )zsPlaceholder type.

        A member of the :ref:`PpPlaceholderType` enumeration, e.g. PP_PLACEHOLDER.CHART
        )r|   re   r/   s    r   re   z_PlaceholderFormat.type   s     x}r   )r0   r   )r!   r   rr   )r!   r   )
rf   rs   rt   ru   r   rv   r0   r   re   rx   ry   s   @r   rR   rR      s         
         X    X    X    r   rR   N)ru   
__future__r   typingr   r   pptx.actionr   pptx.dml.effectr   pptx.sharedr   	pptx.utilr	   pptx.enum.shapesr
   r   pptx.oxml.shapesr   pptx.oxml.shapes.sharedr   pptx.parts.slider   
pptx.typesr   r   r    r   rR   r2   r   r   <module>r      s^   3 3 " " " " " " & & & & & & & & % % % % % % ( ( ( ( ( ( $ $ $ $ $ $ " " " " " " !????????------666666......''''''      B! B! B! B! B! B! B! B!J         r   