1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef DBACCESS_CONNECTIONLINEACCESS_HXX
28 #define DBACCESS_CONNECTIONLINEACCESS_HXX
29 
30 #ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLERELATIONSET_HPP_
31 #include <com/sun/star/accessibility/XAccessibleRelationSet.hpp>
32 #endif
33 #ifndef _CPPUHELPER_IMPLBASE2_HXX_
34 #include <cppuhelper/implbase2.hxx>
35 #endif
36 #ifndef _TOOLKIT_AWT_VCLXACCESSIBLECOMPONENT_HXX_
37 #include <toolkit/awt/vclxaccessiblecomponent.hxx>
38 #endif
39 
40 namespace dbaui
41 {
42 	typedef ::cppu::ImplHelper2< ::com::sun::star::accessibility::XAccessibleRelationSet,
43 								 ::com::sun::star::accessibility::XAccessible
44 											> OConnectionLineAccess_BASE;
45 	class OTableConnection;
46 	/** the class OConnectionLineAccess represents the accessible object for the connection between two table windows
47 		like they are used in the QueryDesign and the RelationDesign
48 	*/
49 	class OConnectionLineAccess		:	public VCLXAccessibleComponent
50 									,	public OConnectionLineAccess_BASE
51 	{
52 		const OTableConnection*				m_pLine; // the window which I should give accessibility to
53 	protected:
54 		/** this function is called upon disposing the component
55 		*/
56 		virtual void SAL_CALL disposing();
57 
58 		/** isEditable returns the current editable state
59 			@return	true if it is editable otherwise false
60 		*/
61 		virtual sal_Bool isEditable() const;
62 	public:
63 		OConnectionLineAccess(OTableConnection* _pLine);
64 
65 		// XInterface
66 		virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
67 		virtual void SAL_CALL acquire(  ) throw ()
68 		{ // here inline is allowed because we do not use this class outside this dll
69 			VCLXAccessibleComponent::acquire(  );
70 		}
71 		virtual void SAL_CALL release(  ) throw ()
72 		{ // here inline is allowed because we do not use this class outside this dll
73 			VCLXAccessibleComponent::release(  );
74 		}
75 
76 		// XTypeProvider
77 		virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes(  ) throw (::com::sun::star::uno::RuntimeException);
78 
79 		// XServiceInfo - static methods
80 		static ::rtl::OUString getImplementationName_Static(void) throw( com::sun::star::uno::RuntimeException );
81 		// XServiceInfo
82 		virtual ::rtl::OUString SAL_CALL getImplementationName() throw(com::sun::star::uno::RuntimeException);
83 
84 		// XAccessible
85 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext(  ) throw (::com::sun::star::uno::RuntimeException);
86 
87 		// XAccessibleContext
88 		virtual sal_Int32 SAL_CALL getAccessibleChildCount(  ) throw (::com::sun::star::uno::RuntimeException);
89 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (::com::sun::star::uno::RuntimeException);
90 		virtual sal_Int32 SAL_CALL getAccessibleIndexInParent(  ) throw (::com::sun::star::uno::RuntimeException);
91 		virtual sal_Int16 SAL_CALL getAccessibleRole(  ) throw (::com::sun::star::uno::RuntimeException);
92 		virtual ::rtl::OUString SAL_CALL getAccessibleDescription(  ) throw (::com::sun::star::uno::RuntimeException);
93 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet(  ) throw (::com::sun::star::uno::RuntimeException);
94 
95 		// XAccessibleComponent
96 		virtual sal_Bool SAL_CALL contains( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException);
97 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException);
98 		virtual ::com::sun::star::awt::Rectangle SAL_CALL getBounds(  ) throw (::com::sun::star::uno::RuntimeException);
99 		virtual ::com::sun::star::awt::Point SAL_CALL getLocation(  ) throw (::com::sun::star::uno::RuntimeException);
100 		virtual ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen(  ) throw (::com::sun::star::uno::RuntimeException);
101 		virtual ::com::sun::star::awt::Size SAL_CALL getSize(  ) throw (::com::sun::star::uno::RuntimeException);
102 		virtual sal_Bool SAL_CALL isShowing(  ) throw (::com::sun::star::uno::RuntimeException);
103 		virtual sal_Bool SAL_CALL isVisible(  ) throw (::com::sun::star::uno::RuntimeException);
104 		virtual sal_Bool SAL_CALL isFocusTraversable(  ) throw (::com::sun::star::uno::RuntimeException);
105 
106 		// XAccessibleRelationSet
107 		virtual sal_Int32 SAL_CALL getRelationCount(  ) throw (::com::sun::star::uno::RuntimeException);
108 		virtual ::com::sun::star::accessibility::AccessibleRelation SAL_CALL getRelation( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
109 		virtual sal_Bool SAL_CALL containsRelation( sal_Int16 aRelationType ) throw (::com::sun::star::uno::RuntimeException);
110 		virtual ::com::sun::star::accessibility::AccessibleRelation SAL_CALL getRelationByType( sal_Int16 aRelationType ) throw (::com::sun::star::uno::RuntimeException);
111 	};
112 }
113 #endif // DBACCESS_CONNECTIONLINEACCESS_HXX
114