o
    7 h(                     @  s`   d 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
 G dd deZG dd	 d	eZd
S )z<lxml custom element classes for legend-related XML elements.    )annotations)XL_LEGEND_POSITION)CT_TextBody)BaseOxmlElementOptionalAttribute	ZeroOrOnec                   @  s   e Zd ZdZdZededd dZededd dZed	ed
d dZededd dZ	[e
dd Ze
dd Zejdd Zdd ZdS )	CT_Legendz-
    ``<c:legend>`` custom element class
    )c:legendPoszc:legendEntryc:layout	c:overlayzc:spPrc:txPrzc:extLstr	      N)
successorsr
      r      r      c                 C  s   |   }|j}|S )z
        `./c:txPr/a:p/a:pPr/a:defRPr` great-great-grandchild element, added
        with its ancestors if not present.
        )get_or_add_txPrdefRPr)selftxPrr    r   ^/var/www/html/figdemos/bartoux_crm/venv/lib/python3.10/site-packages/pptx/oxml/chart/legend.pyr      s   zCT_Legend.defRPrc                 C  s   | j }|du r	dS |jS )z
        The float value in ./c:layout/c:manualLayout/c:x when
        ./c:layout/c:manualLayout/c:xMode@val == "factor". 0.0 if that
        XPath expression has no match.
        Ng        )layouthorz_offset)r   r   r   r   r   r   (   s   zCT_Legend.horz_offsetc                 C  s   |   }||_dS )z
        Set the value of ./c:layout/c:manualLayout/c:x@val to *offset* and
        ./c:layout/c:manualLayout/c:xMode@val to "factor". Remove
        ./c:layout/c:manualLayout if *offset* == 0.
        N)Zget_or_add_layoutr   )r   offsetr   r   r   r   r   4   s   
c                 C  s   t  S )N)r   new_txPr)r   r   r   r   	_new_txPr>   s   zCT_Legend._new_txPr)__name__
__module____qualname____doc___tag_seqr   Z	legendPosr   overlayr   propertyr   r   setterr   r   r   r   r   r   
   s    	
	

	r   c                   @  s    e Zd ZdZedeejdZdS )CT_LegendPoszx
    ``<c:legendPos>`` element specifying position of legend with respect to
    chart as a member of ST_LegendPos.
    val)defaultN)r   r   r   r    r   r   RIGHTr&   r   r   r   r   r%   B   s    r%   N)r    
__future__r   pptx.enum.chartr   pptx.oxml.textr   pptx.oxml.xmlchemyr   r   r   r   r%   r   r   r   r   <module>   s    8