o
    7 h                     @  sL   d Z ddlmZ ddlmZ ddlmZ ddlmZm	Z	 G dd de
ZdS )	z-DrawingML objects related to line formatting.    )annotations)
FillFormat)MSO_FILL)Emulazypropertyc                      s   e Zd ZdZ fddZedd Zedd Zej	dd Zed	d
 Z
edd Zej	dd Zdd Zedd Z  ZS )
LineFormatzProvides access to line properties such as color, style, and width.

    A LineFormat object is typically accessed via the ``.line`` property of
    a shape such as |Shape| or |Picture|.
    c                   s   t t|   || _d S N)superr   __init___parent)selfparent	__class__ U/var/www/html/figdemos/bartoux_crm/venv/lib/python3.10/site-packages/pptx/dml/line.pyr
      s   
zLineFormat.__init__c                 C  s    | j jtjkr| j   | j jS )a  
        The |ColorFormat| instance that provides access to the color settings
        for this line. Essentially a shortcut for ``line.fill.fore_color``.
        As a side-effect, accessing this property causes the line fill type
        to be set to ``MSO_FILL.SOLID``. If this sounds risky for your use
        case, use ``line.fill.type`` to non-destructively discover the
        existing fill type.
        )filltyper   SOLIDsolid
fore_colorr   r   r   r   color   s   

zLineFormat.colorc                 C  s   | j }|du r	dS |jS )ac  Return value indicating line style.

        Returns a member of :ref:`MsoLineDashStyle` indicating line style, or
        |None| if no explicit value has been set. When no explicit value has
        been set, the line dash style is inherited from the style hierarchy.

        Assigning |None| removes any existing explicitly-defined dash style.
        N)_lnprstDash_valr   lnr   r   r   
dash_style#   s   
zLineFormat.dash_stylec                 C  s@   |d u r| j }|d u rd S |  |  d S |  }||_d S r   )r   _remove_prstDash_remove_custDash_get_or_add_lnr   )r   r   r   r   r   r   r   2   s   
c                 C  s   |   }t|S )z|
        |FillFormat| instance for this line, providing access to fill
        properties such as foreground color.
        )r    r   from_fill_parentr   r   r   r   r   >   s   
zLineFormat.fillc                 C  s   | j }|du rtdS |jS )a'  
        The width of the line expressed as an integer number of :ref:`English
        Metric Units <EMU>`. The returned value is an instance of |Length|,
        a value class having properties such as `.inches`, `.cm`, and `.pt`
        for converting the value into convenient units.
        Nr   )r   r   wr   r   r   r   widthG   s   zLineFormat.widthc                 C  s   |d u rd}|   }||_d S )Nr   )r    r"   )r   emur   r   r   r   r#   T   s   
c                 C  s
   | j  S )zi
        Return the ``<a:ln>`` element containing the line format properties
        in the XML.
        )r   get_or_add_lnr   r   r   r   r    [   s   
zLineFormat._get_or_add_lnc                 C  s   | j jS r   )r   r   r   r   r   r   r   b   s   zLineFormat._ln)__name__
__module____qualname____doc__r
   r   r   propertyr   setterr   r#   r    r   __classcell__r   r   r   r   r   
   s$    





r   N)r)   
__future__r   pptx.dml.fillr   pptx.enum.dmlr   	pptx.utilr   r   objectr   r   r   r   r   <module>   s    