3
WY=                 @   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)*Tablec               @   s@  e Zd Z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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$d% Zd&d' Zd(d) Zd*d+ Zd,Zeeed-Zd.d/ Zd0Zeeed-Zd1d2 Zd3Z eee d-Z!d4d5 Z"d6Z#ee"e#d-Z$d7d8 Z%d9Z&ee%e&d-Z'd:d; Z(d<Z)ee(e)d-Z*d=S )>r   ah  
        An interface used by containers whose contained data is arranged
        in a "tabular" (i.e. row-column) fashion. Tables may resemble
        a two-dimensional grid, as in a spreadsheet, or may feature objects
        which span multiple rows and/or columns, but whose bounds are
        aligned on a row/column matrix. Thus, the Table interface may
        be used to represent "spreadsheets" as well as "frames".
        Objects within tables are children of the Table instance, and
        they may be referenced either via a child index or via a row/column
        pair. Their role may be ROLE_TABLE_CELL, but table 'cells' may
        have other roles as well. These 'cells' may implement other interfaces,
        such as Text, Action, Image, and Component, and should do so
        as appropriate to their onscreen representation and/or behavior.
        c             C   s   t jj| j|S )a2  
                Select the specified column, adding it to the current column
                selection, if the table's selection model permits it.
                @param : column
                @return True if the specified column was successfully selected,
                False if not.
                )r   r   Zadd_column_selectionobj)selfcolumn r   //usr/lib/python3/dist-packages/pyatspi/table.pyaddColumnSelection*   s    zTable.addColumnSelectionc             C   s   t jj| j|S )a&  
                Select the specified row, adding it to the current row selection,
                if the table's selection model permits it.
                @param : row
                @return True if the specified row was successfully selected,
                False if not.
                )r   r   Zadd_row_selectionr   )r   rowr   r   r	   addRowSelection4   s    zTable.addRowSelectionc             C   s   t jj| j||S )aq  
                Get the table cell at the specified row and column indices. 
                @param : row
                the specified table row, zero-indexed. 
                @param : column
                the specified table column, zero-indexed.
                @return an Accessible object representing the specified table
                cell.
                )r   r   Zget_accessible_atr   )r   r   r   r   r   r	   getAccessibleAt>   s    
zTable.getAccessibleAtc             C   s   t jj| j|S )ay  
                Get the table column index occupied by the child at a particular
                1-D child index.
                @param : index
                the specified child index, zero-indexed.
                @return a long integer indicating the first column spanned by
                the child of a table, at the specified 1-D (zero-offset) index.
                )r   r   Zget_column_at_indexr   )r   indexr   r   r	   getColumnAtIndexJ   s    	zTable.getColumnAtIndexc             C   s   t jj| j|S )a|  
                Get a text description of a particular table column. This differs
                from AccessibleTable_getColumnHeader, which returns an Accessible.
                @param : column
                the specified table column, zero-indexed.
                @return a UTF-8 string describing the specified table column,
                if available.
                )r   r   Zget_column_descriptionr   )r   r   r   r   r	   getColumnDescriptionU   s    	zTable.getColumnDescriptionc             C   s   t jj| j||S )a  
                Get the number of columns spanned by the table cell at the specific
                row and column. (some tables can have cells which span multiple
                rows and/or columns).
                @param : row
                the specified table row, zero-indexed. 
                @param : column
                the specified table column, zero-indexed.
                @return a long integer indicating the number of columns spanned
                by the specified cell.
                )r   r   Zget_column_extent_atr   )r   r   r   r   r   r	   getColumnExtentAt`   s    zTable.getColumnExtentAtc             C   s   t jj| j|S )a  
                Get the header associated with a table column, if available,
                as an instance of Accessible. This differs from getColumnDescription,
                which returns a string.
                @param : column
                the specified table column, zero-indexed.
                @return an Accessible representatin of the specified table column,
                if available.
                )r   r   Zget_column_headerr   )r   r   r   r   r	   getColumnHeadern   s    
zTable.getColumnHeaderc             C   s   t jj| j||S )a  
                Get the 1-D child index corresponding to the specified 2-D row
                and column indices. 
                @param : row
                the specified table row, zero-indexed. 
                @param : column
                the specified table column, zero-indexed.
                @return a long integer which serves as the index of a specified
                cell in the table, in a form usable by Accessible::getChildAtIndex.
                )r   r   Zget_index_atr   )r   r   r   r   r   r	   
getIndexAtz   s    zTable.getIndexAtc             C   s   t jj| j|S )as  
                Get the table row index occupied by the child at a particular
                1-D child index.
                @param : index
                the specified child index, zero-indexed.
                @return a long integer indicating the first row spanned by the
                child of a table, at the specified 1-D (zero-offset) index.
                )r   r   Zget_row_at_indexr   )r   r   r   r   r	   getRowAtIndex   s    	zTable.getRowAtIndexc             C   s   t jj| j|S )a  
                Given a child index, determine the row and column indices and
                extents, and whether the cell is currently selected. If the child
                at index is not a cell (for instance, if it is a summary, caption,
                etc.), False is returned.
                @param : index
                the index of the Table child whose row/column extents are requested.
                @param : row
                back-filled with the first table row associated with the cell
                with child index index. 
                @param : col
                back-filled with the first table column associated with the cell
                with child index index. 
                @param : row_extents
                back-filled with the number of table rows across which child
                i extends. 
                @param : col_extents
                back-filled with the number of table columns across which child
                i extends. 
                @param : is_selected
                a boolean which is back-filled with True if the child at index
                i corresponds to a selected table cell, False otherwise.
                Example: If the Table child at index '6' extends across columns
                5 and 6 of row 2 of a Table instance, and is currently selected,
                then retval=table::getRowColumnExtentsAtIndex(6,row,col,
                row_extents,
                col_extents,
                is_selected);
                 will return True, and after the call row, col, row_extents,
                col_extents, and is_selected will contain 2, 5, 1, 2, and True,
                respectively.
                @return True if the index is associated with a valid table cell,
                False if the index does not correspond to a cell. If False is
                returned, the values of the out parameters are undefined.
                )r   r   Zget_row_column_extents_at_indexr   )r   r   r   r   r	   getRowColumnExtentsAtIndex   s    $z Table.getRowColumnExtentsAtIndexc             C   s   t jj| j|S )am  
                Get a text description of a particular table row. This differs
                from AccessibleTable_getRowHeader, which returns an Accessible.
                @param : row
                the specified table row, zero-indexed.
                @return a UTF-8 string describing the specified table row, if
                available.
                )r   r   Zget_row_descriptionr   )r   r   r   r   r	   getRowDescription   s    	zTable.getRowDescriptionc             C   s   t jj| j||S )a  
                Get the number of rows spanned by the table cell at the specific
                row and column. (some tables can have cells which span multiple
                rows and/or columns).
                @param : row
                the specified table row, zero-indexed. 
                @param : column
                the specified table column, zero-indexed.
                @return a long integer indicating the number of rows spanned
                by the specified cell.
                )r   r   Zget_row_extent_atr   )r   r   r   r   r   r	   getRowExtentAt   s    zTable.getRowExtentAtc             C   s   t jj| j|S )aj  
                Get the header associated with a table row, if available. This
                differs from getRowDescription, which returns a string.
                @param : row
                the specified table row, zero-indexed.
                @return an Accessible representatin of the specified table row,
                if available.
                )r   r   Zget_row_headerr   )r   r   r   r   r	   getRowHeader   s    	zTable.getRowHeaderc             C   s   t jj| jS )z
                Obtain the indices of all columns which are currently selected.
                @return a sequence of integers comprising the indices of columns
                currently selected.
                )r   r   Zget_selected_columnsr   )r   r   r   r	   getSelectedColumns   s    zTable.getSelectedColumnsc             C   s   t jj| jS )z
                Obtain the indices of all rows which are currently selected.
                @return a sequence of integers comprising the indices of rows
                currently selected.
                )r   r   Zget_selected_rowsr   )r   r   r   r	   getSelectedRows   s    zTable.getSelectedRowsc             C   s   t jj| j|S )a  
                Determine whether a table column is selected. 
                @param : column
                the column being queried.
                @return True if the specified column is currently selected, False
                if not.
                )r   r   Zis_column_selectedr   )r   r   r   r   r	   isColumnSelected   s    zTable.isColumnSelectedc             C   s   t jj| j|S )z
                Determine whether a table row is selected. 
                @param : row
                the row being queried.
                @return True if the specified row is currently selected, False
                if not.
                )r   r   Zis_row_selectedr   )r   r   r   r   r	   isRowSelected   s    zTable.isRowSelectedc             C   s   t jj| j||S )a  
                Determine whether the cell at a specific row and column is selected.
                @param : row
                a row occupied by the cell whose state is being queried. 
                @param : column
                a column occupied by the cell whose state is being queried.
                @return True if the specified cell is currently selected, False
                if not.
                )r   r   Zis_selectedr   )r   r   r   r   r   r	   
isSelected   s    
zTable.isSelectedc             C   s   t jj| j|S )a(  
                Remove the specified column from current column selection, if
                the table's selection model permits it.
                @param : column
                @return True if the specified column was successfully de-selected,
                False if not.
                )r   r   Zremove_column_selectionr   )r   r   r   r   r	   removeColumnSelection  s    zTable.removeColumnSelectionc             C   s   t jj| j|S )a  
                Remove the specified row from current row selection, if the table's
                selection model permits it.
                @param : row
                @return True if the specified row was successfully de-selected,
                False if not.
                )r   r   Zremove_row_selectionr   )r   r   r   r   r	   removeRowSelection  s    zTable.removeRowSelectionc             C   s   t jj| jS )N)r   r   get_captionr   )r   r   r   r	   r       s    zTable.get_captionzZ
                An Accessible which represents of a caption for a Table.
                )fgetdocc             C   s   t jj| jS )N)r   r   Zget_n_columnsr   )r   r   r   r	   get_nColumns(  s    zTable.get_nColumnsa&  
                The total number of columns in this table (including empty columns),
                exclusive of columns which are programmatically hidden. Columns
                which are scrolled out of view or clipped by the current viewport
                are included.
                c             C   s   t jj| jS )N)r   r   Z
get_n_rowsr   )r   r   r   r	   	get_nRows3  s    zTable.get_nRowsz
                The total number of rows in this table (including empty rows),
                exclusive of any rows which are programmatically hidden. Rows
                which are merely scrolled out of view are included.
                c             C   s   t jj| jS )N)r   r   Zget_n_selected_columnsr   )r   r   r   r	   get_nSelectedColumns=  s    zTable.get_nSelectedColumnsz
                The number of columns currently selected. A selected column is
                one in which all included cells are selected.
                c             C   s   t jj| jS )N)r   r   Zget_n_selected_rowsr   )r   r   r   r	   get_nSelectedRowsF  s    zTable.get_nSelectedRowsz
                The number of rows currently selected. A selected row is one
                in which all included cells are selected.
                c             C   s   t jj| jS )N)r   r   get_summaryr   )r   r   r   r	   r'   O  s    zTable.get_summaryz
                An accessible object which summarizes the contents of a Table.
                This object is frequently itself a Table instance, albeit a simplified
                one.
                N)+__name__
__module____qualname____doc__r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    Z_captionDocpropertyZcaptionr#   Z_nColumnsDocZnColumnsr$   Z	_nRowsDocZnRowsr%   Z_nSelectedColumnsDocZnSelectedColumnsr&   Z_nSelectedRowsDocZnSelectedRowsr'   Z_summaryDocZsummaryr   r   r   r	   r      sN   

&



N)Zgi.repositoryr   Zpyatspi.utilsZpyatspi.interface__all__Z	interfacer   r   r   r   r	   <module>   s   