
    i                       S r SSKJr  SSKJrJrJr  SSKJr  SSK	J
r  SSKJr  SSKJrJr  SSKJr  SS	KJr  SS
KJr  SSKJr  SSKJr  SSKJr  \(       a  SSKJr  SSKJ r   SSK!J"r"  SSK#J$r$  SSK%J&r&   " S S\5      r'g)z+|DocumentPart| and closely related objects.    )annotations)IOTYPE_CHECKINGcast)Document)RELATIONSHIP_TYPE)CommentsPart)
FooterPart
HeaderPart)NumberingPart)SettingsPart)	StoryPart)
StylesPart)InlineShapes)lazyproperty)Comments)WD_STYLE_TYPE)CoreProperties)Settings)	BaseStylec                     \ rS rSrSrS rS r\SS j5       r\SS j5       r	\S 5       r
SS jrSS	 jrSS
 jrS rSS jr\S 5       r\SS j5       rSS jr\SS j5       r\S 5       r\SS j5       r\S S j5       r\S!S j5       rSrg)"DocumentPart   a}  Main document part of a WordprocessingML (WML) package, aka a .docx file.

Acts as broker to other parts such as image, core properties, and style parts. It
also acts as a convenient delegate when a mid-document object needs a service
involving a remote ancestor. The `Parented.part` property inherited by many content
objects provides access to this part object for that purpose.
c                    [         R                  " U R                  5      nU R                  U[        R
                  5      nX4$ )z=Return (footer_part, rId) pair for newly-created footer part.)r
   newpackage	relate_toRTFOOTER)selffooter_partrIds      S/var/www/html/banglarbhumi/venv/lib/python3.13/site-packages/docx/parts/document.pyadd_footer_partDocumentPart.add_footer_part#   1     nnT\\2nn["))4    c                    [         R                  " U R                  5      nU R                  U[        R
                  5      nX4$ )z=Return (header_part, rId) pair for newly-created header part.)r   r   r   r   r   HEADER)r    header_partr"   s      r#   add_header_partDocumentPart.add_header_part)   r&   r'   c                .    U R                   R                  $ )zJ|Comments| object providing access to the comments added to this document.)_comments_partcommentsr    s    r#   r/   DocumentPart.comments/   s     ""+++r'   c                .    U R                   R                  $ )z^A |CoreProperties| object providing read/write access to the core properties
of this document.)r   core_propertiesr0   s    r#   r3   DocumentPart.core_properties4   s     ||+++r'   c                .    [        U R                  U 5      $ )zEA |Document| object providing access to the content of this document.)r   _elementr0   s    r#   documentDocumentPart.document:   s     t,,r'   c                &    U R                  U5        g)z/Remove related header part identified by `rId`.N)drop_relr    r"   s     r#   drop_header_partDocumentPart.drop_header_part?   s    cr'   c                     U R                   U   $ )z%Return |FooterPart| related by `rId`.related_partsr;   s     r#   r!   DocumentPart.footer_partC       !!#&&r'   c                8    U R                   R                  X5      $ )zReturn the style in this document matching `style_id`.

Returns the default style for `style_type` if `style_id` is |None| or does not
match a defined style of `style_type`.
)styles	get_by_id)r    style_id
style_types      r#   	get_styleDocumentPart.get_styleG   s     {{$$X::r'   c                8    U R                   R                  X5      $ )a,  Return the style_id (|str|) of the style of `style_type` matching
`style_or_name`.

Returns |None| if the style resolves to the default style for `style_type` or if
`style_or_name` is itself |None|. Raises if `style_or_name` is a style of the
wrong type or names a style not present in the document.
)rD   get_style_id)r    style_or_namerG   s      r#   rK   DocumentPart.get_style_idO   s     {{''BBr'   c                     U R                   U   $ )z%Return |HeaderPart| related by `rId`.r?   r;   s     r#   r*   DocumentPart.header_partY   rB   r'   c                B    [        U R                  R                  U 5      $ )zIThe |InlineShapes| instance containing the inline shapes in the document.)r   r6   bodyr0   s    r#   inline_shapesDocumentPart.inline_shapes]   s     DMM..55r'   c                     [        [        U R                  [        R                  5      5      $ ! [
         a:    [        R                  " 5       nU R                  U[        R                  5        Us $ f = f)zA |NumberingPart| object providing access to the numbering definitions for this document.

Creates an empty numbering part if one is not present.
)r   r   part_related_byr   	NUMBERINGKeyErrorr   r   )r    numbering_parts     r#   rX   DocumentPart.numbering_partb   sX    	"t';';BLL'IJJ 	"*..0NNN>2<<8!!	"s   ,/ AA32A3c                :    U R                   R                  U5        g)z}Save this document to `path_or_stream`, which can be either a path to a
filesystem location (a string) or a file-like object.N)r   save)r    path_or_streams     r#   r[   DocumentPart.saveo   s     	.)r'   c                .    U R                   R                  $ )z[A |Settings| object providing access to the settings in the settings part of
this document.)_settings_partsettingsr0   s    r#   r`   DocumentPart.settingst   s     ""+++r'   c                .    U R                   R                  $ )zUA |Styles| object providing access to the styles in the styles part of this
document.)_styles_partrD   r0   s    r#   rD   DocumentPart.stylesz   s       '''r'   c                     [        [        U R                  [        R                  5      5      $ ! [
         aT    U R                  c   e[        R                  " U R                  5      nU R                  U[        R                  5        Us $ f = f)zA |CommentsPart| object providing access to the comments added to this document.

Creates a default comments part if one is not present.
)	r   r	   rU   r   COMMENTSrW   r   defaultr   )r    comments_parts     r#   r.   DocumentPart._comments_part   sn    	!d&:&:2;;&GHH 	!<<+++(00>MNN="++6  		!s   ,/ ABBc                    [        [        U R                  [        R                  5      5      $ ! [
         aE    [        R                  " U R                  5      nU R                  U[        R                  5        Us $ f = f)zA |SettingsPart| object providing access to the document-level settings for
this document.

Creates a default settings part if one is not present.
)	r   r   rU   r   SETTINGSrW   rg   r   r   )r    settings_parts     r#   r_   DocumentPart._settings_part   s^    	!d&:&:2;;&GHH 	!(00>MNN="++6  	!s   ,/ AA>=A>c                    [        [        U R                  [        R                  5      5      $ ! [
         aL    U R                  nUc   e[        R                  " U5      nU R                  U[        R                  5        Us $ f = f)zaInstance of |StylesPart| for this document.

Creates an empty styles part if one is not present.
)	r   r   rU   r   STYLESrW   r   rg   r   )r    r   styles_parts      r#   rc   DocumentPart._styles_part   so    	
D$8$8$CDD 	llG&&&$,,W5KNN;		2	s   ,/ ABB N)returnr   )rs   r   )r"   strrs   None)r"   rt   )rF   z
str | NonerG   r   rs   r   )rs   r   )r\   zstr | IO[bytes])rs   r   )rs   r	   )rs   r   )rs   r   )__name__
__module____qualname____firstlineno____doc__r$   r+   propertyr/   r3   r7   r<   r!   rH   rK   r*   r   rR   rX   r[   r`   rD   r.   r_   rc   __static_attributes__rr   r'   r#   r   r      s       , , , ,
 - -';C' 6 6 
" 
"*
 , ,
 ( (
 ! ! ! !  r'   r   N)(rz   
__future__r   typingr   r   r   docx.documentr   docx.opc.constantsr   r   docx.parts.commentsr	   docx.parts.hdrftrr
   r   docx.parts.numberingr   docx.parts.settingsr   docx.parts.storyr   docx.parts.stylesr   
docx.shaper   docx.sharedr   docx.commentsr   docx.enum.styler   docx.opc.corepropsr   docx.settingsr   docx.styles.styler   r   rr   r'   r#   <module>r      sO    1 " * * " 6 , 4 . , & ( # $&-1&+O9 Or'   