
    hi/                    F   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 dS )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
<   dS )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        m/var/www/development/aibuddy-work/election-extract/venv/lib/python3.11/site-packages/docx/oxml/text/parfmt.pyr   r      s         @@++' D     -,( E      10   I     /._ G      r"   r   c                  6    e Zd ZU dZ ede          Zded<   dS )CT_Jcz7``<w:jc>`` element, specifying paragraph justification.w:valr   valN)r   r   r   r   r   r   r'   r    r!   r"   r#   r%   r%   .   sH         A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dNd0            Zej        dOd2            ZedNd3            Zej        dOd4            ZedNd5            Zej        dOd6            ZedPd8            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dD             Zej        dE             ZedF             Zej        dG             ZedQdI            Z e j        dRdK            Z edL             Z!e!j        dM             Z!dS )S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;   #   returnr   c                d    | j         }|dS |j        }|t          |           S |j        }|dS |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   sJ     h;4+7(###M	4r"   valuec                    | j         |d S |                                 }d x|_        |_        |d S |dk     r
| |_        d S ||_        d S )Nr   )rH   r*   r   r   rO   rQ   rH   s      r#   rP   zCT_PPr.first_line_indent   s]    8F!!##&**=FQYY &CKKK!CMMMr"   c                &    | j         }|dS |j        S )z6The value of `w:ind/@w:left` or |None| if not present.N)rH   r   rO   rH   s     r#   ind_leftzCT_PPr.ind_left   s     h;4xr"   c                R    |	| j         d S |                                 }||_        d S N)rH   r*   r   rS   s      r#   rV   zCT_PPr.ind_left   s/    =TX-F!!##r"   c                &    | j         }|dS |j        S )z7The value of `w:ind/@w:right` or |None| if not present.N)rH   r   rU   s     r#   	ind_rightzCT_PPr.ind_right   s     h;4yr"   c                R    |	| j         d S |                                 }||_        d S rX   )rH   r*   r   rS   s      r#   rZ   zCT_PPr.ind_right   s/    =TX-F!!##			r"   WD_ALIGN_PARAGRAPH | Nonec                ,    | j         | j         j        ndS )z=Value of the `<w:jc>` child element or |None| if not present.N)jcr'   rO   s    r#   jc_valzCT_PPr.jc_val   s     #g1tw{{t;r"   c                h    ||                                   d S ||                                 _        d S rX   )
_remove_jcget_or_add_jcr'   rO   rQ   s     r#   r`   zCT_PPr.jc_val   s6    =OOF#(   r"   c                &    | j         }|dS |j        S )z7The value of `keepLines/@val` or |None| if not present.N)	keepLinesr'   )rO   rf   s     r#   keepLines_valzCT_PPr.keepLines_val   s     N	4}r"   c                h    ||                                   d S ||                                 _        d S rX   )_remove_keepLinesget_or_add_keepLinesr'   rd   s     r#   rg   zCT_PPr.keepLines_val   s9    =""$$$$$.3D%%''+++r"   c                &    | j         }|dS |j        S )z6The value of `keepNext/@val` or |None| if not present.N)keepNextr'   )rO   rl   s     r#   keepNext_valzCT_PPr.keepNext_val   s     =4|r"   c                h    ||                                   d S ||                                 _        d S rX   )_remove_keepNextget_or_add_keepNextr'   rd   s     r#   rm   zCT_PPr.keepNext_val   s9    =!!#####-2D$$&&***r"   c                &    | j         }|dS |j        S )z=The value of `pageBreakBefore/@val` or |None| if not present.N)pageBreakBeforer'   )rO   rr   s     r#   pageBreakBefore_valzCT_PPr.pageBreakBefore_val   s      ."4""r"   c                h    ||                                   d S ||                                 _        d S rX   )_remove_pageBreakBeforeget_or_add_pageBreakBeforer'   rd   s     r#   rs   zCT_PPr.pageBreakBefore_val   s9    =((*****49D++--111r"   c                &    | j         }|dS |j        S )z;The value of `w:spacing/@w:after` or |None| if not present.N)spacingafterrO   rx   s     r#   spacing_afterzCT_PPr.spacing_after   s     ,?4}r"   c                N    |	| j         d S ||                                 _        d S rX   )rx   get_or_add_spacingry   rd   s     r#   r{   zCT_PPr.spacing_after   s-    =T\1F*/!!'''r"   c                &    | j         }|dS |j        S )z<The value of `w:spacing/@w:before` or |None| if not present.N)rx   beforerz   s     r#   spacing_beforezCT_PPr.spacing_before   s     ,?4~r"   c                N    |	| j         d S ||                                 _        d S rX   )rx   r}   r   rd   s     r#   r   zCT_PPr.spacing_before  s-    =T\1F+0!!(((r"   c                &    | j         }|dS |j        S )z:The value of `w:spacing/@w:line` or |None| if not present.N)rx   linerz   s     r#   spacing_linezCT_PPr.spacing_line  s     ,?4|r"   c                N    |	| j         d S ||                                 _        d S rX   )rx   r}   r   rd   s     r#   r   zCT_PPr.spacing_line  s-    =T\1F).!!&&&r"   c                T    | j         }|dS |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)rx   lineRuler   r   MULTIPLE)rO   rx   r   s      r#   spacing_lineRulezCT_PPr.spacing_lineRule  s8     ,?4# 8"++r"   c                N    |	| j         d S ||                                 _        d S rX   )rx   r}   r   rd   s     r#   r   zCT_PPr.spacing_lineRule,  s-    =T\1F-2!!***r"   
str | Nonec                &    | j         }|dS |j        S )zGString contained in `./w:pStyle/@val`, or None if child is not present.N)r?   r'   )rO   r?   s     r#   stylezCT_PPr.style2  s     >4zr"   r   c                l    ||                                   dS |                                 }||_        dS )zSet `./w:pStyle/@val` `style`, adding a new element if necessary.

        If `style` is |None|, remove `./w:pStyle` when present.
        N)r.   r+   r'   )rO   r   r?   s      r#   r   zCT_PPr.style:  s<     =!!!F''))


r"   c                &    | j         }|dS |j        S )z:The value of `widowControl/@val` or |None| if not present.N)widowControlr'   )rO   r   s     r#   widowControl_valzCT_PPr.widowControl_valF  s      (4r"   c                h    ||                                   d S ||                                 _        d S rX   )_remove_widowControlget_or_add_widowControlr'   rd   s     r#   r   zCT_PPr.widowControl_valN  s9    =%%'''''16D((**...r"   )rM   r   )rQ   r   )rM   r\   )rM   r   )r   r   )"r   r   r   r   r    _tag_seqr   r?   rl   rf   rr   r   numPrtabsrx   rH   r^   rK   sectPrpropertyrP   setterrV   rZ   r`   rg   rm   rs   r{   r   r   r   r   r   r!   r"   r#   r)   r)   6   s1        II((((........////&&&&&&&&%HL  )yx|     F     y(122,???H	-HQRRLAAAIi 3MMMO9-(122,GGGLIiHQRRL999E9X(233-888Di>>>G"HRSSM  C     
6hrssm	4	4	4B#,98BCC=$ $ $J     Yzhrssm<<<F   X" 
" 
" 
" 
"    X _   _    X     < < < X< ]) ) ])   X 4 4 4   X 3 3 3 # # X# : :  :   X 0 0 0
   X 1 1 1
   X / / /
   X" 3 3 3
    X \	 	 	 \	     X  7 7 7 7 7r"   r)   c                  r    e Zd ZdZ ede          Z ede          Z ede          Z	 ede
          ZdS )
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   ry   r   r   r   r   r   r!   r"   r#   r   r   V  sc            i99Ez?;;FX'<==D  ??HHHr"   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dS )
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   posrM   strc                    dS )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	     tr"   N)rM   r   )r   r   r   r   r   r   r'   r    r   r	   SPACESr   r   r   r   r!   r"   r#   r   r   `  s           .-! C     $5#4M=+?$ $ $F     $#& C         r"   r   c                  2    e Zd ZdZ edd          Zd ZdS )CT_TabStopszC``<w:tabs>`` element, container for a sorted sequence of tab stops.zw:tabr!   r=   c                    |                                  }|||c|_        |_        |_        | j        D ]+}|j        |j        k     r|                    |           |c S ,|                     |           |S )z<Insert a newly created `w:tab` child element in `pos` order.)_new_tabr   r'   r   tab_lstaddpreviousappend)rO   r   alignr   new_tabtabs         r#   insert_tab_in_orderzCT_TabStops.insert_tab_in_order  s~    --//36v0W['.< 	 	C{SW$$((( % 	Gr"   N)r   r   r   r   r   r   r   r!   r"   r#   r   r   z  s=        M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 F " " " " " " * * * * * * * *            . - - - - - H H H H H H H H                    +++++++******    _   "    O   ]7 ]7 ]7 ]7 ]7_ ]7 ]7 ]7@	@ @ @ @ @ @ @ @       4    /     r"   