
    ~Zi%                        S r SSKJr  SSKJrJr  SSKJr  SSKJ	r
  SSKJr  SSKJr  \(       a&  SSKJr  SS	KJr  SS
KJr  SSKJr  SSKJr  SSKJrJr   " S S\5      r " S S\5      rg)zDObjects related to mouse click and hover actions on a shape or text.    )annotations)TYPE_CHECKINGcast)	PP_ACTION)RELATIONSHIP_TYPE)Subshape)lazyproperty)CT_Hyperlink)CT_NonVisualDrawingProps)CT_TextCharacterProperties)	SlidePart)	BaseShape)SlideSlidesc                     ^  \ rS rSrSr S     SU 4S jjjr\S 5       r\SS j5       r	\SS j5       r
\
R                  SS j5       r
S r\SS	 j5       r\S
 5       r\S 5       r\SS j5       rSrU =r$ )ActionSetting   zAProperties specifying how a shape or run reacts to mouse actions.c                D   > [         [        U ]  U5        Xl        X0l        g N)superr   __init___element_hoverselfxPrparenthover	__class__s       e/var/www/eduai.edurigo.com/question_generate/ques_gen_env/lib/python3.13/site-packages/pptx/action.pyr   ActionSetting.__init__   s     	mT+F3    c           	     t   U R                   nUc  [        R                  $ UR                  nUS:X  ao  UR                  S   n[        R
                  [        R                  [        R                  [        R                  [        R                  [        R                  S.U   $ [        R                  [        R                  [        R                  [        R                  [        R                  [        R                   [        R"                  [        R$                  S.R'                  U[        R                  5      $ )a  Member of :ref:`PpActionType` enumeration, such as `PP_ACTION.HYPERLINK`.

The returned member indicates the type of action that will result when the
specified shape or text is clicked or the mouse pointer is positioned over the
shape during a slide show.

If there is no click-action or the click-action value is not recognized (is not
one of the official `MsoPpAction` values) then `PP_ACTION.NONE` is returned.
hlinkshowjumpjump)
firstslide	lastslidelastslideviewed	nextslidepreviousslideendshow)Nhlinksldjump	hlinkpres	hlinkfile
customshowolemacroprogram)_hlinkr   NONEaction_verbaction_fieldsFIRST_SLIDE
LAST_SLIDELAST_SLIDE_VIEWED
NEXT_SLIDEPREVIOUS_SLIDEEND_SHOW	HYPERLINKNAMED_SLIDEPLAY	OPEN_FILENAMED_SLIDE_SHOWOLE_VERB	RUN_MACRORUN_PROGRAMget)r   hlinkr5   relative_targets       r    actionActionSetting.action'   s     =>>!''/)#11&9O'33&11#,#>#>&11!*!9!9$--   %%%11"",,#44%%(( ,,	
 #k9>>
*		+r"   c                X    [        U R                  U R                  U R                  5      $ )z
A |Hyperlink| object representing the hyperlink action defined on
this click or hover mouse event. A |Hyperlink| object is always
returned, even if no hyperlink or other click action is defined.
)	Hyperlinkr   _parentr   r   s    r    	hyperlinkActionSetting.hyperlinkO   s     dkkBBr"   c                   [         R                  [         R                  [         R                  [         R                  [         R
                  4nU R                  U;  a  gU R                  [         R                  :X  a  U R                  S   $ U R                  [         R                  :X  a  U R                  S   $ U R                  [         R                  :X  aB  U R                  S-   nU[        U R                  5      :  a  [        S5      eU R                  U   $ U R                  [         R                  :X  a/  U R                  S-
  nUS:  a  [        S5      eU R                  U   $ U R                  [         R
                  :X  aV  U R                  c   eU R                  R                  n[        SU R                  R                  U5      5      nUR                   $ g)a(  
A reference to the slide in this presentation that is the target of
the slide jump action in this shape. Slide jump actions include
`PP_ACTION.FIRST_SLIDE`, `LAST_SLIDE`, `NEXT_SLIDE`,
`PREVIOUS_SLIDE`, and `NAMED_SLIDE`. Returns |None| for all other
actions. In particular, the `LAST_SLIDE_VIEWED` action and the `PLAY`
(start other presentation) actions are not supported.

A slide object may be assigned to this property, which makes the
shape an "internal hyperlink" to the assigened slide::

    slide, target_slide = prs.slides[0], prs.slides[1]
    shape = slide.shapes[0]
    shape.target_slide = target_slide

Assigning |None| removes any slide jump action. Note that this is
accomplished by removing any action present (such as a hyperlink),
without first checking that it is a slide jump action.
Nr      zno next slidezno previous slider   )r   r7   r8   r:   r;   r>   rH   _slides_slide_indexlen
ValueErrorr3   rIdr   partrelated_partslide)r   slide_jump_actionsnext_slide_idxprev_slide_idxrW   
slide_parts         r    target_slideActionSetting.target_slideX   sy   , !!    $$!!
 ;;00;;)///<<?"[[I000<<##[[I000!..2NT\\!22 11<<//[[I444!..2N! !455<<//[[I111;;***++//Ck499+A+A#+FGJ###	 2r"   c                    U R                  5         Uc  g U R                  R                  5       nSUl        U R                  R                  UR                  [        R                  5      Ul        g )Nzppaction://hlinksldjump)	_clear_click_actionr   get_or_add_hlinkClickrH   rX   	relate_toRTSLIDErW   )r   rZ   rF   s      r    r_   r`      sO      "=3350II''

BHH=	r"   c                    U R                   nUc  gUR                  nU(       a  U R                  R                  U5        U R                  R                  U5        g)z!Remove any existing click action.Nr3   rW   rX   drop_relr   remover   rF   rW   s      r    rb   !ActionSetting._clear_click_action   sC    =iiIIs#U#r"   c                    U R                   (       a7  [        U R                  [        5      (       d   eU R                  R                  $ U R                  R
                  $ )z
Reference to the `a:hlinkClick` or `a:hlinkHover` element for this
click action. Returns |None| if the element is not present.
)r   
isinstancer   r   
hlinkHover
hlinkClickrM   s    r    r3   ActionSetting._hlink   sC     ;;dmm-EFFFF==+++}}'''r"   c                .    U R                   R                  $ )zG
Reference to the slide containing the shape having this click action.
)rX   rZ   rM   s    r    _slideActionSetting._slide   s    
 yyr"   c                L    U R                   R                  U R                  5      $ )z^
Position in the slide collection of the slide containing the shape
having this click action.
)rS   indexrs   rM   s    r    rT   ActionSetting._slide_index   s     ||!!$++..r"   c                j    U R                   R                  R                  R                  R                  $ )z:
Reference to the slide collection for this presentation.
)rX   packagepresentation_partpresentationslidesrM   s    r    rS   ActionSetting._slides   s&    
 yy  22??FFFr"   r   r   Fr   z5CT_NonVisualDrawingProps | CT_TextCharacterPropertiesr   r   r   bool)returnrK   )r   Slide | None)rZ   r   r   zCT_Hyperlink | None)r   r   )__name__
__module____qualname____firstlineno____doc__r   propertyrH   r	   rN   r_   setterrb   r3   rs   rT   rS   __static_attributes____classcell__r   s   @r    r   r      s    K 	
B
 
 	
 
 %+ %+N C C 1$ 1$f > >$ ( (   / / G Gr"   r   c                     ^  \ rS rSrSr S
     SU 4S jjjr\SS j5       r\R                  SS j5       rSS jr	\SS j5       r
S rS	rU =r$ )rK      z5Represents a hyperlink action on a shape or text run.c                D   > [         [        U ]  U5        Xl        X0l        g r   )r   rK   r   r   r   r   s       r    r   Hyperlink.__init__   s     	i'/r"   c                    U R                   nUc  gUR                  nU(       d  gU R                  R                  U5      $ )aF  Read/write. The URL of the hyperlink.

URL can be on http, https, mailto, or file scheme; others may work. Returns |None| if no
hyperlink is defined, including when another action such as `RUN_MACRO` is defined on the
object. Assigning |None| removes any action defined on the object, whether it is a hyperlink
action or not.
N)r3   rW   rX   
target_refrk   s      r    addressHyperlink.address   s=      = iiyy##C((r"   c                    U R                  5         U(       a@  U R                  R                  U[        R                  SS9nU R                  5       nX#l        g g )NT)is_external)_remove_hlinkrX   rd   re   r=   _get_or_add_hlinkrW   )r   urlrW   rF   s       r    r   r      sJ     	))%%c2<<T%JC**,EI r"   c                    U R                   (       a$  [        SU R                  5      R                  5       $ U R                  R	                  5       $ )zGet the `a:hlinkClick` or `a:hlinkHover` element for the Hyperlink object.

The actual element depends on the value of `self._hover`. Create the element if not present.
r   )r   r   r   get_or_add_hlinkHoverrc   rM   s    r    r   Hyperlink._get_or_add_hlink   s9    
 ;;2DMMBXXZZ}}2244r"   c                    U R                   (       a   [        SU R                  5      R                  $ U R                  R                  $ )zReference to the `a:hlinkClick` or `h:hlinkHover` element for this click action.

Returns |None| if the element is not present.
r   )r   r   r   ro   rp   rM   s    r    r3   Hyperlink._hlink   s3     ;;2DMMBMMM}}'''r"   c                    U R                   nUc  gUR                  nU(       a  U R                  R                  U5        U R                  R                  U5        g)z]Remove the a:hlinkClick or a:hlinkHover element.

Also drops any relationship it might have.
Nrh   rk   s      r    r   Hyperlink._remove_hlink  sE    
 =iiIIs#U#r"   r~   r   r   )r   
str | None)r   r   )r   r
   r   )r   r   r   r   r   r   r   r   r   r   r3   r   r   r   r   s   @r    rK   rK      s    ? 	
B
 
 	
 
 ) )* ^^ 5 ( ($ $r"   rK   N)r   
__future__r   typingr   r   pptx.enum.actionr   pptx.opc.constantsr   re   pptx.shapesr   	pptx.utilr	   pptx.oxml.actionr
   pptx.oxml.shapes.sharedr   pptx.oxml.textr   pptx.parts.slider   pptx.shapes.baser   
pptx.slider   r   r   rK    r"   r    <module>r      sN    J " & & 6   "-@9**(iGH iGXM$ M$r"   