LCOV - code coverage report
Current view: top level - vcl/unx/gtk/a11y - atktable.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 218 0.0 %
Date: 2012-08-25 Functions: 0 35 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5                 :            :  *
       6                 :            :  * Copyright 2000, 2010 Oracle and/or its affiliates.
       7                 :            :  *
       8                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       9                 :            :  *
      10                 :            :  * This file is part of OpenOffice.org.
      11                 :            :  *
      12                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      14                 :            :  * only, as published by the Free Software Foundation.
      15                 :            :  *
      16                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      17                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      18                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19                 :            :  * GNU Lesser General Public License version 3 for more details
      20                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU Lesser General Public License
      23                 :            :  * version 3 along with OpenOffice.org.  If not, see
      24                 :            :  * <http://www.openoffice.org/license.html>
      25                 :            :  * for a copy of the LGPLv3 License.
      26                 :            :  *
      27                 :            :  ************************************************************************/
      28                 :            : 
      29                 :            : 
      30                 :            : #include "atkwrapper.hxx"
      31                 :            : 
      32                 :            : #include <com/sun/star/accessibility/XAccessibleTable.hpp>
      33                 :            : 
      34                 :            : #ifdef ENABLE_TRACING
      35                 :            : #include <stdio.h>
      36                 :            : #endif
      37                 :            : 
      38                 :            : using namespace ::com::sun::star;
      39                 :            : 
      40                 :            : static inline AtkObject *
      41                 :          0 : atk_object_wrapper_conditional_ref( const uno::Reference< accessibility::XAccessible >& rxAccessible )
      42                 :            : {
      43                 :            : #ifdef ENABLE_TRACING
      44                 :            :     fprintf( stderr, ": %p\n", rxAccessible.get() );
      45                 :            : #endif
      46                 :            : 
      47                 :          0 :     if( rxAccessible.is() )
      48                 :          0 :         return atk_object_wrapper_ref( rxAccessible );
      49                 :            : 
      50                 :          0 :     return NULL;
      51                 :            : }
      52                 :            : 
      53                 :            : /*****************************************************************************/
      54                 :            : 
      55                 :            : // FIXME
      56                 :            : static G_CONST_RETURN gchar *
      57                 :          0 : getAsConst( rtl::OUString rString )
      58                 :            : {
      59                 :            :     static const int nMax = 10;
      60                 :          0 :     static rtl::OString aUgly[nMax];
      61                 :            :     static int nIdx = 0;
      62                 :          0 :     nIdx = (nIdx + 1) % nMax;
      63                 :          0 :     aUgly[nIdx] = rtl::OUStringToOString( rString, RTL_TEXTENCODING_UTF8 );
      64                 :          0 :     return aUgly[ nIdx ].getStr();
      65                 :            : }
      66                 :            : 
      67                 :            : /*****************************************************************************/
      68                 :            : 
      69                 :            : static accessibility::XAccessibleTable*
      70                 :          0 :     getTable( AtkTable *pTable ) throw (uno::RuntimeException)
      71                 :            : {
      72                 :          0 :     AtkObjectWrapper *pWrap = ATK_OBJECT_WRAPPER( pTable );
      73                 :          0 :     if( pWrap )
      74                 :            :     {
      75                 :          0 :         if( !pWrap->mpTable && pWrap->mpContext )
      76                 :            :         {
      77                 :          0 :             uno::Any any = pWrap->mpContext->queryInterface( accessibility::XAccessibleTable::static_type(NULL) );
      78                 :          0 :             pWrap->mpTable = reinterpret_cast< accessibility::XAccessibleTable * > (any.pReserved);
      79                 :          0 :             pWrap->mpTable->acquire();
      80                 :            :         }
      81                 :            : 
      82                 :          0 :         return pWrap->mpTable;
      83                 :            :     }
      84                 :            : 
      85                 :          0 :     return NULL;
      86                 :            : }
      87                 :            : 
      88                 :            : /*****************************************************************************/
      89                 :            : 
      90                 :            : extern "C" {
      91                 :            : 
      92                 :            : static AtkObject*
      93                 :          0 : table_wrapper_ref_at (AtkTable *table,
      94                 :            :                       gint      row,
      95                 :            :                       gint      column)
      96                 :            : {
      97                 :            :     try {
      98                 :          0 :         accessibility::XAccessibleTable* pTable = getTable( table );
      99                 :            : 
     100                 :            : #ifdef ENABLE_TRACING
     101                 :            :         if( pTable )
     102                 :            :             fprintf(stderr, "getAccessibleCellAt( %u, %u ) returns", row, column );
     103                 :            : 
     104                 :            :         if( column >= 255 )
     105                 :            :             fprintf(stderr, "getAccessibleCellAt( %u, %u ) returns", row, column );
     106                 :            : 
     107                 :            : #endif
     108                 :            : 
     109                 :          0 :         if( pTable )
     110                 :          0 :             return atk_object_wrapper_conditional_ref( pTable->getAccessibleCellAt( row, column ) );
     111                 :            :     }
     112                 :            : 
     113                 :          0 :     catch(const uno::Exception& e) {
     114                 :          0 :         g_warning( "Exception in getAccessibleCellAt()" );
     115                 :            :     }
     116                 :            : 
     117                 :          0 :     return NULL;
     118                 :            : }
     119                 :            : 
     120                 :            : /*****************************************************************************/
     121                 :            : 
     122                 :            : static gint
     123                 :          0 : table_wrapper_get_index_at (AtkTable      *table,
     124                 :            :                             gint          row,
     125                 :            :                             gint          column)
     126                 :            : {
     127                 :            :     try {
     128                 :          0 :         accessibility::XAccessibleTable* pTable = getTable( table );
     129                 :            : 
     130                 :            : #ifdef ENABLE_TRACING
     131                 :            :         if( pTable )
     132                 :            :             fprintf(stderr, "getAccessibleIndex( %u, %u ) returns %u\n",
     133                 :            :                 row, column, pTable->getAccessibleIndex( row, column ) );
     134                 :            : #endif
     135                 :            : 
     136                 :          0 :         if( pTable )
     137                 :          0 :             return pTable->getAccessibleIndex( row, column );
     138                 :            :     }
     139                 :          0 :     catch(const uno::Exception& e) {
     140                 :          0 :         g_warning( "Exception in getAccessibleIndex()" );
     141                 :            :     }
     142                 :            : 
     143                 :          0 :     return -1;
     144                 :            : }
     145                 :            : 
     146                 :            : /*****************************************************************************/
     147                 :            : 
     148                 :            : static gint
     149                 :          0 : table_wrapper_get_column_at_index (AtkTable      *table,
     150                 :            :                                    gint          nIndex)
     151                 :            : {
     152                 :            :     try {
     153                 :          0 :         accessibility::XAccessibleTable* pTable = getTable( table );
     154                 :            : 
     155                 :            : #ifdef ENABLE_TRACING
     156                 :            :         if( pTable )
     157                 :            :             fprintf(stderr, "getAccessibleColumn( %u ) returns %u\n",
     158                 :            :                 nIndex, pTable->getAccessibleColumn( nIndex ) );
     159                 :            : #endif
     160                 :            : 
     161                 :          0 :         if( pTable )
     162                 :          0 :             return pTable->getAccessibleColumn( nIndex );
     163                 :            :     }
     164                 :          0 :     catch(const uno::Exception& e) {
     165                 :          0 :         g_warning( "Exception in getAccessibleColumn()" );
     166                 :            :     }
     167                 :            : 
     168                 :          0 :     return -1;
     169                 :            : }
     170                 :            : 
     171                 :            : /*****************************************************************************/
     172                 :            : 
     173                 :            : static gint
     174                 :          0 : table_wrapper_get_row_at_index( AtkTable *table,
     175                 :            :                                 gint      nIndex )
     176                 :            : {
     177                 :            :     try {
     178                 :          0 :         accessibility::XAccessibleTable* pTable = getTable( table );
     179                 :            : 
     180                 :            : #ifdef ENABLE_TRACING
     181                 :            :         if( pTable )
     182                 :            :             fprintf(stderr, "getAccessibleRow( %u ) returns %u\n",
     183                 :            :                 nIndex, pTable->getAccessibleRow( nIndex ) );
     184                 :            : #endif
     185                 :            : 
     186                 :          0 :         if( pTable )
     187                 :          0 :             return pTable->getAccessibleRow( nIndex );
     188                 :            :     }
     189                 :          0 :     catch(const uno::Exception& e) {
     190                 :          0 :         g_warning( "Exception in getAccessibleRow()" );
     191                 :            :     }
     192                 :            : 
     193                 :          0 :     return -1;
     194                 :            : }
     195                 :            : 
     196                 :            : /*****************************************************************************/
     197                 :            : 
     198                 :            : static gint
     199                 :          0 : table_wrapper_get_n_columns( AtkTable *table )
     200                 :            : {
     201                 :            :     try {
     202                 :          0 :         accessibility::XAccessibleTable* pTable = getTable( table );
     203                 :            : 
     204                 :            : #ifdef ENABLE_TRACING
     205                 :            :         if( pTable )
     206                 :            :             fprintf(stderr, "XAccessibleTable::getAccessibleColumnCount returns %u\n",
     207                 :            :                 pTable->getAccessibleColumnCount() );
     208                 :            : #endif
     209                 :            : 
     210                 :          0 :         if( pTable )
     211                 :          0 :             return pTable->getAccessibleColumnCount();
     212                 :            :     }
     213                 :          0 :     catch(const uno::Exception& e) {
     214                 :          0 :         g_warning( "Exception in getAccessibleColumnCount()" );
     215                 :            :     }
     216                 :            : 
     217                 :          0 :     return -1;
     218                 :            : }
     219                 :            : 
     220                 :            : /*****************************************************************************/
     221                 :            : 
     222                 :            : static gint
     223                 :          0 : table_wrapper_get_n_rows( AtkTable *table )
     224                 :            : {
     225                 :            :     try {
     226                 :          0 :         accessibility::XAccessibleTable* pTable = getTable( table );
     227                 :            : 
     228                 :            : #ifdef ENABLE_TRACING
     229                 :            :         if( pTable )
     230                 :            :             fprintf(stderr, "getAccessibleRowCount() returns %u\n",
     231                 :            :                 pTable->getAccessibleRowCount() );
     232                 :            : #endif
     233                 :            : 
     234                 :          0 :         if( pTable )
     235                 :          0 :             return pTable->getAccessibleRowCount();
     236                 :            :     }
     237                 :          0 :     catch(const uno::Exception& e) {
     238                 :          0 :         g_warning( "Exception in getAccessibleRowCount()" );
     239                 :            :     }
     240                 :            : 
     241                 :          0 :     return -1;
     242                 :            : }
     243                 :            : 
     244                 :            : /*****************************************************************************/
     245                 :            : 
     246                 :            : static gint
     247                 :          0 : table_wrapper_get_column_extent_at( AtkTable *table,
     248                 :            :                                     gint      row,
     249                 :            :                                     gint      column )
     250                 :            : {
     251                 :            :     try {
     252                 :          0 :         accessibility::XAccessibleTable* pTable = getTable( table );
     253                 :            : 
     254                 :            : #ifdef ENABLE_TRACING
     255                 :            :         if( pTable )
     256                 :            :             fprintf(stderr, "getAccessibleColumnExtentAt( %u, %u ) returns %u\n",
     257                 :            :                 row, column, pTable->getAccessibleColumnExtentAt( row, column ) );
     258                 :            : #endif
     259                 :            : 
     260                 :          0 :         if( pTable )
     261                 :          0 :             return pTable->getAccessibleColumnExtentAt( row, column );
     262                 :            :     }
     263                 :          0 :     catch(const uno::Exception& e) {
     264                 :          0 :         g_warning( "Exception in getAccessibleColumnExtentAt()" );
     265                 :            :     }
     266                 :            : 
     267                 :          0 :     return -1;
     268                 :            : }
     269                 :            : 
     270                 :            : /*****************************************************************************/
     271                 :            : 
     272                 :            : static gint
     273                 :          0 : table_wrapper_get_row_extent_at( AtkTable *table,
     274                 :            :                                  gint      row,
     275                 :            :                                  gint      column )
     276                 :            : {
     277                 :            :     try {
     278                 :          0 :         accessibility::XAccessibleTable* pTable = getTable( table );
     279                 :            : 
     280                 :            : #ifdef ENABLE_TRACING
     281                 :            :         if( pTable )
     282                 :            :             fprintf(stderr, "getAccessibleRowExtentAt( %u, %u ) returns %u\n",
     283                 :            :                 row, column, pTable->getAccessibleRowExtentAt( row, column ) );
     284                 :            : #endif
     285                 :            : 
     286                 :          0 :         if( pTable )
     287                 :          0 :             return pTable->getAccessibleRowExtentAt( row, column );
     288                 :            :     }
     289                 :          0 :     catch(const uno::Exception& e) {
     290                 :          0 :         g_warning( "Exception in getAccessibleRowExtentAt()" );
     291                 :            :     }
     292                 :            : 
     293                 :          0 :     return -1;
     294                 :            : }
     295                 :            : 
     296                 :            : /*****************************************************************************/
     297                 :            : 
     298                 :            : static AtkObject *
     299                 :          0 : table_wrapper_get_caption( AtkTable *table )
     300                 :            : {
     301                 :            :     try {
     302                 :          0 :         accessibility::XAccessibleTable* pTable = getTable( table );
     303                 :            : 
     304                 :            : #ifdef ENABLE_TRACING
     305                 :            :         if( pTable )
     306                 :            :             fprintf(stderr, "getAccessibleCaption() returns" );
     307                 :            : #endif
     308                 :            : 
     309                 :          0 :         if( pTable )
     310                 :          0 :             return atk_object_wrapper_conditional_ref( pTable->getAccessibleCaption() );
     311                 :            :     }
     312                 :            : 
     313                 :          0 :     catch(const uno::Exception& e) {
     314                 :          0 :         g_warning( "Exception in getAccessibleCaption()" );
     315                 :            :     }
     316                 :            : 
     317                 :          0 :     return NULL;
     318                 :            : }
     319                 :            : 
     320                 :            : /*****************************************************************************/
     321                 :            : 
     322                 :            : static G_CONST_RETURN gchar *
     323                 :          0 : table_wrapper_get_row_description( AtkTable *table,
     324                 :            :                                    gint      row )
     325                 :            : {
     326                 :            :     try {
     327                 :          0 :         accessibility::XAccessibleTable* pTable = getTable( table );
     328                 :            : 
     329                 :            : #ifdef ENABLE_TRACING
     330                 :            :         if( pTable )
     331                 :            :             fprintf(stderr, "getAccessibleRowDescription( %u ) returns %s\n",
     332                 :            :                 row, getAsConst( pTable->getAccessibleRowDescription( row ) ) );
     333                 :            : #endif
     334                 :            : 
     335                 :          0 :         if( pTable )
     336                 :          0 :             return getAsConst( pTable->getAccessibleRowDescription( row ) );
     337                 :            :     }
     338                 :          0 :     catch(const uno::Exception& e) {
     339                 :          0 :         g_warning( "Exception in getAccessibleRowDescription()" );
     340                 :            :     }
     341                 :            : 
     342                 :          0 :     return NULL;
     343                 :            : }
     344                 :            : 
     345                 :            : /*****************************************************************************/
     346                 :            : 
     347                 :            : static G_CONST_RETURN gchar *
     348                 :          0 : table_wrapper_get_column_description( AtkTable *table,
     349                 :            :                                       gint      column )
     350                 :            : {
     351                 :            :     try {
     352                 :          0 :         accessibility::XAccessibleTable* pTable = getTable( table );
     353                 :            : 
     354                 :            : #ifdef ENABLE_TRACING
     355                 :            :         if( pTable )
     356                 :            :             fprintf(stderr, "getAccessibleColumnDescription( %u ) returns %s\n",
     357                 :            :                 column, getAsConst( pTable->getAccessibleColumnDescription( column ) ) );
     358                 :            : #endif
     359                 :            : 
     360                 :          0 :         if( pTable )
     361                 :          0 :             return getAsConst( pTable->getAccessibleColumnDescription( column ) );
     362                 :            :     }
     363                 :          0 :     catch(const uno::Exception& e) {
     364                 :          0 :         g_warning( "Exception in getAccessibleColumnDescription()" );
     365                 :            :     }
     366                 :            : 
     367                 :          0 :     return NULL;
     368                 :            : }
     369                 :            : 
     370                 :            : /*****************************************************************************/
     371                 :            : 
     372                 :            : static AtkObject *
     373                 :          0 : table_wrapper_get_row_header( AtkTable *table,
     374                 :            :                               gint      row )
     375                 :            : {
     376                 :            :     try {
     377                 :          0 :         accessibility::XAccessibleTable* pTable = getTable( table );
     378                 :          0 :         if( pTable )
     379                 :            :         {
     380                 :          0 :             uno::Reference< accessibility::XAccessibleTable > xRowHeaders( pTable->getAccessibleRowHeaders() );
     381                 :            : 
     382                 :            : #ifdef ENABLE_TRACING
     383                 :            :             if( xRowHeaders.is() )
     384                 :            :                 fprintf(stderr, "getAccessibleRowHeader( %u )->getAccessibleCellAt( 0, %u ) returns",
     385                 :            :                     row, row );
     386                 :            :             else
     387                 :            :                 fprintf(stderr, "getAccessibleRowHeader( %u ) returns %p\n", row, xRowHeaders.get() );
     388                 :            : #endif
     389                 :            : 
     390                 :          0 :             if( xRowHeaders.is() )
     391                 :          0 :                 return atk_object_wrapper_conditional_ref( xRowHeaders->getAccessibleCellAt( row, 0 ) );
     392                 :            :         }
     393                 :            :     }
     394                 :          0 :     catch(const uno::Exception& e) {
     395                 :          0 :         g_warning( "Exception in getAccessibleRowHeaders()" );
     396                 :            :     }
     397                 :            : 
     398                 :          0 :     return NULL;
     399                 :            : }
     400                 :            : 
     401                 :            : /*****************************************************************************/
     402                 :            : 
     403                 :            : static AtkObject *
     404                 :          0 : table_wrapper_get_column_header( AtkTable *table,
     405                 :            :                                  gint      column )
     406                 :            : {
     407                 :            :     try {
     408                 :          0 :         accessibility::XAccessibleTable* pTable = getTable( table );
     409                 :            : 
     410                 :          0 :         if( pTable )
     411                 :            :         {
     412                 :          0 :             uno::Reference< accessibility::XAccessibleTable > xColumnHeaders( pTable->getAccessibleColumnHeaders() );
     413                 :            : 
     414                 :            : #ifdef ENABLE_TRACING
     415                 :            :             if( xColumnHeaders.is() )
     416                 :            :                 fprintf(stderr, "getAccessibleColumnHeader( %u )->getAccessibleCellAt( 0, %u ) returns",
     417                 :            :                     column, column );
     418                 :            :             else
     419                 :            :                 fprintf(stderr, "getAccessibleColumnHeader( %u ) returns %p\n", column, xColumnHeaders.get() );
     420                 :            : #endif
     421                 :            : 
     422                 :          0 :             if( xColumnHeaders.is() )
     423                 :          0 :                 return atk_object_wrapper_conditional_ref( xColumnHeaders->getAccessibleCellAt( 0, column ) );
     424                 :            :         }
     425                 :            :     }
     426                 :          0 :     catch(const uno::Exception& e) {
     427                 :          0 :         g_warning( "Exception in getAccessibleColumnHeaders()" );
     428                 :            :     }
     429                 :            : 
     430                 :          0 :     return NULL;
     431                 :            : }
     432                 :            : 
     433                 :            : /*****************************************************************************/
     434                 :            : 
     435                 :            : static AtkObject *
     436                 :          0 : table_wrapper_get_summary( AtkTable *table )
     437                 :            : {
     438                 :            :     try {
     439                 :          0 :         accessibility::XAccessibleTable* pTable = getTable( table );
     440                 :            : 
     441                 :            : #ifdef ENABLE_TRACING
     442                 :            :         if( pTable )
     443                 :            :             fprintf(stderr, "getAccessibleSummary() returns" );
     444                 :            : #endif
     445                 :            : 
     446                 :          0 :         if( pTable )
     447                 :            :         {
     448                 :          0 :             return atk_object_wrapper_conditional_ref( pTable->getAccessibleSummary() );
     449                 :            :         }
     450                 :            :     }
     451                 :          0 :     catch(const uno::Exception& e) {
     452                 :          0 :         g_warning( "Exception in getAccessibleSummary()" );
     453                 :            :     }
     454                 :            : 
     455                 :          0 :     return NULL;
     456                 :            : }
     457                 :            : 
     458                 :            : /*****************************************************************************/
     459                 :            : 
     460                 :            : static gint
     461                 :          0 : convertToGIntArray( const uno::Sequence< ::sal_Int32 >& aSequence, gint **pSelected )
     462                 :            : {
     463                 :          0 :     if( aSequence.getLength() )
     464                 :            :     {
     465                 :          0 :         *pSelected = g_new( gint, aSequence.getLength() );
     466                 :            : 
     467                 :          0 :         for( sal_Int32 i = 0; i < aSequence.getLength(); i++ )
     468                 :          0 :             (*pSelected) [i] = aSequence[i];
     469                 :            :     }
     470                 :            : 
     471                 :          0 :     return aSequence.getLength();
     472                 :            : }
     473                 :            : 
     474                 :            : /*****************************************************************************/
     475                 :            : 
     476                 :            : static gint
     477                 :          0 : table_wrapper_get_selected_columns( AtkTable      *table,
     478                 :            :                                     gint          **pSelected )
     479                 :            : {
     480                 :          0 :     *pSelected = NULL;
     481                 :            :     try {
     482                 :          0 :         accessibility::XAccessibleTable* pTable = getTable( table );
     483                 :            : 
     484                 :            : #ifdef ENABLE_TRACING
     485                 :            :         if( pTable )
     486                 :            :             fprintf(stderr, "getSelectedAccessibleColumns() \n" );
     487                 :            : #endif
     488                 :            : 
     489                 :          0 :         if( pTable )
     490                 :          0 :             return convertToGIntArray( pTable->getSelectedAccessibleColumns(), pSelected );
     491                 :            :     }
     492                 :          0 :     catch(const uno::Exception& e) {
     493                 :          0 :         g_warning( "Exception in getSelectedAccessibleColumns()" );
     494                 :            :     }
     495                 :            : 
     496                 :          0 :     return 0;
     497                 :            : }
     498                 :            : 
     499                 :            : /*****************************************************************************/
     500                 :            : 
     501                 :            : static gint
     502                 :          0 : table_wrapper_get_selected_rows( AtkTable      *table,
     503                 :            :                                  gint          **pSelected )
     504                 :            : {
     505                 :          0 :     *pSelected = NULL;
     506                 :            :     try {
     507                 :          0 :         accessibility::XAccessibleTable* pTable = getTable( table );
     508                 :            : 
     509                 :            : #ifdef ENABLE_TRACING
     510                 :            :         if( pTable )
     511                 :            :             fprintf(stderr, "getSelectedAccessibleRows() \n" );
     512                 :            : #endif
     513                 :            : 
     514                 :          0 :         if( pTable )
     515                 :          0 :             return convertToGIntArray( pTable->getSelectedAccessibleRows(), pSelected );
     516                 :            :     }
     517                 :          0 :     catch(const uno::Exception& e) {
     518                 :          0 :         g_warning( "Exception in getSelectedAccessibleRows()" );
     519                 :            :     }
     520                 :            : 
     521                 :          0 :     return 0;
     522                 :            : }
     523                 :            : 
     524                 :            : /*****************************************************************************/
     525                 :            : 
     526                 :            : static gboolean
     527                 :          0 : table_wrapper_is_column_selected( AtkTable      *table,
     528                 :            :                                   gint          column )
     529                 :            : {
     530                 :            :     try {
     531                 :          0 :         accessibility::XAccessibleTable* pTable = getTable( table );
     532                 :            : 
     533                 :            : #ifdef ENABLE_TRACING
     534                 :            :         if( pTable )
     535                 :            :             fprintf(stderr, "isAccessibleColumnSelected( %u ) returns %s\n",
     536                 :            :                 column, pTable->isAccessibleColumnSelected( column ) ? "true" : "false" );
     537                 :            : #endif
     538                 :            : 
     539                 :          0 :         if( pTable )
     540                 :          0 :             return pTable->isAccessibleColumnSelected( column );
     541                 :            :     }
     542                 :          0 :     catch(const uno::Exception& e) {
     543                 :          0 :         g_warning( "Exception in isAccessibleColumnSelected()" );
     544                 :            :     }
     545                 :            : 
     546                 :          0 :     return 0;
     547                 :            : }
     548                 :            : 
     549                 :            : /*****************************************************************************/
     550                 :            : 
     551                 :            : static gboolean
     552                 :          0 : table_wrapper_is_row_selected( AtkTable      *table,
     553                 :            :                                gint          row )
     554                 :            : {
     555                 :            :     try {
     556                 :          0 :         accessibility::XAccessibleTable* pTable = getTable( table );
     557                 :            : 
     558                 :            : #ifdef ENABLE_TRACING
     559                 :            :         if( pTable )
     560                 :            :             fprintf(stderr, "isAccessibleRowSelected( %u ) returns %s\n",
     561                 :            :                 row, pTable->isAccessibleRowSelected( row ) ? "true" : "false" );
     562                 :            : #endif
     563                 :            : 
     564                 :          0 :         if( pTable )
     565                 :          0 :             return pTable->isAccessibleRowSelected( row );
     566                 :            :     }
     567                 :          0 :     catch(const uno::Exception& e) {
     568                 :          0 :         g_warning( "Exception in isAccessibleRowSelected()" );
     569                 :            :     }
     570                 :            : 
     571                 :          0 :     return FALSE;
     572                 :            : }
     573                 :            : 
     574                 :            : /*****************************************************************************/
     575                 :            : 
     576                 :            : static gboolean
     577                 :          0 : table_wrapper_is_selected( AtkTable      *table,
     578                 :            :                            gint          row,
     579                 :            :                            gint          column )
     580                 :            : {
     581                 :            :     try {
     582                 :          0 :         accessibility::XAccessibleTable* pTable = getTable( table );
     583                 :            : 
     584                 :            : #ifdef ENABLE_TRACING
     585                 :            :         if( pTable )
     586                 :            :             fprintf(stderr, "isAccessibleSelected( %u, %u ) returns %s\n",
     587                 :            :                 row, column, pTable->isAccessibleSelected( row , column ) ? "true" : "false" );
     588                 :            : #endif
     589                 :            : 
     590                 :          0 :         if( pTable )
     591                 :          0 :             return pTable->isAccessibleSelected( row, column );
     592                 :            :     }
     593                 :          0 :     catch(const uno::Exception& e) {
     594                 :          0 :         g_warning( "Exception in isAccessibleSelected()" );
     595                 :            :     }
     596                 :            : 
     597                 :          0 :     return FALSE;
     598                 :            : }
     599                 :            : 
     600                 :            : /*****************************************************************************/
     601                 :            : 
     602                 :            : static gboolean
     603                 :          0 : table_wrapper_add_row_selection( AtkTable *, gint )
     604                 :            : {
     605                 :          0 :     g_warning( "FIXME: no simple analogue for add_row_selection" );
     606                 :          0 :     return 0;
     607                 :            : }
     608                 :            : 
     609                 :            : /*****************************************************************************/
     610                 :            : 
     611                 :            : static gboolean
     612                 :          0 : table_wrapper_remove_row_selection( AtkTable *, gint )
     613                 :            : {
     614                 :          0 :     g_warning( "FIXME: no simple analogue for remove_row_selection" );
     615                 :          0 :     return 0;
     616                 :            : }
     617                 :            : 
     618                 :            : /*****************************************************************************/
     619                 :            : 
     620                 :            : static gboolean
     621                 :          0 : table_wrapper_add_column_selection( AtkTable *, gint )
     622                 :            : {
     623                 :          0 :     g_warning( "FIXME: no simple analogue for add_column_selection" );
     624                 :          0 :     return 0;
     625                 :            : }
     626                 :            : 
     627                 :            : /*****************************************************************************/
     628                 :            : 
     629                 :            : static gboolean
     630                 :          0 : table_wrapper_remove_column_selection( AtkTable *, gint )
     631                 :            : {
     632                 :          0 :     g_warning( "FIXME: no simple analogue for remove_column_selection" );
     633                 :          0 :     return 0;
     634                 :            : }
     635                 :            : 
     636                 :            : /*****************************************************************************/
     637                 :            : 
     638                 :            : static void
     639                 :          0 : table_wrapper_set_caption( AtkTable *, AtkObject * )
     640                 :            : { // meaningless helper
     641                 :          0 : }
     642                 :            : 
     643                 :            : /*****************************************************************************/
     644                 :            : 
     645                 :            : static void
     646                 :          0 : table_wrapper_set_column_description( AtkTable *, gint, const gchar * )
     647                 :            : { // meaningless helper
     648                 :          0 : }
     649                 :            : 
     650                 :            : 
     651                 :            : /*****************************************************************************/
     652                 :            : 
     653                 :            : static void
     654                 :          0 : table_wrapper_set_column_header( AtkTable *, gint, AtkObject * )
     655                 :            : { // meaningless helper
     656                 :          0 : }
     657                 :            : 
     658                 :            : 
     659                 :            : /*****************************************************************************/
     660                 :            : 
     661                 :            : static void
     662                 :          0 : table_wrapper_set_row_description( AtkTable *, gint, const gchar * )
     663                 :            : { // meaningless helper
     664                 :          0 : }
     665                 :            : 
     666                 :            : /*****************************************************************************/
     667                 :            : 
     668                 :            : static void
     669                 :          0 : table_wrapper_set_row_header( AtkTable *, gint, AtkObject * )
     670                 :            : { // meaningless helper
     671                 :          0 : }
     672                 :            : 
     673                 :            : /*****************************************************************************/
     674                 :            : 
     675                 :            : static void
     676                 :          0 : table_wrapper_set_summary( AtkTable *, AtkObject * )
     677                 :            : { // meaningless helper
     678                 :          0 : }
     679                 :            : 
     680                 :            : /*****************************************************************************/
     681                 :            : 
     682                 :            : } // extern "C"
     683                 :            : 
     684                 :            : void
     685                 :          0 : tableIfaceInit (AtkTableIface *iface)
     686                 :            : {
     687                 :          0 :   g_return_if_fail (iface != NULL);
     688                 :            : 
     689                 :          0 :   iface->ref_at = table_wrapper_ref_at;
     690                 :          0 :   iface->get_n_rows = table_wrapper_get_n_rows;
     691                 :          0 :   iface->get_n_columns = table_wrapper_get_n_columns;
     692                 :          0 :   iface->get_index_at = table_wrapper_get_index_at;
     693                 :          0 :   iface->get_column_at_index = table_wrapper_get_column_at_index;
     694                 :          0 :   iface->get_row_at_index = table_wrapper_get_row_at_index;
     695                 :          0 :   iface->is_row_selected = table_wrapper_is_row_selected;
     696                 :          0 :   iface->is_selected = table_wrapper_is_selected;
     697                 :          0 :   iface->get_selected_rows = table_wrapper_get_selected_rows;
     698                 :          0 :   iface->add_row_selection = table_wrapper_add_row_selection;
     699                 :          0 :   iface->remove_row_selection = table_wrapper_remove_row_selection;
     700                 :          0 :   iface->add_column_selection = table_wrapper_add_column_selection;
     701                 :          0 :   iface->remove_column_selection = table_wrapper_remove_column_selection;
     702                 :          0 :   iface->get_selected_columns = table_wrapper_get_selected_columns;
     703                 :          0 :   iface->is_column_selected = table_wrapper_is_column_selected;
     704                 :          0 :   iface->get_column_extent_at = table_wrapper_get_column_extent_at;
     705                 :          0 :   iface->get_row_extent_at = table_wrapper_get_row_extent_at;
     706                 :          0 :   iface->get_row_header = table_wrapper_get_row_header;
     707                 :          0 :   iface->set_row_header = table_wrapper_set_row_header;
     708                 :          0 :   iface->get_column_header = table_wrapper_get_column_header;
     709                 :          0 :   iface->set_column_header = table_wrapper_set_column_header;
     710                 :          0 :   iface->get_caption = table_wrapper_get_caption;
     711                 :          0 :   iface->set_caption = table_wrapper_set_caption;
     712                 :          0 :   iface->get_summary = table_wrapper_get_summary;
     713                 :          0 :   iface->set_summary = table_wrapper_set_summary;
     714                 :          0 :   iface->get_row_description = table_wrapper_get_row_description;
     715                 :          0 :   iface->set_row_description = table_wrapper_set_row_description;
     716                 :          0 :   iface->get_column_description = table_wrapper_get_column_description;
     717                 :          0 :   iface->set_column_description = table_wrapper_set_column_description;
     718                 :            : }
     719                 :            : 
     720                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10