| 
									
										
										
										
											2002-02-06 07:55:08 +00:00
										 |  |  | /*************************************************************************
 | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *  $RCSfile: TableWindowAccess.cxx,v $ | 
					
						
							|  |  |  |  * | 
					
						
							| 
									
										
										
										
											2004-09-08 15:31:25 +00:00
										 |  |  |  *  $Revision: 1.9 $ | 
					
						
							| 
									
										
										
										
											2002-02-06 07:55:08 +00:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2004-09-08 15:31:25 +00:00
										 |  |  |  *  last change: $Author: rt $ $Date: 2004-09-08 16:31:25 $ | 
					
						
							| 
									
										
										
										
											2002-02-06 07:55:08 +00:00
										 |  |  |  * | 
					
						
							|  |  |  |  *  The Contents of this file are made available subject to the terms of | 
					
						
							|  |  |  |  *  either of the following licenses | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *         - GNU Lesser General Public License Version 2.1 | 
					
						
							|  |  |  |  *         - Sun Industry Standards Source License Version 1.1 | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *  Sun Microsystems Inc., October, 2000 | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *  GNU Lesser General Public License Version 2.1 | 
					
						
							|  |  |  |  *  ============================================= | 
					
						
							|  |  |  |  *  Copyright 2000 by Sun Microsystems, Inc. | 
					
						
							|  |  |  |  *  901 San Antonio Road, Palo Alto, CA 94303, USA | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *  This library is free software; you can redistribute it and/or | 
					
						
							|  |  |  |  *  modify it under the terms of the GNU Lesser General Public | 
					
						
							|  |  |  |  *  License version 2.1, as published by the Free Software Foundation. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *  This library is distributed in the hope that it will be useful, | 
					
						
							|  |  |  |  *  but WITHOUT ANY WARRANTY; without even the implied warranty of | 
					
						
							|  |  |  |  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU | 
					
						
							|  |  |  |  *  Lesser General Public License for more details. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *  You should have received a copy of the GNU Lesser General Public | 
					
						
							|  |  |  |  *  License along with this library; if not, write to the Free Software | 
					
						
							|  |  |  |  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, | 
					
						
							|  |  |  |  *  MA  02111-1307  USA | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *  Sun Industry Standards Source License Version 1.1 | 
					
						
							|  |  |  |  *  ================================================= | 
					
						
							|  |  |  |  *  The contents of this file are subject to the Sun Industry Standards | 
					
						
							|  |  |  |  *  Source License Version 1.1 (the License); You may not use this file | 
					
						
							|  |  |  |  *  except in compliance with the License. You may obtain a copy of the | 
					
						
							|  |  |  |  *  License at http://www.openoffice.org/license.html.
 | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *  Software provided under this License is provided on an AS IS basis, | 
					
						
							|  |  |  |  *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, | 
					
						
							|  |  |  |  *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, | 
					
						
							|  |  |  |  *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. | 
					
						
							|  |  |  |  *  See the License for the specific provisions governing your rights and | 
					
						
							|  |  |  |  *  obligations concerning the Software. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *  The Initial Developer of the Original Code is: Sun Microsystems, Inc. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *  Copyright: 2000 by Sun Microsystems, Inc. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *  All Rights Reserved. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *  Contributor(s): _______________________________________ | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  ************************************************************************/ | 
					
						
							|  |  |  | #ifndef DBACCESS_TABLEWINDOWACCESS_HXX
 | 
					
						
							|  |  |  | #include "TableWindowAccess.hxx"
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | #ifndef DBACCESS_JACCESS_HXX
 | 
					
						
							|  |  |  | #include "JAccess.hxx"
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | #ifndef DBAUI_TABLEWINDOW_HXX
 | 
					
						
							|  |  |  | #include "TableWindow.hxx"
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | #ifndef DBAUI_TABLEWINDOWLISTBOX_HXX
 | 
					
						
							|  |  |  | #include "TableWindowListBox.hxx"
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | #ifndef DBAUI_JOINDESIGNVIEW_HXX
 | 
					
						
							|  |  |  | #include "JoinDesignView.hxx"
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | #ifndef DBAUI_JOINCONTROLLER_HXX
 | 
					
						
							|  |  |  | #include "JoinController.hxx"
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | #ifndef DBAUI_JOINTABLEVIEW_HXX
 | 
					
						
							|  |  |  | #include "JoinTableView.hxx"
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2003-04-24 16:22:58 +00:00
										 |  |  | #ifndef _COM_SUN_STAR_ACCESSIBILITY_ACCESSIBLEROLE_HPP_
 | 
					
						
							|  |  |  | #include <com/sun/star/accessibility/AccessibleRole.hpp>
 | 
					
						
							| 
									
										
										
										
											2002-02-06 07:55:08 +00:00
										 |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2003-04-24 16:22:58 +00:00
										 |  |  | #ifndef _COM_SUN_STAR_ACCESSIBILITY_ACCESSIBLERELATIONTYPE_HPP_
 | 
					
						
							|  |  |  | #include <com/sun/star/accessibility/AccessibleRelationType.hpp>
 | 
					
						
							| 
									
										
										
										
											2002-02-06 07:55:08 +00:00
										 |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2003-06-25 10:05:09 +00:00
										 |  |  | #ifndef _COM_SUN_STAR_ACCESSIBILITY_ACCESSIBLESTATETYPE_HPP_
 | 
					
						
							|  |  |  | #include <com/sun/star/accessibility/AccessibleStateType.hpp>
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | #ifndef _COM_SUN_STAR_ACCESSIBILITY_ACCESSIBLEEVENTID_HPP_
 | 
					
						
							|  |  |  | #include <com/sun/star/accessibility/AccessibleEventId.hpp>
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2002-02-06 07:55:08 +00:00
										 |  |  | #ifndef _COMPHELPER_SEQUENCE_HXX_
 | 
					
						
							|  |  |  | #include <comphelper/sequence.hxx>
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2002-11-26 06:46:13 +00:00
										 |  |  | #ifndef _DBU_QRY_HRC_
 | 
					
						
							|  |  |  | #include "dbu_qry.hrc"
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2002-02-06 07:55:08 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace dbaui | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2003-04-24 16:22:58 +00:00
										 |  |  |     using namespace ::com::sun::star::accessibility; | 
					
						
							| 
									
										
										
										
											2002-02-06 07:55:08 +00:00
										 |  |  |     using namespace ::com::sun::star::uno; | 
					
						
							|  |  |  |     using namespace ::com::sun::star::beans; | 
					
						
							|  |  |  |     using namespace ::com::sun::star::lang; | 
					
						
							|  |  |  |     //  using namespace ::com::sun::star::awt;
 | 
					
						
							|  |  |  |     using namespace ::com::sun::star; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2003-06-25 10:05:09 +00:00
										 |  |  |     OTableWindowAccess::OTableWindowAccess(OTableWindow* _pTable) | 
					
						
							|  |  |  |         :VCLXAccessibleComponent(_pTable->GetComponentInterface().is() ? _pTable->GetWindowPeer() : NULL) | 
					
						
							| 
									
										
										
										
											2002-02-06 07:55:08 +00:00
										 |  |  |         ,m_pTable(_pTable) | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     // -----------------------------------------------------------------------------
 | 
					
						
							|  |  |  |     void SAL_CALL OTableWindowAccess::disposing() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         m_pTable = NULL; | 
					
						
							| 
									
										
										
										
											2003-06-25 10:05:09 +00:00
										 |  |  |         VCLXAccessibleComponent::disposing(); | 
					
						
							| 
									
										
										
										
											2002-02-06 07:55:08 +00:00
										 |  |  |     } | 
					
						
							|  |  |  |     // -----------------------------------------------------------------------------
 | 
					
						
							|  |  |  |     Any SAL_CALL OTableWindowAccess::queryInterface( const Type& aType ) throw (RuntimeException) | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2003-06-25 10:05:09 +00:00
										 |  |  |         Any aRet(VCLXAccessibleComponent::queryInterface( aType )); | 
					
						
							| 
									
										
										
										
											2002-02-06 07:55:08 +00:00
										 |  |  |         return aRet.hasValue() ? aRet : OTableWindowAccess_BASE::queryInterface( aType ); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     // -----------------------------------------------------------------------------
 | 
					
						
							|  |  |  |     Sequence< Type > SAL_CALL OTableWindowAccess::getTypes(  ) throw (RuntimeException) | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2003-06-25 10:05:09 +00:00
										 |  |  |         return ::comphelper::concatSequences(VCLXAccessibleComponent::getTypes(),OTableWindowAccess_BASE::getTypes()); | 
					
						
							| 
									
										
										
										
											2002-02-06 07:55:08 +00:00
										 |  |  |     } | 
					
						
							|  |  |  |     // -----------------------------------------------------------------------------
 | 
					
						
							|  |  |  |     ::rtl::OUString SAL_CALL OTableWindowAccess::getImplementationName() throw(RuntimeException) | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         return getImplementationName_Static(); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     // -----------------------------------------------------------------------------
 | 
					
						
							|  |  |  |     Sequence< ::rtl::OUString > SAL_CALL OTableWindowAccess::getSupportedServiceNames() throw(RuntimeException) | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         return getSupportedServiceNames_Static(); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     // -----------------------------------------------------------------------------
 | 
					
						
							|  |  |  |     // XServiceInfo - static methods
 | 
					
						
							|  |  |  |     Sequence< ::rtl::OUString > OTableWindowAccess::getSupportedServiceNames_Static(void) throw( RuntimeException ) | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         Sequence< ::rtl::OUString > aSupported(2); | 
					
						
							| 
									
										
										
										
											2003-04-24 16:22:58 +00:00
										 |  |  |         aSupported[0] = ::rtl::OUString::createFromAscii("com.sun.star.accessibility.Accessible"); | 
					
						
							|  |  |  |         aSupported[1] = ::rtl::OUString::createFromAscii("com.sun.star.accessibility.AccessibleContext"); | 
					
						
							| 
									
										
										
										
											2002-02-06 07:55:08 +00:00
										 |  |  |         return aSupported; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     // -----------------------------------------------------------------------------
 | 
					
						
							|  |  |  |     ::rtl::OUString OTableWindowAccess::getImplementationName_Static(void) throw( RuntimeException ) | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2002-09-13 07:55:00 +00:00
										 |  |  |         return ::rtl::OUString::createFromAscii("org.openoffice.comp.dbu.TableWindowAccessibility"); | 
					
						
							| 
									
										
										
										
											2002-02-06 07:55:08 +00:00
										 |  |  |     } | 
					
						
							|  |  |  |     // -----------------------------------------------------------------------------
 | 
					
						
							|  |  |  |     // XAccessibleContext
 | 
					
						
							|  |  |  |     sal_Int32 SAL_CALL OTableWindowAccess::getAccessibleChildCount(  ) throw (RuntimeException) | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2002-11-26 11:45:47 +00:00
										 |  |  |         return 2; | 
					
						
							| 
									
										
										
										
											2002-02-06 07:55:08 +00:00
										 |  |  |     } | 
					
						
							|  |  |  |     // -----------------------------------------------------------------------------
 | 
					
						
							| 
									
										
										
										
											2002-11-26 06:46:13 +00:00
										 |  |  |     Reference< XAccessible > SAL_CALL OTableWindowAccess::getAccessibleChild( sal_Int32 i ) throw (IndexOutOfBoundsException,RuntimeException) | 
					
						
							| 
									
										
										
										
											2002-02-06 07:55:08 +00:00
										 |  |  |     { | 
					
						
							|  |  |  |         ::osl::MutexGuard aGuard( m_aMutex  ); | 
					
						
							|  |  |  |         Reference< XAccessible > aRet; | 
					
						
							|  |  |  |         if(i == 0 && m_pTable) | 
					
						
							| 
									
										
										
										
											2002-11-26 11:45:47 +00:00
										 |  |  |             aRet = m_pTable->GetTitleCtrl()->GetAccessible(); | 
					
						
							|  |  |  |         else if(i == 1 && m_pTable) | 
					
						
							| 
									
										
										
										
											2002-02-06 07:55:08 +00:00
										 |  |  |             aRet = m_pTable->GetListBox()->GetAccessible(); | 
					
						
							| 
									
										
										
										
											2002-11-26 06:46:13 +00:00
										 |  |  |         else | 
					
						
							|  |  |  |             throw IndexOutOfBoundsException(); | 
					
						
							| 
									
										
										
										
											2002-02-06 07:55:08 +00:00
										 |  |  |         return aRet; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     // -----------------------------------------------------------------------------
 | 
					
						
							|  |  |  |     sal_Int32 SAL_CALL OTableWindowAccess::getAccessibleIndexInParent(  ) throw (RuntimeException) | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         ::osl::MutexGuard aGuard( m_aMutex  ); | 
					
						
							|  |  |  |         sal_Int32 nIndex = -1; | 
					
						
							|  |  |  |         if( m_pTable ) | 
					
						
							|  |  |  |         { | 
					
						
							|  |  |  |             // search the postion of our table window in the table window map
 | 
					
						
							|  |  |  |             OJoinTableView::OTableWindowMap* pMap = m_pTable->getTableView()->GetTabWinMap(); | 
					
						
							|  |  |  |             OJoinTableView::OTableWindowMap::iterator aIter = pMap->begin(); | 
					
						
							|  |  |  |             for (nIndex = 0; aIter != pMap->end() && aIter->second != m_pTable; ++nIndex,++aIter) | 
					
						
							|  |  |  |                 ; | 
					
						
							|  |  |  |             nIndex = aIter != pMap->end() ? nIndex : -1; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         return nIndex; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     // -----------------------------------------------------------------------------
 | 
					
						
							|  |  |  |     sal_Int16 SAL_CALL OTableWindowAccess::getAccessibleRole(  ) throw (RuntimeException) | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2002-02-11 11:51:03 +00:00
										 |  |  |         return AccessibleRole::PANEL; // ? or may be an AccessibleRole::WINDOW
 | 
					
						
							| 
									
										
										
										
											2002-02-06 07:55:08 +00:00
										 |  |  |     } | 
					
						
							|  |  |  |     // -----------------------------------------------------------------------------
 | 
					
						
							|  |  |  |     Reference< XAccessibleRelationSet > SAL_CALL OTableWindowAccess::getAccessibleRelationSet(  ) throw (RuntimeException) | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         ::osl::MutexGuard aGuard( m_aMutex  ); | 
					
						
							|  |  |  |         return this; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     // -----------------------------------------------------------------------------
 | 
					
						
							|  |  |  |     // XAccessibleComponent
 | 
					
						
							| 
									
										
										
										
											2003-04-24 16:22:58 +00:00
										 |  |  |     Reference< XAccessible > SAL_CALL OTableWindowAccess::getAccessibleAtPoint( const awt::Point& _aPoint ) throw (RuntimeException) | 
					
						
							| 
									
										
										
										
											2002-02-06 07:55:08 +00:00
										 |  |  |     { | 
					
						
							|  |  |  |         ::osl::MutexGuard aGuard( m_aMutex  ); | 
					
						
							|  |  |  |         Reference< XAccessible > aRet; | 
					
						
							|  |  |  |         if( m_pTable ) | 
					
						
							|  |  |  |         { | 
					
						
							|  |  |  |             Point aPoint(_aPoint.X,_aPoint.Y); | 
					
						
							|  |  |  |             Rectangle aRect(m_pTable->GetDesktopRectPixel()); | 
					
						
							|  |  |  |             if( aRect.IsInside(aPoint) ) | 
					
						
							|  |  |  |                 aRet = this; | 
					
						
							|  |  |  |             else if( m_pTable->GetListBox()->GetDesktopRectPixel().IsInside(aPoint)) | 
					
						
							|  |  |  |                 aRet = m_pTable->GetListBox()->GetAccessible(); | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         return aRet; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     // -----------------------------------------------------------------------------
 | 
					
						
							| 
									
										
										
										
											2003-06-25 10:05:09 +00:00
										 |  |  |     Reference< XAccessible > OTableWindowAccess::getParentChild(sal_Int32 _nIndex) | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         Reference< XAccessible > xReturn; | 
					
						
							|  |  |  |         Reference< XAccessible > xParent = getAccessibleParent(); | 
					
						
							|  |  |  |         if ( xParent.is() ) | 
					
						
							|  |  |  |         { | 
					
						
							|  |  |  |             Reference< XAccessibleContext > xParentContext = xParent->getAccessibleContext(); | 
					
						
							|  |  |  |             if ( xParentContext.is() ) | 
					
						
							|  |  |  |             { | 
					
						
							|  |  |  |                 xReturn = xParentContext->getAccessibleChild(_nIndex); | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         return xReturn; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     // -----------------------------------------------------------------------------
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2002-02-06 07:55:08 +00:00
										 |  |  |     sal_Int32 SAL_CALL OTableWindowAccess::getRelationCount(  ) throw (RuntimeException) | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         ::osl::MutexGuard aGuard( m_aMutex  ); | 
					
						
							|  |  |  |         return m_pTable ? m_pTable->getTableView()->getConnectionCount(m_pTable) : sal_Int32(0); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     // -----------------------------------------------------------------------------
 | 
					
						
							|  |  |  |     AccessibleRelation SAL_CALL OTableWindowAccess::getRelation( sal_Int32 nIndex ) throw (IndexOutOfBoundsException, RuntimeException) | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         ::osl::MutexGuard aGuard( m_aMutex  ); | 
					
						
							|  |  |  |         if( nIndex < 0 || nIndex >= getRelationCount() ) | 
					
						
							|  |  |  |             throw IndexOutOfBoundsException(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         AccessibleRelation aRet; | 
					
						
							|  |  |  |         if( m_pTable ) | 
					
						
							|  |  |  |         { | 
					
						
							| 
									
										
										
										
											2002-02-08 08:10:00 +00:00
										 |  |  |             OJoinTableView* pView = m_pTable->getTableView(); | 
					
						
							|  |  |  |             ::std::vector<OTableConnection*>::const_iterator aIter = pView->getTableConnections(m_pTable) + nIndex; | 
					
						
							| 
									
										
										
										
											2002-02-06 07:55:08 +00:00
										 |  |  |             aRet.TargetSet.realloc(1); | 
					
						
							| 
									
										
										
										
											2003-06-25 10:05:09 +00:00
										 |  |  |             aRet.TargetSet[0] = getParentChild(aIter - pView->getTableConnections()->begin()); | 
					
						
							| 
									
										
										
										
											2002-02-06 07:55:08 +00:00
										 |  |  |             aRet.RelationType = AccessibleRelationType::CONTROLLER_FOR; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         return aRet; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     // -----------------------------------------------------------------------------
 | 
					
						
							|  |  |  |     sal_Bool SAL_CALL OTableWindowAccess::containsRelation( sal_Int16 aRelationType ) throw (RuntimeException) | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         ::osl::MutexGuard aGuard( m_aMutex  ); | 
					
						
							|  |  |  |         return      AccessibleRelationType::CONTROLLER_FOR == aRelationType | 
					
						
							|  |  |  |                 &&  m_pTable->getTableView()->ExistsAConn(m_pTable); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     // -----------------------------------------------------------------------------
 | 
					
						
							|  |  |  |     AccessibleRelation SAL_CALL OTableWindowAccess::getRelationByType( sal_Int16 aRelationType ) throw (RuntimeException) | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         ::osl::MutexGuard aGuard( m_aMutex  ); | 
					
						
							|  |  |  |         if( AccessibleRelationType::CONTROLLER_FOR == aRelationType && m_pTable) | 
					
						
							|  |  |  |         { | 
					
						
							| 
									
										
										
										
											2002-02-08 08:10:00 +00:00
										 |  |  |             OJoinTableView* pView = m_pTable->getTableView(); | 
					
						
							|  |  |  |             const ::std::vector<OTableConnection*>* pConnectionList = pView->getTableConnections(); | 
					
						
							| 
									
										
										
										
											2002-02-06 07:55:08 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2002-02-08 08:10:00 +00:00
										 |  |  |             ::std::vector<OTableConnection*>::const_iterator aIter = pView->getTableConnections(m_pTable); | 
					
						
							| 
									
										
										
										
											2002-02-06 07:55:08 +00:00
										 |  |  |             ::std::vector< Reference<XInterface> > aRelations; | 
					
						
							|  |  |  |             aRelations.reserve(5); // just guessing
 | 
					
						
							|  |  |  |             for (; aIter != pConnectionList->end() ; ++aIter ) | 
					
						
							| 
									
										
										
										
											2003-06-25 10:05:09 +00:00
										 |  |  |                 aRelations.push_back(getParentChild(aIter - pConnectionList->begin())); | 
					
						
							| 
									
										
										
										
											2002-02-06 07:55:08 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-08 15:31:25 +00:00
										 |  |  |             Reference<XInterface> *pRelations = aRelations.empty() ? 0 : &aRelations[0]; | 
					
						
							|  |  |  |             Sequence< Reference<XInterface> > aSeq(pRelations, aRelations.size()); | 
					
						
							| 
									
										
										
										
											2002-02-06 07:55:08 +00:00
										 |  |  |             return AccessibleRelation(AccessibleRelationType::CONTROLLER_FOR,aSeq); | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         return AccessibleRelation(); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     // -----------------------------------------------------------------------------
 | 
					
						
							|  |  |  |     sal_Bool OTableWindowAccess::isEditable() const | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2002-02-08 08:10:00 +00:00
										 |  |  |         return m_pTable && !m_pTable->getTableView()->getDesignView()->getController()->isReadOnly(); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     // -----------------------------------------------------------------------------
 | 
					
						
							|  |  |  |     ::rtl::OUString SAL_CALL OTableWindowAccess::getTitledBorderText(  ) throw (RuntimeException) | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         return getAccessibleName(  ); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     // -----------------------------------------------------------------------------
 | 
					
						
							|  |  |  |     ::rtl::OUString SAL_CALL OTableWindowAccess::getAccessibleName(  ) throw (RuntimeException) | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         ::osl::MutexGuard aGuard( m_aMutex  ); | 
					
						
							|  |  |  |         ::rtl::OUString sAccessibleName; | 
					
						
							|  |  |  |         if ( m_pTable ) | 
					
						
							|  |  |  |             sAccessibleName = m_pTable->getTitle(); | 
					
						
							|  |  |  |         return sAccessibleName; | 
					
						
							| 
									
										
										
										
											2002-02-06 07:55:08 +00:00
										 |  |  |     } | 
					
						
							|  |  |  |     // -----------------------------------------------------------------------------
 | 
					
						
							| 
									
										
										
										
											2003-06-25 10:05:09 +00:00
										 |  |  |     Reference< XAccessibleContext > SAL_CALL OTableWindowAccess::getAccessibleContext(  ) throw (::com::sun::star::uno::RuntimeException) | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         return this; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     // -----------------------------------------------------------------------------
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2002-02-06 07:55:08 +00:00
										 |  |  | } | 
					
						
							|  |  |  | // -----------------------------------------------------------------------------
 | 
					
						
							|  |  |  | 
 |