3
õW÷Yd  ã               @   s6   d dl mZ d dlT d dlT dgZG dd„ deƒZdS )é    )ÚAtspi)Ú*ÚDocumentc               @   s8   e Zd ZdZdd„ Zdd„ Zdd„ Zdd	„ Zd
d„ ZdS )r   aÌ  
        Primarily a 'tagging' interface which indicates the start of
        document content in the Accessibility hierarchy. Accessible objects
        below the node implementing Document are normally assumed to
        be part of the document content. Attributes of Document are those
        attributes associated with the document as a whole. Objects that
        implement Document are normally expected to implement Collection
        as well.
        c             C   s   t jj| j|ƒS )aÙ  
                Gets the value of a single attribute, if specified for the document
                as a whole.
                @param : attributename
                a string indicating the name of a specific attribute (name-value
                pair) being queried.
                @return a string corresponding to the value of the specified
                attribute, or an empty string if the attribute is unspecified
                for the object.
                )r   r   Zget_document_attribute_valueÚobj)ÚselfÚkey© r   ú2/usr/lib/python3/dist-packages/pyatspi/document.pyÚgetAttributeValue%   s    zDocument.getAttributeValuec             C   s    t jj| jƒ}dd„ |jƒ D ƒS )a[  
                Gets all attributes specified for a document as a whole. For
                attributes which change within the document content, see Accessibility::Text::getAttributes
                instead.
                @return an AttributeSet containing the attributes of the document,
                as name-value pairs.
                c             S   s   g | ]\}}|d  | ‘qS )ú:r   )Ú.0r   Úvaluer   r   r	   ú
<listcomp>;   s    z*Document.getAttributes.<locals>.<listcomp>)r   r   Zget_document_attributesr   Úitems)r   Zretr   r   r	   ÚgetAttributes2   s    zDocument.getAttributesc             C   s   t jj| jƒS )zþ
                Gets the locale associated with the document's content. e.g.
                the locale for LOCALE_TYPE_MESSAGES.
                @return a string compliant with the POSIX standard for locale
                description.
                )r   r   Z
get_localer   )r   r   r   r	   Ú	getLocale=   s    zDocument.getLocalec             C   s   t jj| jƒS )zÄ
                Gets the current page number associated with the document.
                @return a integer with the current page number. -1 if error
                or unknown.
                )r   r   Zget_current_page_numberr   )r   r   r   r	   ÚgetCurrentPageNumberF   s    zDocument.getCurrentPageNumberc             C   s   t jj| jƒS )zµ
                Gets the page count of the document.
                @return a integer with the page count of the document.
                -1 if error or unknown.
                )r   r   Zget_page_countr   )r   r   r   r	   ÚgetPageCountN   s    zDocument.getPageCountN)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r
   r   r   r   r   r   r   r   r	   r      s   		N)Zgi.repositoryr   Zpyatspi.utilsZpyatspi.interfaceÚ__all__Z	interfacer   r   r   r   r	   Ú<module>   s   