
    ,h4#                       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mZmZmZmZmZ ddlmZmZmZmZmZ er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 G d de      Z G d de      Z G d de      Z G d de      Z  G d de      Z! G d de      Z" G d de      Z# G d d e      Z$ G d! d"e      Z% G d# d$e      Z& G d% d&e      Z' G d' d(e      Z( G d) d*e      Z)y+),zDCustom element classes for shape-related elements like `<w:inline>`.    )annotations)TYPE_CHECKINGcastnsdecls)	parse_xml)ST_CoordinateST_DrawingElementIdST_PositiveCoordinateST_RelationshipId	XsdStringXsdToken)BaseOxmlElementOneAndOnlyOneOptionalAttributeRequiredAttribute	ZeroOrOne)Lengthc                      e Zd ZdZy)	CT_Anchorz8`<wp:anchor>` element, container for a "floating" shape.N__name__
__module____qualname____doc__     Q/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/docx/oxml/shape.pyr   r      s    Br   r   c                  J    e Zd ZU dZ ede      Zded<    ede      Zded<   y)CT_BlipzX``<a:blip>`` element, specifies image source and adjustments such as alpha and
    tint.zr:embedz
str | Noneembedzr:linklinkN)	r   r   r   r   r   r   r!   __annotations__r"   r   r   r   r    r    !   s9     *$E:  )#D* r   r    c                  0    e Zd ZU dZ edd      Zded<   y)CT_BlipFillPropertiesz9``<pic:blipFill>`` element, specifies picture properties.za:blip)z	a:srcRectza:tilez	a:stretch
successorsr    blipN)r   r   r   r   r   r(   r#   r   r   r   r%   r%   -   s    CAD' r   r%   c                  ,    e Zd ZU dZ ed      Zded<   y)CT_GraphicalObjectz:``<a:graphic>`` element, container for a DrawingML object.za:graphicDataCT_GraphicalObjectDatagraphicDataN)r   r   r   r   r   r,   r#   r   r   r   r*   r*   5   s    D*7+K' r   r*   c                  H    e Zd ZU dZ ed      Zded<    ede      Z	ded<   y)r+   zI``<a:graphicData>`` element, container for the XML of a DrawingML object.zpic:pic
CT_PicturepicuristrN)
r   r   r   r   r   r/   r#   r   r   r0   r   r   r   r+   r+   =   s%    S	*C* 1C1r   r+   c                      e Zd ZU dZ ed      Zded<    ed      Zded<    ed      Zd	ed
<   e	dd       Z
e		 	 	 	 	 	 	 	 	 	 	 	 dd       Ze	d        Zy)	CT_Inlinez5`<wp:inline>` element, container for an inline shape.z	wp:extentCT_PositiveSize2Dextentzwp:docPrCT_NonVisualDrawingPropsdocPrz	a:graphicr*   graphicc                b   t        t        t        | j                                     }||j                  _        ||j                  _        ||j                  _        d|z  |j                  _	        d|j                  j                  _        |j                  j                  j                  |       |S )z\Return a new ``<wp:inline>`` element populated with the values passed as
        parameters.z
Picture %dz8http://schemas.openxmlformats.org/drawingml/2006/picture)r   r3   r   _inline_xmlr5   cxcyr7   idnamer8   r,   r0   _insert_pic)clsr;   r<   shape_idr/   inlines         r   newzCT_Inline.newO   s     i3??+<!=>"(83)c""&""..s3r   c                    d}t         j                  |||||      }| j                  ||||      }|j                  j                  j	                  |       |S )zCreate `wp:inline` element containing a `pic:pic` element.

        The contents of the `pic:pic` element is taken from the argument values.
        r   )r.   rC   r8   r,   r?   )	r@   rA   rIdfilenamer;   r<   pic_idr/   rB   s	            r   new_pic_inlinezCT_Inline.new_pic_inline\   sP     nnVXsB;R3/""..s3r   c                $    dt        dddd      z  S )Na  <wp:inline %s>
  <wp:extent cx="914400" cy="914400"/>
  <wp:docPr id="666" name="unnamed"/>
  <wp:cNvGraphicFramePr>
    <a:graphicFrameLocks noChangeAspect="1"/>
  </wp:cNvGraphicFramePr>
  <a:graphic>
    <a:graphicData uri="URI not set"/>
  </a:graphic>
</wp:inline>wpar/   rr   r@   s    r   r:   zCT_Inline._inline_xmlj   s!    	 %T3s;	<	
r   N)
r;   r   r<   r   rA   intr/   r.   returnr3   )rA   rN   rE   r1   rF   r1   r;   r   r<   r   rO   r3   )r   r   r   r   r   r5   r#   r7   r8   classmethodrC   rH   r:   r   r   r   r3   r3   D   s    ? -k :F:&3'E#  #0#G  
 
 !$039?EK	  
 
r   r3   c                  4    e Zd ZdZ ede      Z ede      Zy)r6   zpUsed for ``<wp:docPr>`` element, and perhaps others.

    Specifies the id and name of a DrawingML drawing.
    r=   r>   N)	r   r   r   r   r   r
   r=   r   r>   r   r   r   r6   r6   z   s"    
 
4!4	5BVY/Dr   r6   c                      e Zd ZdZy)CT_NonVisualPicturePropertieszK``<pic:cNvPicPr>`` element, specifies picture locking and resize behaviors.Nr   r   r   r   rS   rS      s    Ur   rS   c                      e Zd ZU dZ ed      Zded<    ed      Zded<    ed      Zd	ed
<   e	d        Z
e	d        Zy)r.   z+``<pic:pic>`` element, a DrawingML picture.zpic:nvPicPrCT_PictureNonVisualnvPicPrzpic:blipFillr%   blipFillzpic:spPrCT_ShapePropertiesspPrc                   t        | j                               }||j                  j                  _        ||j                  j                  _        ||j                  j                  _        ||j                  _
        ||j                  _        |S )zReturn a new ``<pic:pic>`` element populated with the minimal contents
        required to define a viable picture element, based on the values passed as
        parameters.)r   _pic_xmlrV   cNvPrr=   r>   rW   r(   r!   rY   r;   r<   )r@   rG   rF   rE   r;   r<   r/   s          r   rC   zCT_Picture.new   se    
 '%!)"%
r   c                "    dt        ddd      z  S )Naq  <pic:pic %s>
  <pic:nvPicPr>
    <pic:cNvPr id="666" name="unnamed"/>
    <pic:cNvPicPr/>
  </pic:nvPicPr>
  <pic:blipFill>
    <a:blip/>
    <a:stretch>
      <a:fillRect/>
    </a:stretch>
  </pic:blipFill>
  <pic:spPr>
    <a:xfrm>
      <a:off x="0" y="0"/>
      <a:ext cx="914400" cy="914400"/>
    </a:xfrm>
    <a:prstGeom prst="rect"/>
  </pic:spPr>
</pic:pic>r/   rK   rL   r   rM   s    r   r[   zCT_Picture._pic_xml   s    $ #5#s3%4	
r   N)r   r   r   r   r   rV   r#   rW   rY   rP   rC   r[   r   r   r   r.   r.      si    5#0$G   '4'H#   -Z8D
8
 
 
 
r   r.   c                       e Zd ZdZ ed      Zy)rU   z9``<pic:nvPicPr>`` element, non-visual picture properties.z	pic:cNvPrN)r   r   r   r   r   r\   r   r   r   rU   rU      s    C+&Er   rU   c                  4    e Zd ZdZ ede      Z ede      Zy)
CT_Point2DzaUsed for ``<a:off>`` element, and perhaps others.

    Specifies an x, y coordinate (point).
    xyN)r   r   r   r   r   r	   ra   rb   r   r   r   r`   r`      s!    
 	#}-A#}-Ar   r`   c                  J    e Zd ZU dZ ede      Zded<    ede      Zded<   y)r4   zpUsed for ``<wp:extent>`` element, and perhaps others later.

    Specifies the size of a DrawingML drawing.
    r;   r   r<   N)	r   r   r   r   r   r   r;   r#   r<   r   r   r   r4   r4      s9    
 ##B  ##B r   r4   c                      e Zd ZdZy)CT_PresetGeometry2DzW``<a:prstGeom>`` element, specifies an preset autoshape geometry, such as
    ``rect``.Nr   r   r   r   re   re      s    r   re   c                      e Zd ZdZy)CT_RelativeRectzX``<a:fillRect>`` element, specifying picture should fill containing rectangle
    shape.Nr   r   r   r   rg   rg          r   rg   c                      e Zd ZdZ edd      Zed        Zej                  d        Zed        Z	e	j                  d        Z	y	)
rX   zF``<pic:spPr>`` element, specifies size and shape of picture container.za:xfrm)z
a:custGeomz
a:prstGeomza:lnza:effectLstza:effectDagz	a:scene3dza:sp3dza:extLstr&   c                8    | j                   }|y|j                  S )z:Shape width as an instance of Emu, or None if not present.N)xfrmr;   selfrk   s     r   r;   zCT_ShapeProperties.cx        yy<wwr   c                2    | j                         }||_        y N)get_or_add_xfrmr;   rm   valuerk   s      r   r;   zCT_ShapeProperties.cx       ##%r   c                8    | j                   }|y|j                  S )z;Shape height as an instance of Emu, or None if not present.N)rk   r<   rl   s     r   r<   zCT_ShapeProperties.cy   rn   r   c                2    | j                         }||_        y rp   )rq   r<   rr   s      r   r<   zCT_ShapeProperties.cy  rt   r   N)
r   r   r   r   r   rk   propertyr;   setterr<   r   r   r   rX   rX      so    P	
D   YY    YY r   rX   c                      e Zd ZdZy)CT_StretchInfoPropertieszT``<a:stretch>`` element, specifies how picture should fill its containing
    shape.Nr   r   r   r   rz   rz     rh   r   rz   c                      e Zd ZdZ edd      Z edd      Zed        Zej                  d        Zed	        Z
e
j                  d
        Z
y)CT_Transform2DzD``<a:xfrm>`` element, specifies size and shape of picture container.za:off)a:extr&   r}   r   c                8    | j                   }|y |j                  S rp   )extr;   rm   r   s     r   r;   zCT_Transform2D.cx      hh;vvr   c                2    | j                         }||_        y rp   )get_or_add_extr;   rm   rs   r   s      r   r;   zCT_Transform2D.cx      !!#r   c                8    | j                   }|y |j                  S rp   )r   r<   r   s     r   r<   zCT_Transform2D.cy$  r   r   c                2    | j                         }||_        y rp   )r   r<   r   s      r   r<   zCT_Transform2D.cy+  r   r   N)r   r   r   r   r   offr   rw   r;   rx   r<   r   r   r   r|   r|     ss    N
G

3C
G
+C  YY    YY r   r|   N)*r   
__future__r   typingr   r   docx.oxml.nsr   docx.oxml.parserr   docx.oxml.simpletypesr	   r
   r   r   r   r   docx.oxml.xmlchemyr   r   r   r   r   docx.sharedr   r   r    r%   r*   r+   r3   r6   rS   r.   rU   r`   r4   re   rg   rX   rz   r|   r   r   r   <module>r      s   J " &   &   "C C	o 	O  2_ 23
 3
l0 0VO V.
 .
b'/ '. . / 
o 
) )X 
_ r   