
    ,hF                     P    d Z ddlmZmZ ddlmZ  G d de      Z G d de      Zy)	zTabstop-related proxy types.    )WD_TAB_ALIGNMENTWD_TAB_LEADER)ElementProxyc                   t     e Zd ZdZ fdZd Zd Zd Zd Ze	j                  ej                  fdZd Z xZS )	TabStopsa6  A 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.
    c                 <    t         t        |   |d        || _        y N)superr   __init___pPrselfelement	__class__s     T/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/docx/text/tabstops.pyr   zTabStops.__init__   s    h&w5	    c                     | j                   j                  }	 |j                  ||          t        |      dk(  r| j                   j                  |       yy# t        t        f$ r t	        d      w xY w)z0Remove the tab at offset `idx` in this sequence.ztab index out of ranger   N)r   tabsremoveAttributeError
IndexErrorlen)r   idxr   s      r   __delitem__zTabStops.__delitem__   sj    yy~~	7KKS	" t9>IIT"  
+ 	7566	7s   A A2c                 |    | j                   j                  }|t        d      |j                  |   }t	        |      S )z#Enables list-style access by index.zTabStops object is empty)r   r   r   tab_lstTabStop)r   r   r   tabs       r   __getitem__zTabStops.__getitem__   s8    yy~~<788ll3s|r   c              #   z   K   | j                   j                  }||j                  D ]  }t        |        yyw)zXGenerate a TabStop object for each of the w:tab elements, in XML document
        order.N)r   r   r   r   )r   r   r   s      r   __iter__zTabStops.__iter__'   s=      yy~~|| #cl"# s   9;c                 ^    | j                   j                  }|yt        |j                        S )Nr   )r   r   r   r   )r   r   s     r   __len__zTabStops.__len__/   s&    yy~~<4<<  r   c                 r    | j                   j                         }|j                  |||      }t        |      S )a  Add 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_tabsinsert_tab_in_orderr   )r   position	alignmentleaderr   r   s         r   add_tab_stopzTabStops.add_tab_stop5   s4     yy((*&&xFCs|r   c                 8    | j                   j                          y)zRemove all custom tab stops.N)r   _remove_tabsr   s    r   	clear_allzTabStops.clear_allE   s    		 r   )__name__
__module____qualname____doc__r   r   r   r!   r#   r   LEFTr   SPACESr*   r.   __classcell__r   s   @r   r   r      s>    	##! #3"7"7@T@T !r   r   c                        e Zd ZdZ fdZed        Zej                  d        Zed        Zej                  d        Zed        Z	e	j                  d        Z	 xZ
S )	r   zAn individual tab stop applying to a paragraph or style.

    Accessed using list semantics on its containing |TabStops| object.
    c                 <    t         t        |   |d        || _        y r	   )r
   r   r   _tabr   s     r   r   zTabStop.__init__P   s    gt%gt4	r   c                 .    | j                   j                  S )z{A member of :ref:`WdTabAlignment` specifying the alignment setting for this
        tab stop.

        Read/write.
        r9   valr-   s    r   r(   zTabStop.alignmentT        yy}}r   c                 &    || j                   _        y r	   r;   r   values     r   r(   zTabStop.alignment]   s    		r   c                 .    | j                   j                  S )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.
        r9   r)   r-   s    r   r)   zTabStop.leadera   s     yyr   c                 &    || j                   _        y r	   rB   r?   s     r   r)   zTabStop.leaderk   s     		r   c                 .    | j                   j                  S )zA |Length| object representing the distance of this tab stop from the inside
        edge of the paragraph.

        May be positive or negative. Read/write.
        )r9   posr-   s    r   r'   zTabStop.positiono   r=   r   c                     | j                   }|j                         }|j                  ||j                  |j                        | _         |j                  |       y r	   )r9   	getparentr&   r<   r)   r   )r   r@   r   r   s       r   r'   zTabStop.positionx   s@    ii}},,UCGGSZZH	Cr   )r/   r0   r1   r2   r   propertyr(   setterr)   r'   r5   r6   s   @r   r   r   J   s    
         ]]! !   __ r   r   N)r2   docx.enum.textr   r   docx.sharedr   r   r    r   r   <module>rM      s)    " : $@!| @!F3l 3r   