File: //home/arjun/projects/env/lib/python3.10/site-packages/docx/__pycache__/section.cpython-310.pyc
o
$wefH � @ s* d Z ddlmZ ddlmZmZmZmZmZ ddl m
Z
ddlmZ ddl
mZ ddlmZmZ ddlmZ dd lmZ dd
lmZ erjddlmZmZ ddlmZ dd
lmZ ddlmZ ddl m!Z! ddlm"Z" G dd� d�Z#G dd� dee# �Z$G dd� de
�Z%G dd� de%�Z&G dd� de%�Z'dS )z/The |Section| object and related proxy classes.� )�annotations)�
TYPE_CHECKING�Iterator�List�Sequence�overload)�BlockItemContainer)�WD_HEADER_FOOTER)�CT_P)�
FooterPart�
HeaderPart)�lazyproperty)�Table)� Paragraph)�WD_ORIENTATION�WD_SECTION_START)�CT_Document)� CT_SectPr)�DocumentPart)� StoryPart)�Lengthc s� e Zd ZdZdI� fdd�ZedJd
d��ZejdKdd��ZedLdd��ZejdMdd��ZedNdd��Z edOdd��Z
edNdd��ZedOdd��Ze
dNdd��ZedJdd ��ZejdKd!d ��ZedJd"d#��ZejdKd$d#��Ze
dOd%d&��ZedJd'd(��ZejdKd)d(��ZdPd+d,�ZedJd-d.��ZejdKd/d.��ZedQd1d2��ZejdRd4d2��ZedJd5d6��ZejdSd7d6��ZedJd8d9��ZejdSd:d9��ZedTd<d=��ZedJd>d?��ZejdSd@d?��ZedUdBdC��ZejdVdEdC��ZedJdFdG��ZejdSdHdG��Z� ZS )W�Sectionz}Document section, providing access to section and page setup settings.
Also provides access to headers and footers.
�sectPrr �
document_partr c � t t| ��� || _|| _d S �N)�superr �__init__�_sectPr�_document_part)�selfr r �� __class__� �E/home/arjun/projects/env/lib/python3.10/site-packages/docx/section.pyr �
zSection.__init__�return�
Length | Nonec C � | j jS )z�Read/write. Bottom margin for pages in this section, in EMU.
`None` when no bottom margin has been specified. Assigning |None| removes any
bottom-margin setting.
�r �
bottom_margin�r r# r# r$ r* # � zSection.bottom_margin�value�int | Length | Nonec C � || j _d S r r) �r r- r# r# r$ r* , � �boolc C r( )z�True if this section displays a distinct first-page header and footer.
Read/write. The definition of the first-page header and footer are accessed
using :attr:`.first_page_header` and :attr:`.first_page_footer` respectively.
�r �titlePg_valr+ r# r# r$ �"different_first_page_header_footer0 r, z*Section.different_first_page_header_footerc C r/ r r3 r0 r# r# r$ r5 9 r1 �_Footerc C � t | j| jtj�S )z�|_Footer| object defining footer content for even pages.
The content of this footer definition is ignored unless the document setting
:attr:`~.Settings.odd_and_even_pages_header_footer` is set True.
)r6 r r r � EVEN_PAGEr+ r# r# r$ �even_page_footer= � zSection.even_page_footer�_Headerc C r7 )z�|_Header| object defining header content for even pages.
The content of this header definition is ignored unless the document setting
:attr:`~.Settings.odd_and_even_pages_header_footer` is set True.
)r; r r r r8 r+ r# r# r$ �even_page_headerF r: zSection.even_page_headerc C r7 )z�|_Footer| object defining footer content for the first page of this section.
The content of this footer definition is ignored unless the property
:attr:`.different_first_page_header_footer` is set True.
)r6 r r r �
FIRST_PAGEr+ r# r# r$ �first_page_footerO r: zSection.first_page_footerc C r7 )z�|_Header| object defining header content for the first page of this section.
The content of this header definition is ignored unless the property
:attr:`.different_first_page_header_footer` is set True.
)r; r r r r= r+ r# r# r$ �first_page_headerX r: zSection.first_page_headerc C r7 )z�|_Footer| object representing default page footer for this section.
The default footer is used for odd-numbered pages when separate odd/even footers
are enabled. It is used for both odd and even-numbered pages otherwise.
)r6 r r r �PRIMARYr+ r# r# r$ �footera r: zSection.footerc C r( )z�Distance from bottom edge of page to bottom edge of the footer.
Read/write. |None| if no setting is present in the XML.
�r rA r+ r# r# r$ �footer_distancej � zSection.footer_distancec C r/ r rB r0 r# r# r$ rC r r1 c C r( )ai |Length| object representing page gutter size in English Metric Units.
Read/write. The page gutter is extra spacing added to the `inner` margin to
ensure even margins after page binding. Generally only used in book-bound
documents with double-sided and facing pages.
This setting applies to all pages in this section.
�r �gutterr+ r# r# r$ rF v s zSection.gutterc C r/ r rE r0 r# r# r$ rF � r1 c C r7 )z�|_Header| object representing default page header for this section.
The default header is used for odd-numbered pages when separate odd/even headers
are enabled. It is used for both odd and even-numbered pages otherwise.
)r; r r r r@ r+ r# r# r$ �header� r: zSection.headerc C r( )z�Distance from top edge of page to top edge of header.
Read/write. |None| if no setting is present in the XML. Assigning |None| causes
default value to be used.
�r rG r+ r# r# r$ �header_distance� r, zSection.header_distancec C r/ r rH r0 r# r# r$ rI � r1 �Iterator[Paragraph | Table]c c s6 � | j �� D ]}t|t�rt|| �nt|| �V qdS )zlGenerate each Paragraph or Table object in this `section`.
Items appear in document order.
N)r �iter_inner_content�
isinstancer
r r )r �elementr# r# r$ rK � s ����zSection.iter_inner_contentc C r( )zk|Length| object representing the left margin for all pages in this section in
English Metric Units.�r �left_marginr+ r# r# r$ rO � � zSection.left_marginc C r/ r rN r0 r# r# r$ rO � r1 r c C r( )z�:ref:`WdOrientation` member specifying page orientation for this section.
One of ``WD_ORIENT.PORTRAIT`` or ``WD_ORIENT.LANDSCAPE``.
�r �orientationr+ r# r# r$ rR � rD zSection.orientation�WD_ORIENTATION | Nonec C r/ r rQ r0 r# r# r$ rR � r1 c C r( )a) Total page height used for this section.
This value is inclusive of all edge spacing values such as margins.
Page orientation is taken into account, so for example, its expected value
would be ``Inches(8.5)`` for letter-sized paper when orientation is landscape.
�r �page_heightr+ r# r# r$ rU � � zSection.page_heightc C r/ r rT r0 r# r# r$ rU � r1 c C r( )aA Total page width used for this section.
This value is like "paper size" and includes all edge spacing values such as
margins.
Page orientation is taken into account, so for example, its expected value
would be ``Inches(11)`` for letter-sized paper when orientation is landscape.
�r �
page_widthr+ r# r# r$ rX � s
zSection.page_widthc C r/ r rW r0 r# r# r$ rX � r1 r c C s | j S r )r r+ r# r# r$ �part� s zSection.partc C r( )zl|Length| object representing the right margin for all pages in this section
in English Metric Units.�r �right_marginr+ r# r# r$ r[ � rP zSection.right_marginc C r/ r rZ r0 r# r# r$ r[ � r1 r c C r( )z�Type of page-break (if any) inserted at the start of this section.
For exmple, ``WD_SECTION_START.ODD_PAGE`` if the section should begin on the
next odd page, possibly inserting two page-breaks instead of one.
�r �
start_typer+ r# r# r$ r] � r, zSection.start_type�WD_SECTION_START | Nonec C r/ r r\ r0 r# r# r$ r] � r1 c C r( )zj|Length| object representing the top margin for all pages in this section in
English Metric Units.�r �
top_marginr+ r# r# r$ r` � rP zSection.top_marginc C r/ r r_ r0 r# r# r$ r` � r1 )r r r r )r&