;i8^dZddlmZmZddlmZGddeZGddeZdS) zTabstop-related proxy types.)WD_TAB_ALIGNMENT WD_TAB_LEADER) ElementProxyc`eZdZdZfdZdZdZdZdZe j e j fdZ dZxZS) TabStopsa6A sequence of |TabStop| objects providing access to the tab stops of a paragraph or paragraph style. Supports iteration, indexed access, del, and len(). It is accesed using the :attr:`~.ParagraphFormat.tab_stops` property of ParagraphFormat; it is not intended to be constructed directly. chtt||d||_dSN)superr__init___pPrselfelement __class__s FC:\PYTHON\MyICR_Workspace\venv\Lib\site-packages\docx/text/tabstops.pyr zTabStops.__init__s. h&&w555 c|jj} |||n$#ttf$rt dwxYwt |dkr|j|dSdS)z0Remove the tab at offset `idx` in this sequence.ztab index out of rangerN)r tabsremoveAttributeError IndexErrorlen)ridxrs r __delitem__zTabStops.__delitem__sy~ 7 KKS " " " " + 7 7 7566 6 7 t99>> I  T " " " " " >s *!A ct|jj}|td|j|}t |S)z#Enables list-style access by index.NzTabStops object is empty)r rrtab_lstTabStop)rrrtabs r __getitem__zTabStops.__getitem__s7y~ <788 8l3s||rc#`K|jj}||jD]}t|VdSdS)zXGenerate a TabStop object for each of the w:tab elements, in XML document order.N)r rrr)rrrs r__iter__zTabStops.__iter__'sOy~  | # #cll""""   # #rcJ|jj}|dSt|jS)Nr)r rrr)rrs r__len__zTabStops.__len__/s%y~ <14<   rc|j}||||}t|S)aAdd a new tab stop at `position`, a |Length| object specifying the location of the tab stop relative to the paragraph edge. A negative `position` value is valid and appears in hanging indentation. Tab alignment defaults to left, but may be specified by passing a member of the :ref:`WdTabAlignment` enumeration as `alignment`. An optional leader character can be specified by passing a member of the :ref:`WdTabLeader` enumeration as `leader`. )r get_or_add_tabsinsert_tab_in_orderr)rposition alignmentleaderrrs r add_tab_stopzTabStops.add_tab_stop5s:y((**&&xFCCs||rc8|jdS)zRemove all custom tab stops.N)r _remove_tabsrs r clear_allzTabStops.clear_allCs      r)__name__ __module__ __qualname____doc__r rrr!r#rLEFTrSPACESr*r. __classcell__rs@rrrs # # ####!!! 0@/D]Ma    !!!!!!!rrceZdZdZfdZedZejdZedZejdZedZ e jdZ xZ S) rzAn individual tab stop applying to a paragraph or style. Accessed using list semantics on its containing |TabStops| object. chtt||d||_dSr )r rr _tabr s rr zTabStop.__init__Ns. gt%%gt444 rc|jjS)z{A member of :ref:`WdTabAlignment` specifying the alignment setting for this tab stop. Read/write. r9valr-s rr(zTabStop.alignmentRy}rc||j_dSr r;rvalues rr(zTabStop.alignment[s rc|jjS)zA member of :ref:`WdTabLeader` specifying a repeating character used as a "leader", filling in the space spanned by this tab. Assigning |None| produces the same result as assigning `WD_TAB_LEADER.SPACES`. Read/write. r9r)r-s rr)zTabStop.leader_syrc||j_dSr rBr?s rr)zTabStop.leaderis  rc|jjS)zA |Length| object representing the distance of this tab stop from the inside edge of the paragraph. May be positive or negative. Read/write. )r9posr-s rr'zTabStop.positionmr=rc|j}|}|||j|j|_||dSr )r9 getparentr&r<r)r)rr@rrs rr'zTabStop.positionvsKi}},,UCGSZHH  Cr) r/r0r1r2r propertyr(setterr)r'r5r6s@rrrHs X  X  ]!!]!X__rrN)r2docx.enum.textrr docx.sharedrrrrrrMs""::::::::$$$$$$>!>!>!>!>!|>!>!>!B33333l33333r