
    ,hs                        d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 ddlmZ ddlmZ dd	lmZ ddZ G d d
e
      Z G d de      ZeZ G d de      ZeZ G d de      Z G d de      Zy)zStyle object hierarchy.    )annotations)Type)WD_STYLE_TYPE)CT_Style)ElementProxy)	BabelFish)Font)ParagraphFormat	BaseStylec                    t         j                  t        t         j                  t        t         j
                  t        t         j                  t        i| j                     } ||       S )zJReturn `Style` object of appropriate |BaseStyle| subclass for `style_elm`.)
r   	PARAGRAPHParagraphStyle	CHARACTERCharacterStyleTABLE_TableStyleLIST_NumberingStyletype)	style_elm	style_clss     S/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/docx/styles/style.pyStyleFactoryr      sR     	[O	"
 nn"I Y    c                      e Zd ZdZd fdZe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d       Zej                  d        Zed        Zed        Zej                  d        Z xZS )r   zBase class for the various types of style object, paragraph, character, table,
    and numbering.

    These properties and methods are inherited by all style objects.
    c                2    t         |   |       || _        y N)super__init__
_style_elm)selfr   	__class__s     r   r   zBaseStyle.__init__"   s    ##r   c                0    | j                   j                   S )a&  Read-only.

        |True| if this style is a built-in style. |False| indicates it is a custom
        (user-defined) style. Note this value is based on the presence of a
        `customStyle` attribute in the XML, not on specific knowledge of which styles
        are built into Word.
        )_elementcustomStyler!   s    r   builtinzBaseStyle.builtin&   s     ==,,,,r   c                F    | j                   j                          d| _         y)aA  Remove this style definition from the document.

        Note that calling this method does not remove or change the style applied to any
        document content. Content items having the deleted style will be rendered using
        the default style, as is any content with a style not defined in the document.
        N)r$   deleter&   s    r   r)   zBaseStyle.delete1   s     	r   c                .    | j                   j                  S )a  |True| if display of this style in the style gallery and list of recommended
        styles is suppressed.

        |False| otherwise. In order to be shown in the style gallery, this value must be
        |False| and :attr:`.quick_style` must be |True|.
        r$   semiHidden_valr&   s    r   hiddenzBaseStyle.hidden;        }}+++r   c                &    || j                   _        y r   r+   r!   values     r   r-   zBaseStyle.hiddenE       ',$r   c                .    | j                   j                  S )a@  Read/write Boolean.

        |True| if this style 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).
        r$   
locked_valr&   s    r   lockedzBaseStyle.lockedI   s     }}'''r   c                &    || j                   _        y r   r4   r0   s     r   r6   zBaseStyle.lockedT   s    #( r   c                ^    | j                   j                  }|yt        j                  |      S )zThe UI name of this style.N)r$   name_valr   internal2ui)r!   names     r   r;   zBaseStyle.nameX   s,     }}%%<$$T**r   c                &    || j                   _        y r   )r$   r9   r0   s     r   r;   zBaseStyle.name`   s    !&r   c                .    | j                   j                  S )a,  The integer sort key governing display sequence of this style in the Word UI.

        |None| indicates no setting is defined, causing Word to use the default value of
        0. Style name is used as a secondary sort key to resolve ordering of styles
        having the same priority value.
        r$   uiPriority_valr&   s    r   priorityzBaseStyle.priorityd   r.   r   c                &    || j                   _        y r   r>   r0   s     r   r@   zBaseStyle.priorityn   r2   r   c                .    | j                   j                  S )z|True| if this style should be displayed in the style gallery when
        :attr:`.hidden` is |False|.

        Read/write Boolean.
        r$   qFormat_valr&   s    r   quick_stylezBaseStyle.quick_styler   s     }}(((r   c                &    || j                   _        y r   rC   r0   s     r   rE   zBaseStyle.quick_style{   s    $)!r   c                .    | j                   j                  S )zThe unique key name (string) for this style.

        This value is subject to rewriting by Word and should generally not be changed
        unless you are familiar with the internals involved.
        )r    styleIdr&   s    r   style_idzBaseStyle.style_id   s     &&&r   c                &    || j                   _        y r   )r$   rH   r0   s     r   rI   zBaseStyle.style_id   s     %r   c                V    | j                   j                  }|t        j                  S |S )zoMember of :ref:`WdStyleType` corresponding to the type of this style, e.g.
        ``WD_STYLE_TYPE.PARAGRAPH``.)r    r   r   r   )r!   r   s     r   r   zBaseStyle.type   s)     ##< ***r   c                .    | j                   j                  S )a	  |True| if an application should make this style visible the next time it is
        applied to content.

        False otherwise. Note that |docx| does not automatically unhide a style having
        |True| for this attribute when it is applied to content.
        r$   unhideWhenUsed_valr&   s    r   unhide_when_usedzBaseStyle.unhide_when_used   s     }}///r   c                &    || j                   _        y r   rM   r0   s     r   rO   zBaseStyle.unhide_when_used   s    +0(r   )r   r   )returnstr)__name__
__module____qualname____doc__r   propertyr'   r)   r-   setterr6   r;   r@   rE   rI   r   rO   __classcell__)r"   s   @r   r   r      sr   $ - - , , ]]- - ( ( ]]) ) + + 
[[' ' , , __- - ) ) * * ' ' __& &   0 0 1 1r   c                  T    e Zd ZdZed        Zej                  d        Zed        Zy)r   zA character style.

    A character style is applied to a |Run| object and primarily provides character-
    level formatting via the |Font| object in its :attr:`.font` property.
    c                J    | j                   j                  }|yt        |      S )zdStyle object this style inherits from or |None| if this style is not based on
        another style.N)r$   
base_styler   )r!   r\   s     r   r\   zCharacterStyle.base_style   s'     ]]--
J''r   c                F    ||j                   nd }|| j                  _        y r   )rI   r$   basedOn_val)r!   stylerI   s      r   r\   zCharacterStyle.base_style   s    %*%65>>D$,!r   c                ,    t        | j                        S )z}The |Font| object providing access to the character formatting properties for
        this style, such as font name and size.)r	   r$   r&   s    r   fontzCharacterStyle.font   s     DMM""r   N)rS   rT   rU   rV   rW   r\   rX   ra    r   r   r   r      sI     ( ( - - # #r   r   c                  Z    e Zd ZdZd Zed        Zej                  d        Zed        Zy)r   zA paragraph style.

    A paragraph style provides both character formatting and paragraph formatting such
    as indentation and line-spacing.
    c                8    d| j                   dt        |       S )Nz_ParagraphStyle('') id: r;   idr&   s    r   __repr__zParagraphStyle.__repr__   s    15BtHEEr   c                    | j                   j                  }|| S |j                  t        j                  k7  r| S t        |      S )aI  |_ParagraphStyle| object representing the style to be applied automatically
        to a new paragraph inserted after a paragraph of this style.

        Returns self if no next paragraph style is defined. Assigning |None| or `self`
        removes the setting such that new paragraphs are created using this same style.
        )r$   
next_styler   r   r   r   )r!   next_style_elms     r   next_paragraph_stylez#ParagraphStyle.next_paragraph_style   sB     11!K-"9"99KN++r   c                    ||j                   | j                   k(  r| j                  j                          y |j                   | j                  j                         _        y r   )rI   r$   _remove_nextget_or_add_nextval)r!   r_   s     r   rl   z#ParagraphStyle.next_paragraph_style   s?    =ENNdmm;MM&&(27..DMM))+/r   c                ,    t        | j                        S )zThe |ParagraphFormat| object providing access to the paragraph formatting
        properties for this style such as indentation.)r
   r$   r&   s    r   paragraph_formatzParagraphStyle.paragraph_format   s     t}}--r   N)	rS   rT   rU   rV   rh   rW   rl   rX   rr   rb   r   r   r   r      sQ    F , ,   A !A . .r   r   c                      e Zd ZdZd Zy)r   zA table style.

    A table style provides character and paragraph formatting for its contents as well
    as special table formatting properties.
    c                8    d| j                   dt        |       S )Nz_TableStyle('re   rf   r&   s    r   rh   z_TableStyle.__repr__   s    -1YY4AAr   N)rS   rT   rU   rV   rh   rb   r   r   r   r      s    Br   r   c                      e Zd ZdZy)r   z1A numbering style.

    Not yet implemented.
    N)rS   rT   rU   rV   rb   r   r   r   r      s    r   r   N)r   r   rQ   r   )rV   
__future__r   typingr   docx.enum.styler   docx.oxml.stylesr   docx.sharedr   docx.stylesr   docx.text.fontr	   docx.text.parfmtr
   r   r   r   _CharacterStyler   _ParagraphStyler   r   rb   r   r   <module>r      su     "  ) % $ !  ,	 F1 F1R#Y #: !$.^ $.P !B. Bi r   