
    f#                        d dl mZ d dl mZ d dl mZ d dl mZ erEd dl mZ d dl mZ ed         Z G d d	ed
          Z G d ded
          Z	 G d ded
          Z
nd dl mZ d dl mZ eZeeef         xZxZ	Z
 G d d          Z G d d          Z G d d          Z G d d          Z G d d          Z G d de          Z G d de          Z G d  d!e          Z G d" d#          Zd$S )%    )TYPE_CHECKING)List)Optional)Type)Literal)	TypedDict)portrait	landscapec                   8    e Zd ZU eed<   eed<   eed<   eed<   dS )_MarginOptsleftrighttopbottomN__name__
__module____qualname__float__annotations__     n/var/www/ffwdstore.be/apps/py-env/lib/python3.11/site-packages/selenium/webdriver/common/print_page_options.pyr   r      s4         


r   r   F)totalc                   $    e Zd ZU eed<   eed<   dS )	_PageOptswidthheightNr   r   r   r   r   r   $   s"         r   r   c                   b    e Zd ZU eed<   eed<   eed<   eed<   eed<   eed<   e	e
         ed<   dS )	
_PrintOptsmarginpage
backgroundorientationscaleshrinkToFit
pageRangesN)r   r   r   r   r   r   boolOrientationr   r   strr   r   r   r    r    (   sd             Ir   r    )Any)Dictc                   8    e Zd ZdZd Zdee         fdZddZdS )_PageSettingsDescriptorz8Descriptor which validates `height` and 'width' of page.c                     || _         d S Nnameselfr2   s     r   __init__z _PageSettingsDescriptor.__init__<       			r   returnc                 B    |j                             | j        d           S r0   )_pagegetr2   r4   objclss      r   __get__z_PageSettingsDescriptor.__get__?   s    y}}TY---r   Nc                      t          |d          | j        |           ||j        | j        <   |j        |j        d<   d S )N_validate_num_propertyr"   )getattrr2   r9   _print_optionsr4   r<   values      r   __set__z_PageSettingsDescriptor.__set__B   sD    .-..ty%@@@$	$)%(Y6"""r   r7   N	r   r   r   __doc__r5   r   r   r>   rE   r   r   r   r.   r.   9   s\        BB  .8E? . . . ./ / / / / /r   r.   c                   8    e Zd ZdZd Zdee         fdZddZdS )_MarginSettingsDescriptorz`Descriptor which validates below attributes.

    - top
    - bottom
    - left
    - right
    c                     || _         d S r0   r1   r3   s     r   r5   z"_MarginSettingsDescriptor.__init__Q   r6   r   r7   c                 B    |j                             | j        d           S r0   )_marginr:   r2   r;   s      r   r>   z!_MarginSettingsDescriptor.__get__T   s    {ty$///r   Nc                      t          |d          d| j         |           ||j        | j        <   |j        |j        d<   d S )Nr@   zMargin r!   )rA   r2   rM   rB   rC   s      r   rE   z!_MarginSettingsDescriptor.__set__W   sM    .-../D/D/DeLLL!&DI'*{8$$$r   rF   rG   r   r   r   rJ   rJ   H   s`           08E? 0 0 0 03 3 3 3 3 3r   rJ   c                   8    e Zd ZdZd Zdee         fdZddZdS )_ScaleDescriptorz'Scale descriptor which validates scale.c                     || _         d S r0   r1   r3   s     r   r5   z_ScaleDescriptor.__init__`   r6   r   r7   c                 @    |j                             | j                  S r0   rB   r:   r2   r;   s      r   r>   z_ScaleDescriptor.__get__c   s    !%%di000r   Nc                      t          |d          | j        |           |dk     s|dk    rt          d          ||j        | j        <   d S )Nr@   g?   z*Value of scale should be between 0.1 and 2)rA   r2   
ValueErrorrB   rC   s      r   rE   z_ScaleDescriptor.__set__f   sV    .-..ty%@@@3;;%!))IJJJ(-49%%%r   rF   rG   r   r   r   rP   rP   ]   s\        11  18E? 1 1 1 1. . . . . .r   rP   c                   @    e Zd ZdZddgZd Zdee         fdZd	dZ	dS )
_PageOrientationDescriptorz?PageOrientation descriptor which validates orientation of page.r	   r
   c                     || _         d S r0   r1   r3   s     r   r5   z#_PageOrientationDescriptor.__init__r   r6   r   r7   c                 B    |j                             | j        d           S r0   rS   r;   s      r   r>   z"_PageOrientationDescriptor.__get__u       !%%di666r   Nc                 d    || j         vrt          d| j                    ||j        | j        <   d S )Nz!Orientation value must be one of )ORIENTATION_VALUESrV   rB   r2   rC   s      r   rE   z"_PageOrientationDescriptor.__set__x   s?    ///ZAXZZ[[[(-49%%%r   rF   )
r   r   r   rH   r]   r5   r   r)   r>   rE   r   r   r   rX   rX   m   sh        II$k2  78K#8 7 7 7 7. . . . . .r   rX   c                   ,    e Zd ZdZdefdZd ZddZdS )	_ValidateTypeDescriptorzEBase Class Descriptor which validates type of any subclass attribute.expected_typec                 "    || _         || _        d S r0   )r2   r`   )r4   r2   r`   s      r   r5   z _ValidateTypeDescriptor.__init__   s    	*r   c                 B    |j                             | j        d           S r0   rS   r;   s      r   r>   z_ValidateTypeDescriptor.__get__   r[   r   r7   Nc                     t          || j                  s#t          | j         d| j        j                   ||j        | j        <   d S )Nz should be of type )
isinstancer`   rV   r2   r   rB   rC   s      r   rE   z_ValidateTypeDescriptor.__set__   sQ    %!344 	]	[[d>P>Y[[\\\(-49%%%r   rF   )r   r   r   rH   r   r5   r>   rE   r   r   r   r_   r_   ~   sX        OO+D + + + +7 7 7. . . . . .r   r_   c                   "     e Zd ZdZ fdZ xZS )_ValidateBackGroundz&Expected type of background attribute.c                 V    t                                          |t                     d S r0   superr5   r(   r4   r2   	__class__s     r   r5   z_ValidateBackGround.__init__   #    t$$$$$r   r   r   r   rH   r5   __classcell__rk   s   @r   rf   rf      s>        00% % % % % % % % %r   rf   c                   "     e Zd ZdZ fdZ xZS )_ValidateShrinkToFitz)Expected type of shrink to fit attribute.c                 V    t                                          |t                     d S r0   rh   rj   s     r   r5   z_ValidateShrinkToFit.__init__   rl   r   rm   ro   s   @r   rq   rq      s>        33% % % % % % % % %r   rq   c                   "     e Zd ZdZ fdZ xZS )_ValidatePageRangesz'Expected type of page ranges attribute.c                 V    t                                          |t                     d S r0   )ri   r5   listrj   s     r   r5   z_ValidatePageRanges.__init__   rl   r   rm   ro   s   @r   rt   rt      s>        11% % % % % % % % %r   rt   c                   >   e Zd Z ed          Z	  ed          Z	  ed          Z	  ed          Z	  ed          Z		  ed          Z
	  ed          Z	  ed          Z	  ed	          Z	  ed
          Z	  ed          Z	 ddZdefdZdededdfdZdS )PrintOptionsr   r   r   r   r   r   r%   r$   r#   r&   r'   r7   Nc                 0    i | _         i | _        i | _        d S r0   )rB   r9   rM   r4   s    r   r5   zPrintOptions.__init__  s    *, "
$&r   c                     | j         S )z-:Returns: A hash of print options configured.)rB   rz   s    r   to_dictzPrintOptions.to_dict  s    ""r   property_namerD   c                     t          |t          t          f          st          | d          |dk     rt          | d          dS )z3Helper function to validate some of the properties.z  should be an integer or a floatr   z cannot be less than 0N)rd   intr   rV   )r4   r}   rD   s      r   r@   z#PrintOptions._validate_num_property  sW    %#u.. 	QOOOPPP199EEEFFF 9r   rF   )r   r   r   r.   page_height
page_widthrJ   
margin_topmargin_bottommargin_leftmargin_rightrP   r%   rX   r$   rf   r#   rq   shrink_to_fitrt   page_rangesr5   r    r|   r*   r   r@   r   r   r   rx   rx      sp       ))(33K* )(11J* +*511J* .-h77M* ,+F33K* -,W55L* W%%E* -,];;K* %$\22J* )(77M* &%l33K*' ' ' '
# # # # #GC G G$ G G G G G Gr   rx   N)typingr   r   r   r   r   r   r)   r   r   r    r+   r,   r*   r.   rJ   rP   rX   r_   rf   rq   rt   rx   r   r   r   <module>r      s  & !                             :      12K    iu        IU        Ye      K+/S>9K9)j/ / / / / / / /3 3 3 3 3 3 3 3*. . . . . . . . . . . . . . . .". . . . . . . . % % % % %1 % % %% % % % %2 % % %% % % % %1 % % %BG BG BG BG BG BG BG BG BG BGr   