o
    ýÞhA  ã                   @  s�   d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
mZmZ ddlmZmZmZ G dd	„ d	eƒZG d
d„ deƒZG dd„ deƒZdS )z6Objects shared by modules in the docx.oxml subpackage.é    )Úannotations)Úcast)Úqn)ÚOxmlElement)ÚST_DecimalNumberÚST_OnOffÚ	ST_String)ÚBaseOxmlElementÚOptionalAttributeÚRequiredAttributec                   @  s2   e Zd ZU dZedeƒZded< ed
dd„ƒZ	d	S )ÚCT_DecimalNumberz°Used for ``<w:numId>``, ``<w:ilvl>``, ``<w:abstractNumId>`` and several others,
    containing a text representation of a decimal number (e.g. 42) in its ``val``
    attribute.úw:valÚintÚvalÚ
nsptagnameÚstrc                 C  s   t |tdƒt|ƒid�S )zqReturn a new ``CT_DecimalNumber`` element having tagname `nsptagname` and
        ``val`` attribute set to `val`.r   )Úattrs)r   r   r   )Úclsr   r   © r   úP/var/www/html/premium_crap/venv/lib/python3.10/site-packages/docx/oxml/shared.pyÚnew   s   zCT_DecimalNumber.newN)r   r   r   r   )
Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   Ú__annotations__Úclassmethodr   r   r   r   r   r      s
   
 r   c                   @  s(   e Zd ZU dZededd�Zded< dS )ÚCT_OnOffzÒUsed for `w:b`, `w:i` elements and others.

    Contains a bool-ish string in its `val` attribute, xsd:boolean plus "on" and
    "off". Defaults to `True`, so `<w:b>` for example means "bold is turned on".
    r   T)ÚdefaultÚboolr   N)r   r   r   r   r
   r   r   r   r   r   r   r   r      s
   
 ÿr   c                   @  s2   e Zd ZU dZedeƒZded< ed	dd„ƒZ	dS )
Ú	CT_Stringz†Used for `w:pStyle` and `w:tblStyle` elements and others.

    In those cases, it containing a style name in its `val` attribute.
    r   r   r   r   c                 C  s   t tt|ƒƒ}||_|S )zVA new `CT_String`` element with tagname `nsptagname` and `val` attribute set to `val`.)r   r    r   r   )r   r   r   Úelmr   r   r   r   /   s   zCT_String.newN)r   r   r   r   )
r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    '   s
   
 r    N)r   Ú
__future__r   Útypingr   Údocx.oxml.nsr   Údocx.oxml.parserr   Údocx.oxml.simpletypesr   r   r   Údocx.oxml.xmlchemyr	   r
   r   r   r   r    r   r   r   r   Ú<module>   s    