B
    j@5\@  ã               @   sH   d Z ddlmZ ddlmZ ddlT G dd„ deƒZG dd	„ d	eƒZd
S )z·
A Styles is a collection of PropertySets that can be applied to a particular RTF element.

At present there are only two, Text and Paragraph but ListStyles will be added soon too.


é    )Úabsolute_import)Úobjecté   )Ú*c               @   s6   e Zd Zddd„Zdd„ Zdd„ Zdd	„ Zd
d„ ZdS )Ú	TextStyleNc             C   s"   |   |¡ |  |¡ |  |¡ d S )N)ÚSetTextPropertySetÚSetNameÚSetShadingPropertySet)ÚselfZ
text_propsÚnameÚshading_props© r   ú+lib/python3.7/site-packages/PyRTF/Styles.pyÚ__init__   s    

zTextStyle.__init__c             C   s   t | ƒS )N)Údeepcopy)r
   r   r   r   ÚCopy   s    zTextStyle.Copyc             C   s
   || _ | S )N)ÚName)r
   Úvaluer   r   r   r      s    zTextStyle.SetNamec             C   s   t |tƒst‚|| _| S )N)Ú
isinstanceÚTextPropertySetÚAssertionError)r
   r   r   r   r   r      s    zTextStyle.SetTextPropertySetc             C   s&   |d kst |tƒst‚|ptƒ | _| S )N)r   ÚShadingPropertySetr   )r
   r   r   r   r   r	      s    zTextStyle.SetShadingPropertySet)NN)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r	   r   r   r   r   r      s
   
r   c               @   sV   e Zd Zddd„Zdd„ Zdd„ Zdd	„ Zd
d„ Zdd„ Zdd„ Z	dd„ Z
dd„ ZdS )ÚParagraphStyleNc             C   sj   |j jstdƒ‚|j js tdƒ‚|  |¡ |  |¡ |  |¡ |  |¡ |  |¡ |  	d ¡ |  
d ¡ d S )Nz,Paragraph Styles must have a Font specified.z1Paragraph Styles must have a Font Size specified.)r   ZFontÚ	ExceptionZSizer   ÚSetTextStyleÚSetParagraphPropertySetÚSetFramePropertySetr	   Ú
SetBasedOnÚSetNext)r
   r   Z
text_styleZparagraph_propsZframe_propsr   r   r   r   r   %   s      





zParagraphStyle.__init__c             C   s   t | ƒS )N)r   )r
   r   r   r   r   6   s    zParagraphStyle.Copyc             C   s
   || _ | S )N)r   )r
   r   r   r   r   r   9   s    zParagraphStyle.SetNamec             C   s   t |tƒst‚|| _| S )N)r   r   r   )r
   r   r   r   r   r   =   s    zParagraphStyle.SetTextStylec             C   s&   |d kst |tƒst‚|ptƒ | _| S )N)r   ZParagraphPropertySetr   )r
   r   r   r   r   r   B   s    z&ParagraphStyle.SetParagraphPropertySetc             C   s&   |d kst |tƒst‚|ptƒ | _| S )N)r   ZFramePropertySetr   )r
   r   r   r   r   r   G   s    z"ParagraphStyle.SetFramePropertySetc             C   s&   |dkst |tƒst‚|ptƒ | _| S )z-Set the background shading for the paragraph.N)r   r   r   )r
   r   r   r   r   r	   L   s    z$ParagraphStyle.SetShadingPropertySetc             C   s   |rt |tƒst‚|| _| S )z2Set the Paragraph Style that this one is based on.)r   r   r   ZBasedOn)r
   r   r   r   r   r    S   s    zParagraphStyle.SetBasedOnc             C   s   |rt |tƒst‚|| _| S )z4Set the Paragraph Style that should follow this one.)r   r   r   ZNext)r
   r   r   r   r   r!   Z   s    zParagraphStyle.SetNext)NNN)r   r   r   r   r   r   r   r   r   r	   r    r!   r   r   r   r   r   $   s   
r   N)Ú__doc__Z
__future__r   Úbuiltinsr   ZPropertySetsr   r   r   r   r   r   Ú<module>   s
   