
    ,h+                     L    d Z ddlmZ ddlmZ  G d de      Z G d de      Zy)	zLatent style-related objects.    )ElementProxy)	BabelFishc                   `   e Zd ZdZd Zd Zd Zd Zed        Z	e	j                  d        Z	ed        Zej                  d	        Zed
        Zej                  d        Zed        Zej                  d        Zed        Zej                  d        Zed        Zej                  d        Zy)LatentStyleszProvides access to the default behaviors for latent styles in this document and
    to the collection of |_LatentStyle| objects that define overrides of those defaults
    for a particular named latent style.c                     t        j                  |      }| j                  j                  |      }|t	        d|z        t        |      S )z:Enables dictionary-style access to a latent style by name.zno latent style with name '%s')r   ui2internal_elementget_by_nameKeyError_LatentStyle)selfkey
style_namelsdExceptions       T/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/docx/styles/latent.py__getitem__zLatentStyles.__getitem__   sH    **3/
}}00<;cABBL))    c                 <    d | j                   j                  D        S )Nc              3   2   K   | ]  }t        |        y wN)r   ).0lss     r   	<genexpr>z(LatentStyles.__iter__.<locals>.<genexpr>   s     JRR Js   )r	   lsdException_lstr   s    r   __iter__zLatentStyles.__iter__   s    J4==+I+IJJr   c                 @    t        | j                  j                        S r   )lenr	   r   r   s    r   __len__zLatentStyles.__len__   s    4==1122r   c                     | j                   j                         }t        j                  |      |_        t        |      S )zReturn a newly added |_LatentStyle| object to override the inherited defaults
        defined in this latent styles object for the built-in style having `name`.)r	   add_lsdExceptionr   r   namer   )r   r"   r   s      r   add_latent_stylezLatentStyles.add_latent_style   s4     }}557%11$7L))r   c                 .    | j                   j                  S )zInteger between 0 and 99 inclusive specifying the default sort order for
        latent styles in style lists and the style gallery.

        |None| if no value is assigned, which causes Word to use the default value 99.
        r	   defUIPriorityr   s    r   default_priorityzLatentStyles.default_priority!   s     }}***r   c                 &    || j                   _        y r   r%   r   values     r   r'   zLatentStyles.default_priority*   s    &+#r   c                 8    | j                   j                  d      S )zBoolean specifying whether the default behavior for latent styles is to be
        hidden.

        A hidden style does not appear in the recommended list or in the style gallery.
        defSemiHiddenr	   	bool_propr   s    r   default_to_hiddenzLatentStyles.default_to_hidden.   s     }}&&77r   c                 <    | j                   j                  d|       y )Nr,   r	   set_bool_propr)   s     r   r/   zLatentStyles.default_to_hidden7   s    ##OU;r   c                 8    | j                   j                  d      S )a_  Boolean specifying whether the default behavior for latent styles is to be
        locked.

        A locked style does not appear in the styles panel or the style gallery and
        cannot be applied to document content. This behavior is only active when
        formatting protection is turned on for the document (via the Developer menu).
        defLockedStater-   r   s    r   default_to_lockedzLatentStyles.default_to_locked;   s     }}&&'788r   c                 <    | j                   j                  d|       y )Nr4   r1   r)   s     r   r5   zLatentStyles.default_to_lockedF   s    ##$4e<r   c                 8    | j                   j                  d      S )z|Boolean specifying whether the default behavior for latent styles is to
        appear in the style gallery when not hidden.
defQFormatr-   r   s    r   default_to_quick_stylez#LatentStyles.default_to_quick_styleJ   s     }}&&|44r   c                 <    | j                   j                  d|       y )Nr8   r1   r)   s     r   r9   z#LatentStyles.default_to_quick_styleP   s    ##L%8r   c                 8    | j                   j                  d      S )zzBoolean specifying whether the default behavior for latent styles is to be
        unhidden when first applied to content.defUnhideWhenUsedr-   r   s    r   default_to_unhide_when_usedz(LatentStyles.default_to_unhide_when_usedT   s     }}&&':;;r   c                 <    | j                   j                  d|       y )Nr<   r1   r)   s     r   r=   z(LatentStyles.default_to_unhide_when_usedZ   s    ##$7?r   c                 .    | j                   j                  S )aC  Integer specifying the number of built-in styles to initialize to the
        defaults specified in this |LatentStyles| object.

        |None| if there is no setting in the XML (very uncommon). The default Word 2011
        template sets this value to 276, accounting for the built-in styles in Word
        2010.
        r	   countr   s    r   
load_countzLatentStyles.load_count^   s     }}"""r   c                 &    || j                   _        y r   r@   r)   s     r   rB   zLatentStyles.load_counti   s    #r   N)__name__
__module____qualname____doc__r   r   r   r#   propertyr'   setterr/   r5   r9   r=   rB    r   r   r   r      s2   ,*K3* + + , , 8 8 < < 9 9 = = 5 5
 ""9 #9 < <
 !''@ (@ # # $ $r   r   c                   *   e Zd ZdZd Zed        Zej                  d        Zed        Zej                  d        Zed        Z	ed        Z
e
j                  d	        Z
ed
        Zej                  d        Zed        Zej                  d        Zy)r   a   Proxy for an `w:lsdException` element, which specifies display behaviors for a
    built-in style when no definition for that style is stored yet in the `styles.xml`
    part.

    The values in this element override the defaults specified in the parent
    `w:latentStyles` element.
    c                 F    | j                   j                          d| _         y)a6  Remove this latent style definition such that the defaults defined in the
        containing |LatentStyles| object provide the effective value for each of its
        attributes.

        Attempting to access any attributes on this object after calling this method
        will raise |AttributeError|.
        N)r	   deleter   s    r   rM   z_LatentStyle.deletew   s     	r   c                 8    | j                   j                  d      S )zTri-state value specifying whether this latent style should appear in the
        recommended list.

        |None| indicates the effective value is inherited from the parent
        ``<w:latentStyles>`` element.
        
semiHiddenr	   on_off_propr   s    r   hiddenz_LatentStyle.hidden   s     }}((66r   c                 <    | j                   j                  d|       y )NrO   r	   set_on_off_propr)   s     r   rR   z_LatentStyle.hidden   s    %%lE:r   c                 8    | j                   j                  d      S )aE  Tri-state value specifying whether this latent styles is locked.

        A locked style does not appear in the styles panel or the style gallery and
        cannot be applied to document content. This behavior is only active when
        formatting protection is turned on for the document (via the Developer menu).
        lockedrP   r   s    r   rW   z_LatentStyle.locked   s     }}((22r   c                 <    | j                   j                  d|       y )NrW   rT   r)   s     r   rW   z_LatentStyle.locked   s    %%h6r   c                 T    t        j                  | j                  j                        S )z9The name of the built-in style this exception applies to.)r   internal2uir	   r"   r   s    r   r"   z_LatentStyle.name   s     $$T]]%7%788r   c                 .    | j                   j                  S )z:The integer sort key for this latent style in the Word UI.r	   
uiPriorityr   s    r   priorityz_LatentStyle.priority   s     }}'''r   c                 &    || j                   _        y r   r\   r)   s     r   r^   z_LatentStyle.priority   s    #( r   c                 8    | j                   j                  d      S )a  Tri-state value specifying whether this latent style should appear in the
        Word styles gallery when not hidden.

        |None| indicates the effective value should be inherited from the default values
        in its parent |LatentStyles| object.
        qFormatrP   r   s    r   quick_stylez_LatentStyle.quick_style   s     }}((33r   c                 <    | j                   j                  d|       y )Nra   rT   r)   s     r   rb   z_LatentStyle.quick_style   s    %%i7r   c                 8    | j                   j                  d      S )a,  Tri-state value specifying whether this style should have its :attr:`hidden`
        attribute set |False| the next time the style is applied to content.

        |None| indicates the effective value should be inherited from the default
        specified by its parent |LatentStyles| object.
        unhideWhenUsedrP   r   s    r   unhide_when_usedz_LatentStyle.unhide_when_used   s     }}(()9::r   c                 <    | j                   j                  d|       y )Nre   rT   r)   s     r   rf   z_LatentStyle.unhide_when_used   s    %%&6>r   N)rD   rE   rF   rG   rM   rH   rR   rI   rW   r"   r^   rb   rf   rJ   r   r   r   r   n   s    	 7 7 ]]; ; 3 3 ]]7 7 9 9 ( ( __) ) 4 4 8 8 ; ; ? ?r   r   N)rG   docx.sharedr   docx.stylesr   r   r   rJ   r   r   <module>rj      s+    # $ !d$< d$NX?< X?r   