
    ,h                     H   d Z ddlmZmZmZ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.    )absolute_importdivisionprint_functionunicode_literals)	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        X/var/www/html/Resume-Scraper/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.val1   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.   7   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#   r6   s     r   r7   zCT_Layout.horz_offsetF   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.
        r5   N)_remove_manualLayoutget_or_add_manualLayoutr7   )r#   offsetr6   s      r   r7   zCT_Layout.horz_offsetR   s0     S=%%'335#) r   N)	r   r   r   r   r   r6   r+   r7   r,   r   r   r   r0   r0   ?   sB     --HL	( 	( 
* 
*r   r0   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:hr1   rA      Nr2   rB      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".
        r5   )xxModer   r	   r>   )r#   rF   rG   s      r   r7   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#   r;   s     r   r7   zCT_ManualLayout.horz_offset   s,    
 '4&:&:#"(r   )r   r   r   r   _tag_seqr   rG   rF   r+   r7   r,   r   r   r   r@   r@   i   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   rN   r   r
   rO   r   r   r   rM   rM      s!    
 #<;J$^Z@Lr   rM   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:txPrr1   rR      Nr2   rS      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$      #3<(
 	
r   )r   r   r   r   rK   r   rZ   spPrr[   r+   r_   staticmethodrc   r   r   r   rQ   rQ      s^    )PH	6hqrl	3BX(12,7D$   
 
r   rQ   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>ra   arb   r"   s    r   	_new_richzCT_Tx._new_rich   s%     "#s+,

 
	
r   N)r   r   r   r   r   strRefrichrj   r   r   r   rg   rg      s"    
 z"FXD
r   rg   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   rn   rn      s     E>
2Cr   rn   N)r   
__future__r   r   r   r   	pptx.oxmlr   pptx.oxml.nsr   pptx.oxml.simpletypesr	   r
   r   r   r   pptx.oxml.xmlchemyr   r   r   r   r   r   r.   r0   r=   r@   rM   rQ   rg   rn   r   r   r   <module>rt      s    & R R     = =!/ !.. .* *BPO P&)o &)RA A%
 %
P
O 
.3_ 3r   