
    >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 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)CT_DecimalNumber)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        V/var/www/html/bid_assistant/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                  `   e Zd ZU dZded<   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d*ed+<    ed,ed-d       Z[edHd.       Zej*                  dId/       ZedHd0       Zej*                  dId1       ZedHd2       Zej*                  dId3       ZedJd4       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d>        Zej*                  d?        Zed@        Zej*                  dA        ZedB        Zej*                  dC        ZedKdD       Z e j*                  dLdE       Z edF        Z!e!j*                  dG        Z!y)M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]get_or_add_sectPrz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:textboxTightWrapw:outlineLvlzw:divIdz
w:cnfStylezw:rPrw:sectPrzw:pPrChanger0      N
successorszCT_String | NonepStyler1      r2      r3      r4      r5      r6      r7      r8      zCT_Ind | Noneindr9      r:      r
   
outlineLvlr;   #   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)rH   r   r   r   )selfrH   r   r   s       r#   first_line_indentzCT_PPr.first_line_indentz   sI     hh;++7(##MM	r"   c                    | j                   |y | j                         }d x|_        |_        |y |dk  r	| |_        y ||_        y )Nr   )rH   r*   r   r   rN   valuerH   s      r#   rO   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)rH   r   rN   rH   s     r#   ind_leftzCT_PPr.ind_left   s     hh;xxr"   c                P    || j                   y | j                         }||_        y N)rH   r*   r   rQ   s      r#   rU   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)rH   r   rT   s     r#   	ind_rightzCT_PPr.ind_right   s     hh;yyr"   c                P    || j                   y | j                         }||_        y rW   )rH   r*   r   rQ   s      r#   rY   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'   rN   s    r#   jc_valzCT_PPr.jc_val   s      #gg1tww{{;t;r"   c                T    || j                          y || j                         _        y rW   )
_remove_jcget_or_add_jcr'   rN   rR   s     r#   r^   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'   )rN   rd   s     r#   keepLines_valzCT_PPr.keepLines_val   s      NN	}}r"   c                T    || j                          y || j                         _        y rW   )_remove_keepLinesget_or_add_keepLinesr'   rb   s     r#   re   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'   )rN   rj   s     r#   keepNext_valzCT_PPr.keepNext_val   s      ==||r"   c                T    || j                          y || j                         _        y rW   )_remove_keepNextget_or_add_keepNextr'   rb   s     r#   rk   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'   )rN   rp   s     r#   pageBreakBefore_valzCT_PPr.pageBreakBefore_val   s$     ..""""r"   c                T    || j                          y || j                         _        y rW   )_remove_pageBreakBeforeget_or_add_pageBreakBeforer'   rb   s     r#   rq   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rN   rv   s     r#   spacing_afterzCT_PPr.spacing_after   s     ,,?}}r"   c                L    || j                   y || j                         _        y rW   )rv   get_or_add_spacingrw   rb   s     r#   ry   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)rv   beforerx   s     r#   spacing_beforezCT_PPr.spacing_before   s     ,,?~~r"   c                L    || j                   y || j                         _        y rW   )rv   r{   r}   rb   s     r#   r~   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)rv   linerx   s     r#   spacing_linezCT_PPr.spacing_line  s     ,,?||r"   c                L    || j                   y || j                         _        y rW   )rv   r{   r   rb   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)rv   lineRuler   r   MULTIPLE)rN   rv   r   s      r#   spacing_lineRulezCT_PPr.spacing_lineRule  s@     ,,?## 8"+++r"   c                L    || j                   y || j                         _        y rW   )rv   r{   r   rb   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'   )rN   r?   s     r#   stylezCT_PPr.style2  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'   )rN   r   r?   s      r#   r   zCT_PPr.style:  s-     =!'')
r"   c                8    | j                   }|y|j                  S )z:The value of `widowControl/@val` or |None| if not present.N)widowControlr'   )rN   r   s     r#   widowControl_valzCT_PPr.widowControl_valF  s$     ((r"   c                T    || j                          y || j                         _        y rW   )_remove_widowControlget_or_add_widowControlr'   rb   s     r#   r   zCT_PPr.widowControl_valN  s$    =%%'16D((*.r"   )returnr   )rR   r   )r   zWD_ALIGN_PARAGRAPH | None)r   
str | None)r   r   )"r   r   r   r   r    _tag_seqr   r?   rj   rd   rp   r   numPrtabsrv   rH   r\   rK   sectPrpropertyrO   setterrU   rY   r^   re   rk   rq   ry   r~   r   r   r   r   r!   r"   r#   r)   r)   6   s   I((....//&&&&%HL  )x| F  (12,?H-HQRLAI 3MO-(12,GLiHQRL9EX(23-8D>G"HRSMC  
6hrsm	4B#,8BC=$J   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   rw   r}   r   r   r   r   r!   r"   r#   r   r   V  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!   r]   s    r#   __str__zCT_TabStop.__str__q  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)rN   r   alignr   new_tabtabs         r#   insert_tab_in_orderzCT_TabStops.insert_tab_in_order  sj    --/36v0W['.<< 	C{{SWW$(	 	Gr"   N)r   r   r   r   r   r   r   r!   r"   r#   r   r   z  s    M
G
+C	r"   r   N)!r   
__future__r   typingr   r   docx.enum.textr   r   r   r	   docx.oxml.sharedr
   docx.oxml.simpletypesr   r   docx.oxml.xmlchemyr   r   r   r   r   docx.sharedr   docx.oxml.sectionr   r   r   r%   r)   r   r   r   r!   r"   r#   <module>r      s    F " *  . H  +*_ "O ]7_ ]7@	@ @ 4/ r"   