o
    ¨Êh^!  ã                   @   sd   d Z ddlmZ G dd„ deƒZG dd„ deƒZG dd„ deƒZG d	d
„ d
eƒZG d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                   @   s¨   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d„ Z$dd„ Z%dd„ Z&dS ) ÚFonté    r   é   é!   é"   é   é   é   éM   é€   é�   é‚   é†   éˆ   é¡   é¢   é£   é±   é²   éº   éÌ   éÞ   éî   éÿ   c                 C   sZ   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©Úself© r0   úA/var/www/html/env/lib/python3.10/site-packages/xlwt/Formatting.pyÚ__init__L   s   
zFont.__init__c           
      C   s®   | j }d}| jr|dO }d| _| jr|dO }| j| jkr |dO }| jr'|dO }| jr.|dO }| jr5|dO }| j	}| j}| j
}| j}| j}| j}| j}	t |||||||||	¡	S )	Nr   r   i¼  r   r	   é   é   é    )r   r#   r$   r   r(   r'   r   r    r!   r"   r&   r*   r,   r-   r   Ú
FontRecord)
r/   r   Úoptionsr"   Úweightr&   r(   r*   r,   r-   r0   r0   r1   Úget_biff_record_   s4   þzFont.get_biff_recordc                 C   s8   | 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,   r-   r.   r0   r0   r1   Ú_search_key}   s   ózFont._search_keyN)'Ú__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_Ir2   r9   r;   r0   r0   r0   r1   r   %   sJ    r   c                   @   s„   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
d„ Zdd„ ZdS )Ú	Alignmentr   r   r   r   r	   r
   é   é   r   c                 C   sH   | 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Úmergr.   r0   r0   r1   r2   °   s   
zAlignment.__init__c              	   C   s(   | j | j| j| j| j| j| j| j| jf	S r:   )	r`   rb   rd   rf   rh   rj   rl   rm   rn   r.   r0   r0   r1   r;   »   s   þzAlignment._search_keyN)r<   r=   r>   r_   Ú	HORZ_LEFTÚHORZ_CENTERÚ
HORZ_RIGHTÚHORZ_FILLEDÚHORZ_JUSTIFIEDÚHORZ_CENTER_ACROSS_SELÚHORZ_DISTRIBUTEDÚVERT_TOPÚVERT_CENTERra   ÚVERT_JUSTIFIEDÚVERT_DISTRIBUTEDrc   ÚDIRECTION_LRÚDIRECTION_RLre   ÚORIENTATION_STACKEDÚORIENTATION_90_CCÚORIENTATION_90_CWrg   ÚROTATION_STACKEDÚWRAP_AT_RIGHTri   ÚSHRINK_TO_FITrk   r2   r;   r0   r0   r0   r1   r\   Ž   s:    r\   c                   @   sd   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d„ Zdd„ ZdS )ÚBordersr   r   r   r   r	   r
   r]   r^   r3   é	   é
   é   é   é   c                 C   sZ   | 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_diag2r.   r0   r0   r1   r2   ×   s   zBorders.__init__c                 C   s4   | 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—   r.   r0   r0   r1   r;   ç   s
   üzBorders._search_keyN)r<   r=   r>   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–   r2   r;   r0   r0   r0   r1   r‚   Á   s*    r‚   c                   @   s$   e Zd ZdZdZdd„ Zdd„ ZdS )ÚPatternr   r   c                 C   s   | j | _d| _d| _d S )Nrˆ   éA   )Ú
NO_PATTERNÚpatternÚpattern_fore_colourÚpattern_back_colourr.   r0   r0   r1   r2   ô   s   
zPattern.__init__c                 C   s   | j | j| jfS r:   )rª   r«   r¬   r.   r0   r0   r1   r;   ù   s   ýzPattern._search_keyN)r<   r=   r>   r©   ÚSOLID_PATTERNr2   r;   r0   r0   r0   r1   r§   ï   s
    r§   c                   @   s   e Zd Zdd„ Zdd„ ZdS )Ú
Protectionc                 C   s   d| _ d| _d S )Nr   r   ©Úcell_lockedÚformula_hiddenr.   r0   r0   r1   r2     s   
zProtection.__init__c                 C   s   | j | jfS r:   r¯   r.   r0   r0   r1   r;     s   þzProtection._search_keyN)r<   r=   r>   r2   r;   r0   r0   r0   r1   r®      s    r®   N)	Ú__doc__Ú r   Úobjectr   r\   r‚   r§   r®   r0   r0   r0   r1   Ú<module>   s    "i3.