o
    	'f/                     @  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                   @  s&   e Zd ZdZedeZe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:valc                 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   str)cls
nsptagnameval r   H/home/ubuntu/flask/venv/lib/python3.10/site-packages/docx/oxml/shared.pynew   s   zCT_DecimalNumber.newN)	__name__
__module____qualname____doc__r   r   r   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   __annotations__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_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 )zhReturn a new ``CT_String`` element with tagname `nsptagname` and ``val``
        attribute set to `val`.)r   r   r   r   )r   r   r   elmr   r   r   r   1   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    