
    h+                     L    S r SSKJr  SSKJr   " S S\5      r " S S\5      rg)	zLatent style-related objects.    )ElementProxy)	BabelFishc                   h   \ rS rSrSrS rS rS rS r\	S 5       r
\
R                  S 5       r
\	S	 5       r\R                  S
 5       r\	S 5       r\R                  S 5       r\	S 5       r\R                  S 5       r\	S 5       r\R                  S 5       r\	S 5       r\R                  S 5       rSrg)LatentStyles   zProvides 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                     [         R                  " U5      nU R                  R                  U5      nUc  [	        SU-  5      e[        U5      $ )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       D/var/www/html/env/lib/python3.13/site-packages/docx/styles/latent.py__getitem__LatentStyles.__getitem__   sH    **3/
}}00<;cABBL))    c                 <    S U R                   R                   5       $ )Nc              3   8   #    U  H  n[        U5      v   M     g 7fN)r   ).0lss     r   	<genexpr>(LatentStyles.__iter__.<locals>.<genexpr>   s     J+IRR  +Is   )r
   lsdException_lstr   s    r   __iter__LatentStyles.__iter__   s    J4==+I+IJJr   c                 @    [        U R                  R                  5      $ r   )lenr
   r   r   s    r   __len__LatentStyles.__len__   s    4==1122r   c                     U R                   R                  5       n[        R                  " U5      Ul        [        U5      $ )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_styleLatentStyles.add_latent_style   s4     }}557%11$7L))r   c                 .    U R                   R                  $ )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_priorityLatentStyles.default_priority!   s     }}***r   c                 $    XR                   l        g r   r+   r   values     r   r-   r.   *   s    &+#r   c                 8    U R                   R                  S5      $ )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_hiddenLatentStyles.default_to_hidden.   s     }}&&77r   c                 <    U R                   R                  SU5        g )Nr3   r
   set_bool_propr0   s     r   r6   r7   7   s    ##OU;r   c                 8    U R                   R                  S5      $ )a7  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).
defLockedStater4   r   s    r   default_to_lockedLatentStyles.default_to_locked;   s     }}&&'788r   c                 <    U R                   R                  SU5        g )Nr<   r9   r0   s     r   r=   r>   F   s    ##$4e<r   c                 8    U R                   R                  S5      $ )ztBoolean specifying whether the default behavior for latent styles is to
appear in the style gallery when not hidden.
defQFormatr4   r   s    r   default_to_quick_style#LatentStyles.default_to_quick_styleJ   s     }}&&|44r   c                 <    U R                   R                  SU5        g )NrA   r9   r0   s     r   rB   rC   P   s    ##L%8r   c                 8    U R                   R                  S5      $ )zrBoolean specifying whether the default behavior for latent styles is to be
unhidden when first applied to content.defUnhideWhenUsedr4   r   s    r   default_to_unhide_when_used(LatentStyles.default_to_unhide_when_usedT   s     }}&&':;;r   c                 <    U R                   R                  SU5        g )NrF   r9   r0   s     r   rG   rH   Z   s    ##$7?r   c                 .    U R                   R                  $ )a  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_countLatentStyles.load_count^   s     }}"""r   c                 $    XR                   l        g r   rK   r0   s     r   rM   rN   i   s    #r    N)__name__
__module____qualname____firstlineno____doc__r   r   r#   r(   propertyr-   setterr6   r=   rB   rG   rM   __static_attributes__rP   r   r   r   r      s2   ,*K3* + + , , 8 8 < < 9 9 = = 5 5
 ""9 #9 < <
 !''@ (@ # # $ $r   r   c                   2   \ rS rSrSrS r\S 5       r\R                  S 5       r\S 5       r	\	R                  S 5       r	\S 5       r
\S	 5       r\R                  S
 5       r\S 5       r\R                  S 5       r\S 5       r\R                  S 5       rSrg)r   n   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    U R                   R                  5         SU l         g)a  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   r\   _LatentStyle.deletew   s     	r   c                 8    U R                   R                  S5      $ )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   hidden_LatentStyle.hidden   s     }}((66r   c                 <    U R                   R                  SU5        g )Nr_   r
   set_on_off_propr0   s     r   rb   rc      s    %%lE:r   c                 8    U R                   R                  S5      $ )a%  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).
lockedr`   r   s    r   rh   _LatentStyle.locked   s     }}((22r   c                 <    U R                   R                  SU5        g )Nrh   re   r0   s     r   rh   ri      s    %%h6r   c                 V    [         R                  " U R                  R                  5      $ )z9The name of the built-in style this exception applies to.)r   internal2uir
   r'   r   s    r   r'   _LatentStyle.name   s     $$T]]%7%788r   c                 .    U R                   R                  $ )z:The integer sort key for this latent style in the Word UI.r
   
uiPriorityr   s    r   priority_LatentStyle.priority   s     }}'''r   c                 $    XR                   l        g r   ro   r0   s     r   rq   rr      s    #( r   c                 8    U R                   R                  S5      $ )zTri-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.
qFormatr`   r   s    r   quick_style_LatentStyle.quick_style   s     }}((33r   c                 <    U R                   R                  SU5        g )Nru   re   r0   s     r   rv   rw      s    %%i7r   c                 8    U R                   R                  S5      $ )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.
unhideWhenUsedr`   r   s    r   unhide_when_used_LatentStyle.unhide_when_used   s     }}(()9::r   c                 <    U R                   R                  SU5        g )Nrz   re   r0   s     r   r{   r|      s    %%&6>r   )r
   N)rQ   rR   rS   rT   rU   r\   rV   rb   rW   rh   r'   rq   rv   r{   rX   rP   r   r   r   r   n   s    	 7 7 ]]; ; 3 3 ]]7 7 9 9 ( ( __) ) 4 4 8 8 ; ; ? ?r   r   N)rU   docx.sharedr   docx.stylesr   r   r   rP   r   r   <module>r      s+    # $ !d$< d$NX?< X?r   