
    hi                        d Z ddlmZ ddlmZm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 ddlmZ dd	lmZ er&dd
lmZ ddlmZ ddlmZmZ ddlmZ ddlmZ ddlm Z   G d de	          Z! G d de          Z"dS )zGraphic Frame shape and related objects.

A graphic frame is a common container for table, chart, smart art, and media
objects.
    )annotations)TYPE_CHECKINGcast)MSO_SHAPE_TYPE)	BaseShape)ParentedElementProxy)GRAPHIC_DATA_URI_CHARTGRAPHIC_DATA_URI_OLEOBJGRAPHIC_DATA_URI_TABLE)Table)lazyproperty)Chart)ShadowFormat)CT_GraphicalObjectDataCT_GraphicalObjectFrame)	ChartPart)BaseSlidePart)ProvidesPartc                       e Zd ZdZd fdZedd	            Zedd            Zedd            Zedd            Z	edd            Z
edd            Zedd            Zedd            Z xZS )GraphicFramezContainer shape for table, chart, smart art, and media objects.

    Corresponds to a `p:graphicFrame` element in the shape tree.
    graphicFramer   parentr   c                Z    t                                          ||           || _        d S N)super__init___graphicFrame)selfr   r   	__class__s      l/var/www/development/aibuddy-work/election-extract/venv/lib/python3.11/site-packages/pptx/shapes/graphfrm.pyr   zGraphicFrame.__init__%   s+    v...)    returnr   c                F    | j         st          d          | j        j        S )zThe |Chart| object containing the chart in this graphic frame.

        Raises |ValueError| if this graphic frame does not contain a chart.
        zshape does not contain a chart)	has_chart
ValueError
chart_partchartr   s    r    r'   zGraphicFrame.chart)   s(     ~ 	?=>>>$$r!   r   c                    | j         j        }|t          d          t          d| j                            |                    S )zBThe |ChartPart| object containing the chart in this graphic frame.Nz+this graphic frame does not contain a chartr   )r   	chart_rIdr%   r   partrelated_part)r   r*   s     r    r&   zGraphicFrame.chart_part3   sD     &0	JKKKK!7!7	!B!BCCCr!   boolc                ,    | j         j        t          k    S )z|True| if this graphic frame contains a chart object. |False| otherwise.

        When |True|, the chart object can be accessed using the `.chart` property.
        )r   graphicData_urir	   r(   s    r    r$   zGraphicFrame.has_chart;        !15KKKr!   c                ,    | j         j        t          k    S )z|True| if this graphic frame contains a table object, |False| otherwise.

        When |True|, the table object can be accessed using the `.table` property.
        )r   r/   r   r(   s    r    	has_tablezGraphicFrame.has_tableC   r0   r!   
_OleFormatc                v    | j         j        st          d          t          | j         j        | j                  S )a  _OleFormat object for this graphic-frame shape.

        Raises `ValueError` on a GraphicFrame instance that does not contain an OLE object.

        An shape that contains an OLE object will have `.shape_type` of either
        `EMBEDDED_OLE_OBJECT` or `LINKED_OLE_OBJECT`.
        znot an OLE-object shape)r   
has_oleobjr%   r3   graphicData_parentr(   s    r    
ole_formatzGraphicFrame.ole_formatK   s9     !, 	86777$,8$,GGGr!   r   c                     t          d          )zUnconditionally raises |NotImplementedError|.

        Access to the shadow effect for graphic-frame objects is content-specific (i.e. different
        for charts, tables, etc.) and has not yet been implemented.
        z1shadow property on GraphicFrame not yet supported)NotImplementedErrorr(   s    r    shadowzGraphicFrame.shadowX   s     ""UVVVr!   r   c                    | j         j        }|t          k    rt          j        S |t
          k    rt          j        S |t          k    r$| j         j        rt          j	        nt          j
        S dS )ah  Optional member of `MSO_SHAPE_TYPE` identifying the type of this shape.

        Possible values are `MSO_SHAPE_TYPE.CHART`, `MSO_SHAPE_TYPE.TABLE`,
        `MSO_SHAPE_TYPE.EMBEDDED_OLE_OBJECT`, `MSO_SHAPE_TYPE.LINKED_OLE_OBJECT`.

        This value is `None` when none of these four types apply, for example when the shape
        contains SmartArt.
        N)r   r/   r	   r   CHARTr   TABLEr
   is_embedded_ole_objEMBEDDED_OLE_OBJECTLINKED_OLE_OBJECT)r   r/   s     r    
shape_typezGraphicFrame.shape_typea   so     ,<444!'' 666!'' 777 %9622#5 4r!   r   c                z    | j         st          d          | j        j        j        j        }t          ||           S )zThe |Table| object contained in this graphic frame.

        Raises |ValueError| if this graphic frame does not contain a table.
        zshape does not contain a table)r2   r%   r   graphicr6   tblr   )r   rE   s     r    tablezGraphicFrame.tabley   s>     ~ 	?=>>> (48S$r!   )r   r   r   r   )r"   r   )r"   r   )r"   r-   )r"   r3   )r"   r   )r"   r   )r"   r   )__name__
__module____qualname____doc__r   propertyr'   r&   r$   r2   r8   r   r;   rB   rF   __classcell__r   s   @r    r   r      s[        
* * * * * * % % % X% D D D XD L L L XL L L L XL 
H 
H 
H X
H W W W \W    X.       X         r!   r   c                  x     e Zd ZU dZded<   d fdZedd            Zedd            Zedd            Z	 xZ
S )r3   z.Provides attributes on an embedded OLE object.r   r+   r6   r   r   r   c                Z    t                                          ||           || _        d S r   )r   r   _graphicData)r   r6   r   r   s      r    r   z_OleFormat.__init__   s+    f---'r!   r"   bytes | Nonec                `    | j         j        }|dS | j                            |          j        S )zOptional bytes of OLE object, suitable for loading or saving as a file.

        This value is `None` if the embedded object does not represent a "file".
        N)rP   blob_rIdr+   r,   blob)r   rS   s     r    rT   z_OleFormat.blob   s3     $-4y%%h//44r!   
str | Nonec                    | j         j        S )a"  str "progId" attribute of this embedded OLE object.

        The progId is a str like "Excel.Sheet.12" that identifies the "file-type" of the embedded
        object, or perhaps more precisely, the application (aka. "server" in OLE parlance) to be
        used to open this object.
        )rP   progIdr(   s    r    prog_idz_OleFormat.prog_id   s      ''r!   bool | Nonec                    | j         j        S )zDTrue when OLE object should appear as an icon (rather than preview).)rP   
showAsIconr(   s    r    show_as_iconz_OleFormat.show_as_icon   s      ++r!   )r6   r   r   r   )r"   rQ   )r"   rU   )r"   rY   )rG   rH   rI   rJ   __annotations__r   rK   rT   rX   r\   rL   rM   s   @r    r3   r3      s         88( ( ( ( ( ( 5 5 5 X5 ( ( ( X( , , , X, , , , ,r!   r3   N)#rJ   
__future__r   typingr   r   pptx.enum.shapesr   pptx.shapes.baser   pptx.sharedr   	pptx.specr	   r
   r   
pptx.tabler   	pptx.utilr   pptx.chart.chartr   pptx.dml.effectr   pptx.oxml.shapes.graphfrmr   r   pptx.parts.chartr   pptx.parts.slider   
pptx.typesr   r   r3    r!   r    <module>rm      s    # " " " " " & & & & & & & & + + + + + + & & & & & & , , , , , ,         
       " " " " " " (&&&&&&,,,,,,YYYYYYYY******......''''''c  c  c  c  c 9 c  c  c L!, !, !, !, !,% !, !, !, !, !,r!   