o
    7 ¾h¹
  ã                   @  sx   d Z ddlmZ ddlmZ er"ddlmZ ddlmZ ddl	m
Z
 G dd„ deƒZG d	d
„ d
eƒZG dd„ deƒZdS )zObjects shared by pptx modules.é    )Úannotations)ÚTYPE_CHECKING)ÚXmlPart)ÚBaseOxmlElement)ÚProvidesPartc                   @  s:   e Zd ZdZddd„Zdd
d„Zddd„Zedd„ ƒZdS )ÚElementProxya,  Base class for lxml element proxy classes.

    An element proxy class is one whose primary responsibilities are fulfilled by manipulating the
    attributes and child elements of an XML element. They are the most common type of class in
    python-pptx other than custom element (oxml) classes.
    Úelementr   c                 C  s
   || _ d S ©N©Ú_element)Úselfr   © r   úS/var/www/html/figdemos/bartoux_crm/venv/lib/python3.10/site-packages/pptx/shared.pyÚ__init__   s   
zElementProxy.__init__ÚotherÚobjectÚreturnÚboolc                 C  s   t |tƒsdS | j|ju S )aL  Return |True| if this proxy object refers to the same oxml element as does *other*.

        ElementProxy objects are value objects and should maintain no mutable local state.
        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   r   r   r   Ú__eq__   s   
zElementProxy.__eq__c                 C  s   t |tƒsdS | j|juS )NTr   r   r   r   r   Ú__ne__#   s   
zElementProxy.__ne__c                 C  ó   | j S )z(The lxml element proxied by this object.r
   ©r   r   r   r   r   (   ó   zElementProxy.elementN)r   r   )r   r   r   r   )	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   Úpropertyr   r   r   r   r   r      s    


r   c                      s<   e Zd ZdZd‡ fdd„Zedd	„ ƒZeddd„ƒZ‡  ZS )ÚParentedElementProxya	  Provides access to ancestor objects and part.

    An ancestor may occasionally be required to provide a service, such as add or drop a
    relationship. Provides the :attr:`_parent` attribute to subclasses and the public
    :attr:`parent` read-only property.
    r   r   Úparentr   c                   ó   t t| ƒ |¡ || _d S r	   )Úsuperr!   r   Ú_parent)r   r   r"   ©Ú	__class__r   r   r   6   ó   
zParentedElementProxy.__init__c                 C  r   )z“The ancestor proxy object to this one.

        For example, the parent of a shape is generally the |SlideShapes| object that contains it.
        )r%   r   r   r   r   r"   :   s   zParentedElementProxy.parentr   r   c                 C  s   | j jS ©z(The package part containing this object.)r%   Úpartr   r   r   r   r*   B   s   zParentedElementProxy.part)r   r   r"   r   ©r   r   )	r   r   r   r   r   r    r"   r*   Ú__classcell__r   r   r&   r   r!   .   s    
r!   c                      s0   e Zd ZdZd‡ fdd„Zedd	d
„ƒZ‡  ZS )ÚPartElementProxyzXProvides common members for proxy-objects that wrap a part's root element, e.g. `p:sld`.r   r   r*   r   c                   r#   r	   )r$   r-   r   Ú_part)r   r   r*   r&   r   r   r   K   r(   zPartElementProxy.__init__r   c                 C  r   r)   )r.   r   r   r   r   r*   O   r   zPartElementProxy.part)r   r   r*   r   r+   )r   r   r   r   r   r    r*   r,   r   r   r&   r   r-   H   s
    r-   N)r   Ú
__future__r   Útypingr   Úpptx.opc.packager   Úpptx.oxml.xmlchemyr   Z
pptx.typesr   r   r   r!   r-   r   r   r   r   Ú<module>   s    !