o
    ©ç_t  ã                   @   s<   d Z ddlmZ ddlmZmZmZmZ G dd„ deƒZdS )z6
Custom element classes related to paragraphs (CT_P).
é   )Úqn)ÚBaseOxmlElementÚOxmlElementÚ
ZeroOrMoreÚ	ZeroOrOnec                   @   st   e Zd ZdZedƒZedƒZdd„ Zdd„ Z	e
dd	„ ƒZejd
d	„ ƒZdd„ Zdd„ Ze
dd„ ƒZejdd„ ƒZdS )ÚCT_PzP
    ``<w:p>`` element, containing the properties and text for a paragraph.
    úw:pPrzw:rc                 C   s   |   d|¡ |S )Né    )Úinsert©ÚselfÚpPr© r   úHD:\Projects\ConvertPro\env\Lib\site-packages\docx\oxml\text\paragraph.pyÚ_insert_pPr   s   zCT_P._insert_pPrc                 C   s   t dƒ}|  |¡ |S )zU
        Return a new ``<w:p>`` element inserted directly prior to this one.
        zw:p)r   Zaddprevious)r   Znew_pr   r   r   Úadd_p_before   s   
zCT_P.add_p_beforec                 C   ó   | j }|du r	dS |jS )zb
        The value of the ``<w:jc>`` grandchild element or |None| if not
        present.
        N)r   Újc_valr   r   r   r   Ú	alignment   ó   zCT_P.alignmentc                 C   ó   |   ¡ }||_d S ©N)Úget_or_add_pPrr   )r   Úvaluer   r   r   r   r   )   ó   
c                 C   s0   | dd… D ]}|j tdƒkrq|  |¡ qdS )zW
        Remove all child elements, except the ``<w:pPr>`` element if present.
        Nr   )Útagr   Úremove)r   Úchildr   r   r   Úclear_content.   s
   ýzCT_P.clear_contentc                 C   s   |   ¡ }| ¡  | |¡ dS )zj
        Unconditionally replace or add *sectPr* as a grandchild in the
        correct sequence.
        N)r   Z_remove_sectPrZ_insert_sectPr)r   ZsectPrr   r   r   r   Ú
set_sectPr7   s   zCT_P.set_sectPrc                 C   r   )zw
        String contained in w:val attribute of ./w:pPr/w:pStyle grandchild,
        or |None| if not present.
        N)r   Ústyler   r   r   r   r    @   r   z
CT_P.stylec                 C   r   r   )r   r    )r   r    r   r   r   r   r    K   r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   Úrr   r   Úpropertyr   Úsetterr   r   r    r   r   r   r   r      s     


		

r   N)	r$   Únsr   Zxmlchemyr   r   r   r   r   r   r   r   r   Ú<module>   s   