
    lij                    <   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y)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y)
CT_BooleanzJ
    Common complex type used for elements having a True/False value.
    valTdefaultN)__name__
__module____qualname____doc__r   r   r        T/var/www/html/eduruby.in/venv/lib/python3.12/site-packages/pptx/oxml/chart/shared.pyr   r      s     E:t
<Cr   r   c                  Z    e Zd ZdZ eded      Zed        Zej                  d        Zy)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    yyr   c                J    t        |      du rdnd}| j                  d|       y )NT10r   )boolset)r    valueval_strs      r   r   zCT_Boolean_Explicit.val/   s"    e,## r   N)
r   r   r   r   r   r   r   propertyr   setterr   r   r   r   r      sA     UJ=D  	ZZ! !r   r   c                  "    e Zd ZdZ ede      Zy)	CT_Doublez)
    Used for floating point values.
    r   N)r   r   r   r   r   r   r   r   r   r   r+   r+   5   s     E9
-Cr   r+   c                  X    e Zd ZdZ edd      Zed        Zej                  d        Zy)	CT_Layoutz-
    ``<c:layout>`` custom element class
    zc:manualLayout)c:extLst
successorsc                8    | j                   }|y|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.
                )manualLayouthorz_offset)r    r3   s     r   r4   zCT_Layout.horz_offsetD   s$     (('''r   c                ^    |dk(  r| j                          y| j                         }||_        y)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   s0     S=%%'335#) r   N)	r   r   r   r   r   r3   r(   r4   r)   r   r   r   r-   r-   =   sB     --HL	( 	( 
* 
*r   r-   c                  :    e Zd ZdZ edeej                        Zy)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:   ^   s    
 E=-:N:N
OCr   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	y)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                    | j                   | j                  }}|||j                  t        j                  k7  ry|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".
        r2   )xxModer   r   r;   )r    rC   rD   s      r   r4   zCT_ManualLayout.horz_offset|   s;     664::59m6J6J)Juur   c                t    t         j                  | j                         _        || j	                         _        y)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   s,    
 '4&:&:#"(r   )r   r   r   r   _tag_seqr   rD   rC   r(   r4   r)   r   r   r   r=   r=   g   sc    H iHQRL9E%HQRL1A  ) )r   r=   c                  4    e Zd ZdZ ede      Z ede      Z	y)	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@Lr   rJ   c                  p    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y)CT_Titlez`c:title` custom element class.)c:txzc:layoutz	c:overlayc:spPrzc:txPrr.   rO      Nr/   rP      c                b    | j                         }|j                          |j                         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   s-     !
!!##r   c                4    | j                  d      }|sy|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!     

=)Qxr   c                 0    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__
 	
r   )r   r   r   r   rH   r   rW   spPrrX   r(   r\   staticmethodr`   r   r   r   rN   rN      s^    )PH	6hqrl	3BX(12,7D$   
 
r   rN   c                  6    e Zd ZdZ ed      Z ed      Zd Zy)CT_Txze
    ``<c:tx>`` element containing the text for a label on a data point or
    other chart item.
    zc:strRefzc:richc                2    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      s"    
 z"FXD
r   rd   c                  "    e Zd ZdZ ede      Zy)CT_UnsignedIntz)
    ``<c:idx>`` element and others.
    r   N)r   r   r   r   r   r
   r   r   r   r   rk   rk      s     E>
2Cr   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O P&)o &)RA A"
 "
J
O 
.3_ 3r   