
    Mf^!                         d Z ddlmZ  G d de          Z G d de          Z G d de          Z G d	 d
e          Z G d de          ZdS )al  
Formatting
==========

The  XF  record is able to store explicit cell formatting attributes or the
attributes  of  a cell style. Explicit formatting includes the reference to
a  cell  style  XF  record. This allows to extend a defined cell style with
some  explicit  attributes.  The  formatting  attributes  are  divided into
6 groups:

=============   ==========================================================
Group           Attributes
=============   ==========================================================
Number format   Number format index (index to FORMAT record)
Font            Font index (index to FONT record)
Alignment       Horizontal and vertical alignment, text wrap, indentation,
                orientation/rotation, text direction
Border          Border line styles and colours
Background      Background area style and colours
Protection      Cell locked, formula hidden
=============   ==========================================================

For  each  group  a flag in the cell XF record specifies whether to use the
attributes  contained  in  that  XF  record  or  in  the  referenced  style
XF  record. In style XF records, these flags specify whether the attributes
will  overwrite  explicit  cell  formatting  when  the  style is applied to
a  cell. Changing a cell style (without applying this style to a cell) will
change  all  cells which already use that style and do not contain explicit
cell  attributes for the changed style attributes. If a cell XF record does
not  contain  explicit  attributes  in a group (if the attribute group flag
is not set), it repeats the attributes of its style XF record.

   )BIFFRecordsc                       e Zd ZdZdZdZdZdZdZdZ	dZ
dZdZdZdZdZdZdZdZdZd	Zd
ZdZdZdZdZdZdZdZdZdZdZdZ dZ!dZ"dZ#d Z$d Z%d Z&dS )Font    r      !   "            M                                                c                     d| _         d| _        d| _        d| _        d| _        d| _        d| _        d| _        | j        | _	        | j
        | _        | j        | _        | j        | _        d| _        d S )N   Fi  i  Arial)heightitalic
struck_outoutlineshadowcolour_indexbold_weightESCAPEMENT_NONE
escapementUNDERLINE_NONE	underlineFAMILY_NONEfamilyCHARSET_SYS_DEFAULTcharsetnameselfs    N/var/www/surfInsights/venv3-11/lib/python3.11/site-packages/xlwt/Formatting.py__init__zFont.__init__L   sp    
 "	.,&/			    c                 ^   | j         }d}| j        r|dz  }d| _        | j        r|dz  }| j        | j        k    r|dz  }| j        r|dz  }| j        r|dz  }| j        r|dz  }| j	        }| j        }| j
        }| j        }| j        }| j        }| j        }	t          j        |||||||||		  	        S )	Nr   r   i  r   r             )r    r&   r'   r!   r+   r*   r"   r#   r$   r%   r)   r-   r/   r0   r   
FontRecord)
r2   r    optionsr%   weightr)   r+   r-   r/   r0   s
             r3   get_biff_recordzFont.get_biff_record_   s    9 	"tOG!DL; 	tOG>T000tOG? 	tOG< 	uG; 	uG(_
N	,y%fg|VZvw  	r5   c                     | j         | j        | j        | j        | j        | j        | j        | j        | j        | j	        | j
        | j        | j        fS N)r    r!   r"   r#   r$   r%   r&   r'   r)   r+   r-   r/   r0   r1   s    r3   _search_keyzFont._search_key}   sN    KKOLKILONKLI 	r5   N)'__name__
__module____qualname__r(   ESCAPEMENT_SUPERSCRIPTESCAPEMENT_SUBSCRIPTr*   UNDERLINE_SINGLEUNDERLINE_SINGLE_ACCUNDERLINE_DOUBLEUNDERLINE_DOUBLE_ACCr,   FAMILY_ROMANFAMILY_SWISSFAMILY_MODERNFAMILY_SCRIPTFAMILY_DECORATIVECHARSET_ANSI_LATINr.   CHARSET_SYMBOLCHARSET_APPLE_ROMANCHARSET_ANSI_JAP_SHIFT_JISCHARSET_ANSI_KOR_HANGULCHARSET_ANSI_KOR_JOHABCHARSET_ANSI_CHINESE_GBKCHARSET_ANSI_CHINESE_BIG5CHARSET_ANSI_GREEKCHARSET_ANSI_TURKISHCHARSET_ANSI_VIETNAMESECHARSET_ANSI_HEBREWCHARSET_ANSI_ARABICCHARSET_ANSI_BALTICCHARSET_ANSI_CYRILLICCHARSET_ANSI_THAICHARSET_ANSI_LATIN_IICHARSET_OEM_LATIN_Ir4   r=   r@    r5   r3   r   r   %   s        "O"""N""""KLLMM"&"&"&N"&"&"&"&"&"&"&"&"&"&"&"&"&"&"&"&  &  <    r5   r   c                       e Zd ZdZdZdZdZdZdZdZ	dZ
dZdZdZdZdZdZdZdZdZdZdZdZdZd	ZdZdZdZdZd
 Zd ZdS )	Alignmentr   r   r   r
   r   r         r   c                     | j         | _        | j        | _        | j        | _        | j        | _        | j        | _	        | j
        | _        | j        | _        d| _        d| _        d S )Nr   )HORZ_GENERALhorzVERT_BOTTOMvertDIRECTION_GENERALdireORIENTATION_NOT_ROTATEDorieROTATION_0_ANGLErotaNOT_WRAP_AT_RIGHTwrapNOT_SHRINK_TO_FITshriindemergr1   s    r3   r4   zAlignment.__init__   sZ    %	$	*	0	)	*	*					r5   c           	      r    | j         | j        | j        | j        | j        | j        | j        | j        | j        f	S r?   )	rh   rj   rl   rn   rp   rr   rt   ru   rv   r1   s    r3   r@   zAlignment._search_key   s2    Ity$)TY	Ity$)TY 	r5   N)rA   rB   rC   rg   	HORZ_LEFTHORZ_CENTER
HORZ_RIGHTHORZ_FILLEDHORZ_JUSTIFIEDHORZ_CENTER_ACROSS_SELHORZ_DISTRIBUTEDVERT_TOPVERT_CENTERri   VERT_JUSTIFIEDVERT_DISTRIBUTEDrk   DIRECTION_LRDIRECTION_RLrm   ORIENTATION_STACKEDORIENTATION_90_CCORIENTATION_90_CWro   ROTATION_STACKEDWRAP_AT_RIGHTrq   SHRINK_TO_FITrs   r4   r@   ra   r5   r3   rc   rc      s        "&L"&I"&K"&J"&K"&N"&"&"&H"&K"&K"&N"&"&"&L"&L"&"&"&"&"&"&"&M"&"&M"&	 	 	    r5   rc   c                   b    e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZdZdZdZdZdZdZdZd Zd ZdS )Bordersr   r   r   r
   r   r   rd   re   r7   	   
            c                     | j         | _        | j         | _        | j         | _        | j         | _        | j         | _        d| _        d| _        d| _        d| _	        d| _
        | j        | _        | j        | _        d S )N@   )NO_LINEleftrighttopbottomdiagleft_colourright_colour
top_colourbottom_colourdiag_colourNO_NEED_DIAG1
need_diag1NO_NEED_DIAG2
need_diag2r1   s    r3   r4   zBorders.__init__   sn    l	l
lll	!!!!!,,r5   c                     | j         | j        | j        | j        | j        | j        | j        | j        | j        | j	        | j
        | j        fS r?   )r   r   r   r   r   r   r   r   r   r   r   r   r1   s    r3   r@   zBorders._search_key   sD    Y
DHdk49t0$/!1_do	 	r5   N)rA   rB   rC   r   THINMEDIUMDASHEDDOTTEDTHICKDOUBLEHAIRMEDIUM_DASHEDTHIN_DASH_DOTTEDMEDIUM_DASH_DOTTEDTHIN_DASH_DOT_DOTTEDMEDIUM_DASH_DOT_DOTTEDSLANTED_MEDIUM_DASH_DOTTED
NEED_DIAG1
NEED_DIAG2r   r   r4   r@   ra   r5   r3   r   r      s        GDFFFEFD"&M"&"&"&"&"&JJMM- - -     r5   r   c                   "    e Zd ZdZdZd Zd ZdS )Patternr   r   c                 :    | j         | _        d| _        d| _        d S )Nr   A   )
NO_PATTERNpatternpattern_fore_colourpattern_back_colourr1   s    r3   r4   zPattern.__init__   s!    #' #'   r5   c                 *    | j         | j        | j        fS r?   )r   r   r   r1   s    r3   r@   zPattern._search_key   s    L$$ 	r5   N)rA   rB   rC   r   SOLID_PATTERNr4   r@   ra   r5   r3   r   r      s<        JM( ( (
    r5   r   c                       e Zd Zd Zd ZdS )
Protectionc                 "    d| _         d| _        d S )Nr   r   cell_lockedformula_hiddenr1   s    r3   r4   zProtection.__init__  s    r5   c                     | j         | j        fS r?   r   r1   s    r3   r@   zProtection._search_key  s     	r5   N)rA   rB   rC   r4   r@   ra   r5   r3   r   r      s2                 r5   r   N)	__doc__ r   objectr   rc   r   r   r   ra   r5   r3   <module>r      s     D      g g g g g6 g g gR1 1 1 1 1 1 1 1f, , , , ,f , , ,\    f   "	 	 	 	 	 	 	 	 	 	r5   