Xj/ dZddlmZddlmZmZddlmZmZm Z m Z ddl m Z ddl mZmZddlmZmZmZmZmZddlmZer dd lmZdd l mZGd d eZGd deZGddeZGddeZGddeZGddeZ y)z@Custom element classes related to paragraph properties (CT_PPr).) annotations) TYPE_CHECKINGCallable)WD_ALIGN_PARAGRAPHWD_LINE_SPACINGWD_TAB_ALIGNMENT WD_TAB_LEADER)CT_DecimalNumber)ST_SignedTwipsMeasureST_TwipsMeasure)BaseOxmlElement OneOrMoreOptionalAttributeRequiredAttribute ZeroOrOne)Length) CT_SectPr) CT_StringceZdZUdZedeZded<edeZded<ede Z ded<ed e Z ded <y ) CT_Indz6```` element, specifying paragraph indentation.zw:left Length | Noneleftzw:rightrightz w:firstLine firstLinez w:hanginghangingN) __name__ __module__ __qualname____doc__rr r__annotations__rr rri/mnt/ssd/data/Dropbox/adrian/vault-secondbrain/venv/lib/python3.12/site-packages/docx/oxml/text/parfmt.pyrrse@+'D--(E= 1 I}/_G]r"rc.eZdZUdZedeZded<y)CT_Jcz7```` element, specifying paragraph justification.w:valrvalN)rrrrrrr'r r!r"r#r%r%.sA/#C r"r%c`eZdZUdZded<ded<ded<ded <d ed <d ed <d ZededdZded<ededdZededdZ ededdZ ededdZ ededdZ ededdZ ed ed!dZed"ed#dZd$ed%<ed&ed'dZed(ed)dZd*ed+<ed,ed-dZ[edHd.Zej*dId/ZedHd0Zej*dId1ZedHd2Zej*dId3ZedJd4Zej*d5Zed6Zej*d7Zed8Zej*d9Zed:Zej*d;Zed<Zej*d=Zed>Zej*d?Zed@Zej*dAZedBZej*dCZedKdDZ e j*dLdEZ edFZ!e!j*dGZ!y)MCT_PPrz?```` element, containing the properties for a paragraph.zCallable[[], CT_Ind]get_or_add_indzCallable[[], CT_String]get_or_add_pStylezCallable[[], CT_SectPr]get_or_add_sectPrzCallable[[CT_SectPr], None]_insert_sectPrzCallable[[], None]_remove_pStyle_remove_sectPr)$w:pStyle w:keepNext w:keepLinesw:pageBreakBeforez w:framePrw:widowControlw:numPrzw:suppressLineNumberszw:pBdrzw:shdw:tabszw:suppressAutoHyphensz w:kinsokuz w:wordWrapzw:overflowPunctzw:topLinePunctz w:autoSpaceDEz w:autoSpaceDNzw:bidizw:adjustRightIndz w:snapToGrid w:spacingw:indzw:contextualSpacingzw:mirrorIndentszw:suppressOverlapw:jczw:textDirectionzw:textAlignmentzw:textboxTightWrap w:outlineLvlzw:divIdz w:cnfStylezw:rPrw:sectPrz w:pPrChanger0N successorszCT_String | NonepStyler1r2r3r4r5r6 r7r8z CT_Ind | Noneindr9r:r outlineLvlr;#cv|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)rHrrr)selfrHrrs r#first_line_indentzCT_PPr.first_line_indentzsIhh ;++  7(# #MM  r"c|j|y|j}dx|_|_|y|dkr | |_y||_y)Nr)rHr*rrrNvaluerHs r#rOzCT_PPr.first_line_indentsN 88  !!#&**  =  QY &CK!CMr"c8|j}|y|jS)z6The value of `w:ind/@w:left` or |None| if not present.N)rHrrNrHs r#ind_leftzCT_PPr.ind_leftshh ;xxr"cP| |jy|j}||_yN)rHr*rrQs r#rUzCT_PPr.ind_lefts( =TXX- !!#r"c8|j}|y|jS)z7The value of `w:ind/@w:right` or |None| if not present.N)rHrrTs r# ind_rightzCT_PPr.ind_rightshh ;yyr"cP| |jy|j}||_yrW)rHr*rrQs r#rYzCT_PPr.ind_rights( =TXX- !!# r"cJ|j|jjSdS)z=Value of the `` child element or |None| if not present.N)jcr'rNs r#jc_valz CT_PPr.jc_vals #gg1tww{{;t;r"cT||jy||j_yrW) _remove_jc get_or_add_jcr'rNrRs r#r^z CT_PPr.jc_vals% = OO  #( r"c8|j}|y|jS)z7The value of `keepLines/@val` or |None| if not present.N) keepLinesr')rNrds r# keepLines_valzCT_PPr.keepLines_vals NN  }}r"cT||jy||j_yrW)_remove_keepLinesget_or_add_keepLinesr'rbs r#rezCT_PPr.keepLines_vals$ =  " " $.3D % % ' +r"c8|j}|y|jS)z6The value of `keepNext/@val` or |None| if not present.N)keepNextr')rNrjs r# keepNext_valzCT_PPr.keepNext_vals ==  ||r"cT||jy||j_yrW)_remove_keepNextget_or_add_keepNextr'rbs r#rkzCT_PPr.keepNext_vals$ =  ! ! #-2D $ $ & *r"c8|j}|y|jS)z=The value of `pageBreakBefore/@val` or |None| if not present.N)pageBreakBeforer')rNrps r#pageBreakBefore_valzCT_PPr.pageBreakBefore_vals$..  """"r"cT||jy||j_yrW)_remove_pageBreakBeforeget_or_add_pageBreakBeforer'rbs r#rqzCT_PPr.pageBreakBefore_vals$ =  ( ( *49D + + - 1r"c8|j}|y|jS)z;The value of `w:spacing/@w:after` or |None| if not present.N)spacingafterrNrvs r# spacing_afterzCT_PPr.spacing_afters,, ?}}r"cL| |jy||j_yrW)rvget_or_add_spacingrwrbs r#ryzCT_PPr.spacing_afters$ =T\\1 */!'r"c8|j}|y|jS)zzzr"cX||jy|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')rNrr?s r#rz CT_PPr.style:s- =    ! '') r"c8|j}|y|jS)z:The value of `widowControl/@val` or |None| if not present.N) widowControlr')rNrs r#widowControl_valzCT_PPr.widowControl_valFs$((  r"cT||jy||j_yrW)_remove_widowControlget_or_add_widowControlr'rbs r#rzCT_PPr.widowControl_valNs$ =  % % '16D ( ( * .r")returnr)rRr)rzWD_ALIGN_PARAGRAPH | None)r str | None)rr)"rrrrr _tag_seqrr?rjrdrprnumPrtabsrvrHr\rKsectPrpropertyrOsetterrUrYr^rerkrqryr~rrrrr!r"r#r)r)6sI((....//&&&&%HL )x| F (12,?H-HQRLAI 3 MO-(12,GL iHQRL 9E X(23- 8D  >G"HRSMC 6hrsm 4B#,8BC=$J zhrsm `` element, specifying paragraph spacing attributes such as space before and line spacing.zw:afterzw:beforezw:linez w:lineRuleN) rrrrrr rwr}r rrrr!r"r#rrVs:  i 9E z? ;F X'< =D ?Hr"rceZdZUdZedeZded<ede e jZ ded<ed e Z d ed <dd Zy ) CT_TabStopz`` 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&rr'zw:leader)defaultzWD_TAB_LEADER | Noneleaderzw:posrposcy)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__zCT_TabStop.__str__qs r"N)rstr)rrrrrrr'r rr SPACESrr rrr!r"r#rr`s` .!C $5M=+?+?$F $&Cr"rc*eZdZdZeddZdZy) CT_TabStopszC```` element, container for a sorted sequence of tab stops.zw:tabr!r=c|j}|||c|_|_|_|jD]0}|j|jks|j ||cS|j ||S)zrsF"* .H+*_"O]7_]7@ @@4/r"