
    j+                    :   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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)ST_SignedTwipsMeasureST_TwipsMeasure)BaseOxmlElement	OneOrMoreOptionalAttributeRequiredAttribute	ZeroOrOne)Length)	CT_SectPr)	CT_Stringc                  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_Indz6``<w:ind>`` element, specifying paragraph indentation.zw:leftzw:rightzw:firstLinez	w:hangingN)__name__
__module____qualname____doc__r   r
   leftrightr   	firstLinehanging     _/lsinfo/ai/hellotax_ai/base_platform/venv/lib/python3.11/site-packages/docx/oxml/text/parfmt.pyr   r      s^        @@X'<==Di)>??E!!-AAI_==GGGr   r   c                  *    e Zd ZdZ ede          ZdS )CT_Jcz7``<w:jc>`` element, specifying paragraph justification.w:valN)r   r   r   r   r   r   valr   r   r    r"   r"   %   s'        AA

G%7
8
8CCCr   r"   c                     e Zd ZU dZ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 ed ed!d                   Z ed"ed#d                   Z[ed$             Zej        d%             Zed&             Zej        d'             Zed(             Zej        d)             ZedBd,            Zej        d-             Zed.             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dCd=            Zej        dDd?            Zed@             Z e j        dA             Z dS )ECT_PPrz?``<w:pPr>`` element, containing the properties for a paragraph.z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,      r-      r.      r/      r0      r1      r2      r3      r4      r5   #   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)indr   r   r   )selfrE   r   r   s       r    first_line_indentzCT_PPr.first_line_indenth   sJ     h;4+7(###M	4r   c                    | j         |d S |                                 }d x|_        |_        |d S |dk     r
| |_        d S ||_        d S )Nr   )rE   get_or_add_indr   r   rF   valuerE   s      r    rG   zCT_PPr.first_line_indentz   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)rE   r   rF   rE   s     r    ind_leftzCT_PPr.ind_left   s     h;4xr   c                R    |	| j         d S |                                 }||_        d S N)rE   rI   r   rJ   s      r    rN   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)rE   r   rM   s     r    	ind_rightzCT_PPr.ind_right   s     h;4yr   c                R    |	| j         d S |                                 }||_        d S rP   )rE   rI   r   rJ   s      r    rR   zCT_PPr.ind_right   s/    =TX-F!!##			r   return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$   rF   s    r    jc_valzCT_PPr.jc_val   s     #g1tw{{t;r   c                h    ||                                   d S ||                                 _        d S rP   )
_remove_jcget_or_add_jcr$   rF   rK   s     r    rY   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$   )rF   r_   s     r    keepLines_valzCT_PPr.keepLines_val   s     N	4}r   c                h    ||                                   d S ||                                 _        d S rP   )_remove_keepLinesget_or_add_keepLinesr$   r]   s     r    r`   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$   )rF   re   s     r    keepNext_valzCT_PPr.keepNext_val   s     =4|r   c                h    ||                                   d S ||                                 _        d S rP   )_remove_keepNextget_or_add_keepNextr$   r]   s     r    rf   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$   )rF   rk   s     r    pageBreakBefore_valzCT_PPr.pageBreakBefore_val   s      ."4""r   c                h    ||                                   d S ||                                 _        d S rP   )_remove_pageBreakBeforeget_or_add_pageBreakBeforer$   r]   s     r    rl   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rF   rq   s     r    spacing_afterzCT_PPr.spacing_after   s     ,?4}r   c                N    |	| j         d S ||                                 _        d S rP   )rq   get_or_add_spacingrr   r]   s     r    rt   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)rq   beforers   s     r    spacing_beforezCT_PPr.spacing_before   s     ,?4~r   c                N    |	| j         d S ||                                 _        d S rP   )rq   rv   rx   r]   s     r    ry   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)rq   liners   s     r    spacing_linezCT_PPr.spacing_line   s     ,?4|r   c                N    |	| j         d S ||                                 _        d S rP   )rq   rv   r|   r]   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)rq   lineRuler|   r   MULTIPLE)rF   rq   r   s      r    spacing_lineRulezCT_PPr.spacing_lineRule  s8     ,?4# 8"++r   c                N    |	| j         d S ||                                 _        d S rP   )rq   rv   r   r]   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)r9   r$   )rF   r9   s     r    stylezCT_PPr.style   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$   )rF   r   r9   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$   )rF   r   s     r    widowControl_valzCT_PPr.widowControl_val4  s      (4r   c                h    ||                                   d S ||                                 _        d S rP   )_remove_widowControlget_or_add_widowControlr$   r]   s     r    r   zCT_PPr.widowControl_val<  s9    =%%'''''16D((**...r   )rT   rU   )rT   r   )r   r   )!r   r   r   r   __annotations___tag_seqr   r9   re   r_   rk   r   numPrtabsrq   rE   rW   sectPrpropertyrG   setterrN   rR   rY   r`   rf   rl   rt   ry   r}   r   r   r   r   r   r    r&   r&   +   s        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
)G
6
6
6C	6hrssm	4	4	4B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   rr   rx   r
   r|   r   r   r   r   r    r   r   D  sc            i99Ez?;;FX'<==D  ??HHHr   r   c                  p    e Zd ZdZ ede          Z edeej	                  Z
 ede          Z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#   zw:leader)defaultzw:posrT   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   rX   s    r    __str__zCT_TabStop.__str__Y  s	     tr   N)rT   r   )r   r   r   r   r   r   r$   r   r	   SPACESleaderr
   posr   r   r   r    r   r   N  st          
G%5
6
6Cz=-BVWWWF

G%:
;
;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   r7   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)rF   r   alignr   new_tabtabs         r    insert_tab_in_orderzCT_TabStops.insert_tab_in_orderg  s~    --//36v0W['.< 	 	C{SW$$((( % 	Gr   N)r   r   r   r   r   r   r   r   r   r    r   r   b  s=        M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 F " " " " " " * * * * * * * *            I H H H H H H H                    +++++++******> > > > >_ > > >9 9 9 9 9O 9 9 9V7 V7 V7 V7 V7_ V7 V7 V7r@ @ @ @ @ @ @ @       (    /     r   