1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef ACCESSIBILITY_EXT_ACCESSIBILEEDITBROWSEBOXTABLECELL_HXX
24 #define ACCESSIBILITY_EXT_ACCESSIBILEEDITBROWSEBOXTABLECELL_HXX
25 
26 #ifndef ACCESSIBILITY_EXT_BROWSE_BOX_CELL_HXX
27 #include "accessiblebrowseboxcell.hxx"
28 #endif
29 #include <com/sun/star/accessibility/XAccessibleAction.hpp>
30 #include <com/sun/star/accessibility/XAccessibleEventListener.hpp>
31 #include <com/sun/star/accessibility/XAccessibleRelationSet.hpp>
32 #include <com/sun/star/accessibility/XAccessibleSelection.hpp>
33 #include <com/sun/star/accessibility/XAccessibleValue.hpp>
34 #include <cppuhelper/implbase1.hxx>
35 #include <cppuhelper/compbase1.hxx>
36 #include <comphelper/accessiblewrapper.hxx>
37 
38 namespace accessibility
39 {
40 	// =============================================================================
41 	// = EditBrowseBoxTableCell
42 	// =============================================================================
43 	class EditBrowseBoxTableCell	:public AccessibleBrowseBoxCell
44 									,public ::comphelper::OAccessibleContextWrapperHelper
45 	{
46 	public:
47 		EditBrowseBoxTableCell(
48 			const com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxParent,
49 			const com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxOwningAccessible,
50 			const com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >& _xControlChild,
51             ::svt::IAccessibleTableProvider& _rBrowseBox,
52 			const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& _xFocusWindow,
53 			sal_Int32 _nRowPos,
54 			sal_uInt16 _nColPos
55 		);
56 
57 	protected:
58 		virtual ~EditBrowseBoxTableCell();
59 
60 	protected:
61 		// XAccessibleComponent
62 	    virtual sal_Int32 SAL_CALL getForeground(  ) throw (::com::sun::star::uno::RuntimeException) ;
63 		virtual sal_Int32 SAL_CALL getBackground(  ) throw (::com::sun::star::uno::RuntimeException) ;
64 
65 		// XServiceInfo
66 		virtual ::rtl::OUString SAL_CALL getImplementationName() throw ( ::com::sun::star::uno::RuntimeException );
67 
68 		// XInterface
69 		DECLARE_XINTERFACE( )
70 		// XTypeProvider
71 		DECLARE_XTYPEPROVIDER( )
72 
73 		// XAccessibleContext
74 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleParent(  ) throw (::com::sun::star::uno::RuntimeException);
75 		virtual ::rtl::OUString SAL_CALL getAccessibleDescription(  ) throw (::com::sun::star::uno::RuntimeException);
76 		virtual ::rtl::OUString SAL_CALL getAccessibleName(  ) throw (::com::sun::star::uno::RuntimeException);
77 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet(  ) throw (::com::sun::star::uno::RuntimeException);
78 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet(  ) throw (::com::sun::star::uno::RuntimeException);
79 
80 		sal_Int16 SAL_CALL getAccessibleRole() throw ( ::com::sun::star::uno::RuntimeException );
81 
82 		virtual sal_Int32 SAL_CALL getAccessibleChildCount(  ) throw (::com::sun::star::uno::RuntimeException);
83 		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);
84 
85 		virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
86 	protected:
87 		// OComponentHelper
88 		virtual void SAL_CALL disposing();
89 
90 		// XComponent/OComponentProxyAggregationHelper (needs to be disambiguated)
91 		virtual void SAL_CALL dispose() throw( ::com::sun::star::uno::RuntimeException );
92 
93 		// OAccessibleContextWrapperHelper();
94 		void notifyTranslatedEvent( const ::com::sun::star::accessibility::AccessibleEventObject& _rEvent ) throw (::com::sun::star::uno::RuntimeException);
95 
96 	private:
97 		EditBrowseBoxTableCell();											// never implemented
98 		EditBrowseBoxTableCell( const EditBrowseBoxTableCell& );			// never implemented
99 		EditBrowseBoxTableCell& operator=( const EditBrowseBoxTableCell& );	// never implemented
100 	};
101 
102 	// =============================================================================
103 	// = EditBrowseBoxTableCell
104 	// =============================================================================
105 	typedef ::cppu::WeakComponentImplHelper1	<	::com::sun::star::accessibility::XAccessible
106 												>	EditBrowseBoxTableCellAccess_Base;
107 	// XAccessible providing an EditBrowseBoxTableCell
108 	class EditBrowseBoxTableCellAccess
109 						:public ::comphelper::OBaseMutex
110 						,public EditBrowseBoxTableCellAccess_Base
111 	{
112 	protected:
113         ::com::sun::star::uno::WeakReference< ::com::sun::star::accessibility::XAccessibleContext >
114                                             m_aContext;
115         ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
116 								            m_xParent;
117         ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
118 								            m_xControlAccessible;
119 		::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >
120 								            m_xFocusWindow;
121         ::svt::IAccessibleTableProvider*    m_pBrowseBox;
122 		sal_Int32				            m_nRowPos;
123 		sal_uInt16				            m_nColPos;
124 
125 	public:
126 		EditBrowseBoxTableCellAccess(
127 			const ::com::sun::star::uno::Reference< com::sun::star::accessibility::XAccessible >& _rxParent,
128 			const ::com::sun::star::uno::Reference< com::sun::star::accessibility::XAccessible > _xControlAccessible,
129 			const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& _xFocusWindow,
130             ::svt::IAccessibleTableProvider& _rBrowseBox,
131 			sal_Int32 _nRowPos,
132 			sal_uInt16 _nColPos
133 		);
134 
135 	protected:
136 		virtual ~EditBrowseBoxTableCellAccess();
137 
138 		// XAccessible
139 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext(  ) throw (::com::sun::star::uno::RuntimeException);
140 
141 		// XComponent/OComponentHelper
142 		virtual void SAL_CALL disposing();
143 
144 	private:
145 		EditBrowseBoxTableCellAccess();													// never implemented
146 		EditBrowseBoxTableCellAccess( const EditBrowseBoxTableCellAccess& );			// never implemented
147 		EditBrowseBoxTableCellAccess& operator=( const EditBrowseBoxTableCellAccess& );	// never implemented
148 	};
149 }
150 
151 #endif // ACCESSIBILITY_EXT_ACCESSIBILEEDITBROWSEBOXTABLECELL_HXX
152 
153