
    ,h.                       d Z ddlmZ ddlmZmZ ddlmZmZm	Z	m
Z
 ddlmZmZ ddlmZmZmZmZmZ ddlmZ er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 G d de      Z G d de      Zy)z@Custom element classes related to paragraph properties (CT_PPr).    )annotations)TYPE_CHECKINGCallable)WD_ALIGN_PARAGRAPHWD_LINE_SPACINGWD_TAB_ALIGNMENTWD_TAB_LEADER)ST_SignedTwipsMeasureST_TwipsMeasure)BaseOxmlElement	OneOrMoreOptionalAttributeRequiredAttribute	ZeroOrOne)Length)	CT_SectPr)	CT_Stringc                      e Zd ZU dZ ede      Zded<    ede      Zded<    ede	      Z
ded<    ed	e	      Zded
<   y)CT_Indz6``<w:ind>`` element, specifying paragraph indentation.zw:leftLength | Noneleftzw:rightrightzw:firstLine	firstLinez	w:hanginghangingN)__name__
__module____qualname____doc__r   r
   r   __annotations__r   r   r   r        W/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/docx/oxml/text/parfmt.pyr   r      se    @+'D-  -(E=   1 I}  /_G] r!   r   c                  .    e Zd ZU dZ ede      Zded<   y)CT_Jcz7``<w:jc>`` element, specifying paragraph justification.w:valr   valN)r   r   r   r   r   r   r&   r   r    r!   r"   r$   r$   -   s    A/#C	 r!   r$   c                  2   e Zd ZU dZded<   ded<   ded<   ded	<   ded
<   dZ ededd       Zded<    ededd       Z ededd       Z	 ededd       Z
 ededd       Z ededd       Z ededd       Z ededd       Z ed ed!d       Zd"ed#<    ed$ed%d       Z ed&ed'd       Z[edBd(       Zej(                  dCd)       ZedBd*       Zej(                  dCd+       ZedBd,       Zej(                  dCd-       ZedDd.       Zej(                  d/        Zed0        Zej(                  d1        Zed2        Zej(                  d3        Zed4        Zej(                  d5        Zed6        Zej(                  d7        Zed8        Zej(                  d9        Zed:        Zej(                  d;        Zed<        Zej(                  d=        ZedEd>       Zej(                  dFd?       Zed@        Z e j(                  dA        Z y)GCT_PPrz?``<w:pPr>`` element, containing the properties for a paragraph.zCallable[[], CT_Ind]get_or_add_indzCallable[[], CT_String]get_or_add_pStylezCallable[[CT_SectPr], None]_insert_sectPrzCallable[[], None]_remove_pStyle_remove_sectPr)$w:pStyle
w:keepNextw:keepLinesw:pageBreakBeforez	w:framePrw:widowControlw:numPrzw:suppressLineNumberszw:pBdrzw:shdw:tabszw:suppressAutoHyphensz	w:kinsokuz
w:wordWrapzw:overflowPunctzw:topLinePunctzw:autoSpaceDEzw:autoSpaceDNzw:bidizw:adjustRightIndzw:snapToGrid	w:spacingw:indzw:contextualSpacingzw:mirrorIndentszw:suppressOverlapw:jczw:textDirectionzw:textAlignmentzw:textboxTightWrapzw:outlineLvlzw:divIdz
w:cnfStylezw:rPrw:sectPrzw:pPrChanger.      N
successorszCT_String | NonepStyler/      r0      r1      r2      r3      r4      r5      r6      zCT_Ind | Noneindr7      r8   #   c                v    | j                   }|y|j                  }|t        |       S |j                  }|y|S )zA |Length| value calculated from the values of `w:ind/@w:firstLine` and
        `w:ind/@w:hanging`.

        Returns |None| if the `w:ind` child is not present.
        N)rE   r   r   r   )selfrE   r   r   s       r"   first_line_indentzCT_PPr.first_line_indentu   sI     hh;++7(##MM	r!   c                    | j                   |y | j                         }d x|_        |_        |y |dk  r	| |_        y ||_        y )Nr   )rE   r)   r   r   rI   valuerE   s      r"   rJ   zCT_PPr.first_line_indent   sN    88!!#&**=QY &CK!CMr!   c                8    | j                   }|y|j                  S )z6The value of `w:ind/@w:left` or |None| if not present.N)rE   r   rI   rE   s     r"   ind_leftzCT_PPr.ind_left   s     hh;xxr!   c                P    || j                   y | j                         }||_        y N)rE   r)   r   rL   s      r"   rP   zCT_PPr.ind_left   s(    =TXX-!!#r!   c                8    | j                   }|y|j                  S )z7The value of `w:ind/@w:right` or |None| if not present.N)rE   r   rO   s     r"   	ind_rightzCT_PPr.ind_right   s     hh;yyr!   c                P    || j                   y | j                         }||_        y rR   )rE   r)   r   rL   s      r"   rT   zCT_PPr.ind_right   s(    =TXX-!!#	r!   c                J    | j                   | j                   j                  S dS )z=Value of the `<w:jc>` child element or |None| if not present.N)jcr&   rI   s    r"   jc_valzCT_PPr.jc_val   s      #gg1tww{{;t;r!   c                T    || j                          y || j                         _        y rR   )
_remove_jcget_or_add_jcr&   rI   rM   s     r"   rY   zCT_PPr.jc_val   s%    =OO#( r!   c                8    | j                   }|y|j                  S )z7The value of `keepLines/@val` or |None| if not present.N)	keepLinesr&   )rI   r_   s     r"   keepLines_valzCT_PPr.keepLines_val   s      NN	}}r!   c                T    || j                          y || j                         _        y rR   )_remove_keepLinesget_or_add_keepLinesr&   r]   s     r"   r`   zCT_PPr.keepLines_val   s$    =""$.3D%%'+r!   c                8    | j                   }|y|j                  S )z6The value of `keepNext/@val` or |None| if not present.N)keepNextr&   )rI   re   s     r"   keepNext_valzCT_PPr.keepNext_val   s      ==||r!   c                T    || j                          y || j                         _        y rR   )_remove_keepNextget_or_add_keepNextr&   r]   s     r"   rf   zCT_PPr.keepNext_val   s$    =!!#-2D$$&*r!   c                8    | j                   }|y|j                  S )z=The value of `pageBreakBefore/@val` or |None| if not present.N)pageBreakBeforer&   )rI   rk   s     r"   pageBreakBefore_valzCT_PPr.pageBreakBefore_val   s$     ..""""r!   c                T    || j                          y || j                         _        y rR   )_remove_pageBreakBeforeget_or_add_pageBreakBeforer&   r]   s     r"   rl   zCT_PPr.pageBreakBefore_val   s$    =((*49D++-1r!   c                8    | j                   }|y|j                  S )z;The value of `w:spacing/@w:after` or |None| if not present.N)spacingafterrI   rq   s     r"   spacing_afterzCT_PPr.spacing_after   s     ,,?}}r!   c                L    || j                   y || j                         _        y rR   )rq   get_or_add_spacingrr   r]   s     r"   rt   zCT_PPr.spacing_after   s$    =T\\1*/!'r!   c                8    | j                   }|y|j                  S )z<The value of `w:spacing/@w:before` or |None| if not present.N)rq   beforers   s     r"   spacing_beforezCT_PPr.spacing_before   s     ,,?~~r!   c                L    || j                   y || j                         _        y rR   )rq   rv   rx   r]   s     r"   ry   zCT_PPr.spacing_before  s$    =T\\1+0!(r!   c                8    | j                   }|y|j                  S )z:The value of `w:spacing/@w:line` or |None| if not present.N)rq   liners   s     r"   spacing_linezCT_PPr.spacing_line  s     ,,?||r!   c                L    || j                   y || j                         _        y rR   )rq   rv   r|   r]   s     r"   r}   zCT_PPr.spacing_line  s$    =T\\1).!&r!   c                x    | j                   }|y|j                  }||j                  t        j                  S |S )au  The value of `w:spacing/@w:lineRule` as a member of the :ref:`WdLineSpacing`
        enumeration.

        Only the `MULTIPLE`, `EXACTLY`, and `AT_LEAST` members are used. It is the
        responsibility of the client to calculate the use of `SINGLE`, `DOUBLE`, and
        `MULTIPLE` based on the value of `w:spacing/@w:line` if that behavior is
        desired.
        N)rq   lineRuler|   r   MULTIPLE)rI   rq   r   s      r"   spacing_lineRulezCT_PPr.spacing_lineRule  s@     ,,?## 8"+++r!   c                L    || j                   y || j                         _        y rR   )rq   rv   r   r]   s     r"   r   zCT_PPr.spacing_lineRule'  s$    =T\\1-2!*r!   c                8    | j                   }|y|j                  S )zGString contained in `./w:pStyle/@val`, or None if child is not present.N)r<   r&   )rI   r<   s     r"   stylezCT_PPr.style-  s     >zzr!   c                X    || j                          y| j                         }||_        y)zSet `./w:pStyle/@val` `style`, adding a new element if necessary.

        If `style` is |None|, remove `./w:pStyle` when present.
        N)r,   r*   r&   )rI   r   r<   s      r"   r   zCT_PPr.style5  s-     =!'')
r!   c                8    | j                   }|y|j                  S )z:The value of `widowControl/@val` or |None| if not present.N)widowControlr&   )rI   r   s     r"   widowControl_valzCT_PPr.widowControl_valA  s$     ((r!   c                T    || j                          y || j                         _        y rR   )_remove_widowControlget_or_add_widowControlr&   r]   s     r"   r   zCT_PPr.widowControl_valI  s$    =%%'16D((*.r!   )returnr   )rM   r   )r   zWD_ALIGN_PARAGRAPH | None)r   
str | None)r   r   )!r   r   r   r   r   _tag_seqr   r<   re   r_   rk   r   numPrtabsrq   rE   rW   sectPrpropertyrJ   setterrP   rT   rY   r`   rf   rl   rt   ry   r}   r   r   r   r    r!   r"   r(   r(   5   s_   I((..//&&&&%HL  )x| F  (12,?H-HQRLAI 3MO-(12,GLiHQRL9EX(23-8D>G"HRSMC  
6hrsm	4Bzhrsm<F " 
" 
"   __      < < ]]) )   4 4   3 3 # # :  :   0 0
   1 1
   / /
  " 3 3
   \\	 	     7 7r!   r(   c                  X    e Zd ZdZ ede      Z ede      Z ede      Z	 ede
      Zy)
CT_Spacingzk``<w:spacing>`` element, specifying paragraph spacing attributes such as space
    before and line spacing.zw:afterzw:beforezw:linez
w:lineRuleN)r   r   r   r   r   r   rr   rx   r
   r|   r   r   r    r!   r"   r   r   Q  s:      i9Ez?;FX'<=D ?Hr!   r   c                      e Zd ZU dZ ede      Zded<    ede	e	j                        Zded<    ed	e      Zd
ed<   ddZy)
CT_TabStopz`<w:tab>` element, representing an individual tab stop.

    Overloaded to use for a tab-character in a run, which also uses the w:tab tag but
    only needs a __str__ method.
    r%   r   r&   zw:leader)defaultzWD_TAB_LEADER | Noneleaderzw:posr   posc                     y)zText equivalent of a `w:tab` element appearing in a run.

        Allows text of run inner-content to be accessed consistently across all text
        inner-content.
        	r    rX   s    r"   __str__zCT_TabStop.__str__l  s     r!   N)r   str)r   r   r   r   r   r   r&   r   r   r	   SPACESr   r
   r   r   r    r!   r"   r   r   [  s`     .!C	  $5M=+?+?$F   $&C r!   r   c                  *    e Zd ZdZ edd      Zd Zy)CT_TabStopszC``<w:tabs>`` element, container for a sorted sequence of tab stops.zw:tabr    r:   c                    | j                         }|||c|_        |_        |_        | j                  D ]0  }|j                  |j                  k  s|j                  |       |c S  | j                  |       |S )z<Insert a newly created `w:tab` child element in `pos` order.)_new_tabr   r&   r   tab_lstaddpreviousappend)rI   r   alignr   new_tabtabs         r"   insert_tab_in_orderzCT_TabStops.insert_tab_in_orderz  sj    --/36v0W['.<< 	C{{SWW$(	 	Gr!   N)r   r   r   r   r   r   r   r    r!   r"   r   r   u  s    M
G
+C	r!   r   N) r   
__future__r   typingr   r   docx.enum.textr   r   r   r	   docx.oxml.simpletypesr
   r   docx.oxml.xmlchemyr   r   r   r   r   docx.sharedr   docx.oxml.sectionr   docx.oxml.sharedr   r   r$   r(   r   r   r   r    r!   r"   <module>r      s    F " *  I  +*_ "O Y7_ Y7x@ @ 4/ r!   