xref: /trunk/main/dbaccess/source/ui/inc/JAccess.hxx (revision cdf0e10c)
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_JACCESS_HXX
28 #define DBACCESS_JACCESS_HXX
29 
30 #ifndef _TOOLKIT_AWT_VCLXACCESSIBLECOMPONENT_HXX_
31 #include <toolkit/awt/vclxaccessiblecomponent.hxx>
32 #endif
33 #ifndef _CPPUHELPER_IMPLBASE1_HXX_
34 #include <cppuhelper/implbase1.hxx>
35 #endif
36 
37 namespace dbaui
38 {
39 	class OJoinTableView;
40 	typedef ::cppu::ImplHelper1< ::com::sun::star::accessibility::XAccessible
41 											> OJoinDesignViewAccess_BASE;
42 	/** the class OJoinDesignViewAccess represents the accessible object for join views
43 		like the QueryDesign and the RelationDesign
44 	*/
45 	class OJoinDesignViewAccess		:	public VCLXAccessibleComponent, public OJoinDesignViewAccess_BASE
46 	{
47 		OJoinTableView*	m_pTableView; // the window which I should give accessibility to
48 
49 	protected:
50 		/** isEditable returns the current editable state
51 			@return	true if the controller is not readonly otherwise false
52 		*/
53 		virtual sal_Bool isEditable() const;
54 	public:
55 		/** OJoinDesignViewAccess needs a valid view
56 		*/
57 		OJoinDesignViewAccess(	OJoinTableView* _pTableView);
58 
59 		// XInterface
60 		DECLARE_XINTERFACE( )
61 		DECLARE_XTYPEPROVIDER( )
62 
63 		// XServiceInfo - static methods
64 		static ::rtl::OUString getImplementationName_Static(void) throw( com::sun::star::uno::RuntimeException );
65 
66 		virtual ::rtl::OUString SAL_CALL getImplementationName() throw(com::sun::star::uno::RuntimeException);
67 
68 		// XAccessible
69 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext(  ) throw (::com::sun::star::uno::RuntimeException);
70 
71 		// XAccessibleContext
72 		virtual sal_Int32 SAL_CALL getAccessibleChildCount(  ) throw (::com::sun::star::uno::RuntimeException);
73 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (::com::sun::star::lang::IndexOutOfBoundsException,::com::sun::star::uno::RuntimeException);
74 		virtual sal_Int16 SAL_CALL getAccessibleRole(  ) throw (::com::sun::star::uno::RuntimeException);
75 
76 		OJoinTableView*	getTableView() const { return m_pTableView; }
77 
78 		void notifyAccessibleEvent(
79 					const sal_Int16 _nEventId,
80 					const ::com::sun::star::uno::Any& _rOldValue,
81 					const ::com::sun::star::uno::Any& _rNewValue
82 				)
83 		{
84 			NotifyAccessibleEvent(_nEventId,_rOldValue,_rNewValue);
85 		}
86 
87         void clearTableView();
88 	};
89 }
90 #endif // DBACCESS_JACCESS_HXX
91