a
    ]jA                     @  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                   @  s8   e Zd ZU dZedeZded< edddddZ	d	S )
CT_DecimalNumberzUsed 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str
nsptagnamer   c                 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   L/var/www/html/assistant/venv/lib/python3.9/site-packages/docx/oxml/shared.pynew   s    zCT_DecimalNumber.newN)
__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_OnOffzUsed 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                   @  s8   e Zd ZU dZedeZded< edddddZ	dS )		CT_StringzUsed 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!   '   s   
r!   N)r   
__future__r   typingr   Zdocx.oxml.nsr   Zdocx.oxml.parserr   Zdocx.oxml.simpletypesr   r   r   Zdocx.oxml.xmlchemyr	   r
   r   r   r   r!   r   r   r   r   <module>   s   