
    hij                    z   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
mZmZ ddlmZmZmZmZ  G d de          Z G d	 d
e          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          ZdS )zShared oxml objects for charts.    )annotations)	parse_xml)nsdecls)ST_LayoutMode
XsdBoolean	XsdDouble	XsdStringXsdUnsignedInt)BaseOxmlElementOptionalAttributeRequiredAttribute	ZeroOrOnec                  .    e Zd ZdZ eded          ZdS )
CT_BooleanzJ
    Common complex type used for elements having a True/False value.
    valTdefaultN)__name__
__module____qualname____doc__r   r   r        n/var/www/development/aibuddy-work/election-extract/venv/lib/python3.11/site-packages/pptx/oxml/chart/shared.pyr   r      s1          
E:t
<
<
<CCCr   r   c                  d    e Zd ZdZ eded          Zed             Zej	        d             ZdS )CT_Boolean_Explicita  Always spells out the `val` attribute, e.g. `val=1`.

    At least one boolean element is improperly interpreted by one or more
    versions of PowerPoint. The `c:overlay` element is interpreted as |False|
    when no `val` attribute is present, contrary to the behavior described in
    the schema. A remedy for this is to interpret a missing `val` attribute
    as |True| (consistent with the spec), but always write the attribute
    whenever there is occasion for changing the element.
    r   Tr   c                    | j         S )N)_valselfs    r   r   zCT_Boolean_Explicit.val+   s
    yr   c                \    t          |          du rdnd}|                     d|           d S )NT10r   )boolset)r    valueval_strs      r   r   zCT_Boolean_Explicit.val/   s5    e,,###     r   N)
r   r   r   r   r   r   r   propertyr   setterr   r   r   r   r      sm          UJ===D  X 	Z! ! Z! ! !r   r   c                  *    e Zd ZdZ ede          ZdS )	CT_Doublez)
    Used for floating point values.
    r   N)r   r   r   r   r   r   r   r   r   r   r+   r+   5   s,          
E9
-
-CCCr   r+   c                  b    e Zd ZdZ edd          Zed             Zej        d             ZdS )	CT_Layoutz-
    ``<c:layout>`` custom element class
    zc:manualLayout)c:extLst
successorsc                &    | j         }|dS |j        S )z
        The float value in ./c:manualLayout/c:x when
        c:layout/c:manualLayout/c:xMode@val == "factor". 0.0 if that XPath
        expression finds no match.
        N        )manualLayouthorz_offset)r    r3   s     r   r4   zCT_Layout.horz_offsetD   s      (3''r   c                t    |dk    r|                                   dS |                                 }||_        dS )z
        Set the value of ./c:manualLayout/c:x@val to *offset* and
        ./c:manualLayout/c:xMode@val to "factor". Remove ./c:manualLayout if
        *offset* == 0.
        r2   N)_remove_manualLayoutget_or_add_manualLayoutr4   )r    offsetr3   s      r   r4   zCT_Layout.horz_offsetP   sC     S==%%'''F3355#)   r   N)	r   r   r   r   r   r3   r(   r4   r)   r   r   r   r-   r-   =   sm          9--HHHL	( 	( X	( 
* 
* 
* 
* 
*r   r-   c                  8    e Zd ZdZ edeej                  ZdS )CT_LayoutModezx
    Used for ``<c:xMode>``, ``<c:yMode>``, ``<c:wMode>``, and ``<c:hMode>``
    child elements of CT_ManualLayout.
    r   r   N)r   r   r   r   r   r   FACTORr   r   r   r   r:   r:   ^   s4         
 
E=-:N
O
O
OCCCr   r:   c                      e Zd ZdZdZ ededd                   Z ededd                   Z[ed	             Z	e	j
        d
             Z	dS )CT_ManualLayoutz3
    ``<c:manualLayout>`` custom element class
    )
zc:layoutTargetc:xModezc:yModezc:wModezc:hModec:xzc:yzc:wzc:hr.   r>      Nr/   r?      c                b    | j         | j        }}|||j        t          j        k    rdS |j        S )z
        The float value in ./c:x@val when ./c:xMode@val == "factor". 0.0 when
        ./c:x is not present or ./c:xMode@val != "factor".
        Nr2   )xxModer   r   r;   )r    rC   rD   s      r   r4   zCT_ManualLayout.horz_offset|   s5     64:59m6J)J)J3ur   c                ~    t           j        |                                 _        ||                                 _        dS )zW
        Set the value of ./c:x@val to *offset* and ./c:xMode@val to "factor".
        N)r   r;   get_or_add_xModer   get_or_add_x)r    r8   s     r   r4   zCT_ManualLayout.horz_offset   s5    
 '4&:#"(r   )r   r   r   r   _tag_seqr   rD   rC   r(   r4   r)   r   r   r   r=   r=   g   s         H IiHQRRL999E	%HQRRL111A  X ) ) ) ) )r   r=   c                  B    e Zd ZdZ ede          Z ede          Z	dS )	CT_NumFmtzn
    ``<c:numFmt>`` element specifying the formatting for number labels on a
    tick mark or data point.
    
formatCodesourceLinkedN)
r   r   r   r   r   r	   rK   r   r   rL   r   r   r   rJ   rJ      s>         
 #"<;;J$$^Z@@LLLr   rJ   c                      e Zd ZdZdZ ededd                   Z ededd                   Z[d	 Ze	d
             Z
ed             ZdS )CT_Titlez`c:title` custom element class.)c:txzc:layoutz	c:overlayc:spPrzc:txPrr.   rO      Nr/   rP      c                z    |                                  }|                                 |                                S )aq  Return `c:tx/c:rich`, newly created if not present.

        Return the `c:rich` grandchild at `c:tx/c:rich`. Both the `c:tx` and
        `c:rich` elements are created if not already present. Any
        `c:tx/c:strRef` element is removed. (Such an element would contain
        a cell reference for the axis title text in the chart's Excel
        worksheet.)
        )get_or_add_tx_remove_strRefget_or_add_rich)r    txs     r   get_or_add_tx_richzCT_Title.get_or_add_tx_rich   s9     !!
!!###r   c                D    |                      d          }|sdS |d         S )z.Return `c:tx/c:rich` or |None| if not present.zc:tx/c:richNr   )xpath)r    richss     r   tx_richzCT_Title.tx_rich   s+     

=)) 	4Qxr   c                 @    t          dt          d          z            S )z=Return "loose" `c:title` element containing default children.z9<c:title %s>  <c:layout/>  <c:overlay val="0"/></c:title>cr   r   r   r   r   	new_titlezCT_Title.new_title   s(     PSZ[^S_S__
 
 	
r   )r   r   r   r   rH   r   rW   spPrrX   r(   r\   staticmethodr`   r   r   r   rN   rN      s        ))PH	6hqrrl	3	3	3B9X(122,777D$ $ $   X 
 
 \
 
 
r   rN   c                  D    e Zd ZdZ ed          Z ed          Zd ZdS )CT_Txze
    ``<c:tx>`` element containing the text for a label on a data point or
    other chart item.
    zc:strRefzc:richc                B    t          dt          dd          z            S )Nzg<c:rich %s>  <a:bodyPr/>  <a:lstStyle/>  <a:p>    <a:pPr>      <a:defRPr/>    </a:pPr>  </a:p></c:rich>r^   ar_   r   s    r   	_new_richzCT_Tx._new_rich   s-     "#s++,

 

 
	
r   N)r   r   r   r   r   strRefrichrg   r   r   r   rd   rd      sM         
 Yz""F9XD
 
 
 
 
r   rd   c                  *    e Zd ZdZ ede          ZdS )CT_UnsignedIntz)
    ``<c:idx>`` element and others.
    r   N)r   r   r   r   r   r
   r   r   r   r   rk   rk      s,          
E>
2
2CCCr   rk   N)r   
__future__r   	pptx.oxmlr   pptx.oxml.nsr   pptx.oxml.simpletypesr   r   r   r	   r
   pptx.oxml.xmlchemyr   r   r   r   r   r   r+   r-   r:   r=   rJ   rN   rd   rk   r   r   r   <module>rq      s   % % " " " " " "                                          = = = = = = = =! ! ! ! !/ ! ! !.. . . . . . . .* * * * * * * *BP P P P PO P P P&) &) &) &) &)o &) &) &)RA A A A A A A A"
 "
 "
 "
 "
 "
 "
 "
J
 
 
 
 
O 
 
 
.3 3 3 3 3_ 3 3 3 3 3r   