xref: /aoo41x/main/sw/source/core/access/accfield.hxx (revision d3553c6b)
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 #ifndef _ACCFIELD_HXX
23 #define _ACCFIELD_HXX
24 
25 #ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLE_HPP_
26 #include <com/sun/star/accessibility/XAccessible.hpp>
27 #endif
28 #ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLECONTEXT_HPP_
29 #include <com/sun/star/accessibility/XAccessibleContext.hpp>
30 #endif
31 #ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLECOMPONENT_HPP_
32 #include <com/sun/star/accessibility/XAccessibleComponent.hpp>
33 #endif
34 #ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLEEVENTBROADCASTER_HPP_
35 #include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
36 #endif
37 #ifndef _COM_SUN_STAR_ACCESSIBILITY_ILLEGALACCESSIBLECOMPONENTSTATEEXCEPTION_HDL_
38 #include <com/sun/star/accessibility/IllegalAccessibleComponentStateException.hpp>
39 #endif
40 #ifndef _COM_SUN_STAR_LANG_DISPOSEDEXCEPTION_HPP_
41 #include <com/sun/star/lang/DisposedException.hpp>
42 #endif
43 #ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
44 #include <com/sun/star/lang/XServiceInfo.hpp>
45 #endif
46 #ifndef _COM_SUN_STAR_LANG_INDEXOUTOFBOUNDSEXCEPTION_HPP_
47 #include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
48 #endif
49 #ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLEHYPERLINK_HPP_
50 #include <com/sun/star/accessibility/XAccessibleHyperlink.hpp>
51 #endif
52 #ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLEVALUE_HPP_
53 #include <com/sun/star/accessibility/XAccessibleValue.hpp>
54 #endif
55 #ifndef _COM_SUN_STAR_UNO_RUNTIMEEXCEPTION_HPP_
56 #include <com/sun/star/uno/RuntimeException.hpp>
57 #endif
58 #ifndef _VOS_REF_HXX_
59 #include <vos/ref.hxx>
60 #endif
61 #ifndef _CPPUHELPER_IMPLBASE4_HXX_
62 #include <cppuhelper/implbase4.hxx>
63 #endif
64 #ifndef _FMTINFMT_HXX //autogen
65 #include <fmtinfmt.hxx>
66 #endif
67 
68 class SwAccessibleParagraph;
69 class SwField;
70 class SwAccessibleField :
71 	public ::cppu::WeakImplHelper4<
72 				::com::sun::star::accessibility::XAccessible,
73                 ::com::sun::star::accessibility::XAccessibleContext,
74                 ::com::sun::star::accessibility::XAccessibleComponent,
75 				::com::sun::star::accessibility::XAccessibleEventBroadcaster
76                 >
77 {
78 	friend class SwAccessibleParagraph;
79 	friend class SwAccessibleHyperTextData;
80 
81 protected:
82 //	sal_uInt16 nHintPos;
83 	::vos::ORef< SwAccessibleParagraph > m_xPara;
84 	SwField *m_pSwField;
85 
86     sal_uInt32 m_nClientId;   // client id in the AccessibleEventNotifier queue
87     sal_Int16 m_nRole;		// immutable outside constructor
88 //	sal_Int32 nStartIdx;
89 //	sal_Int32 nEndIdx;
90 public:
91 	SwAccessibleField( SwField *pSwFld,SwAccessibleParagraph *p,sal_Int16);
92 
93     virtual void SAL_CALL addEventListener(
94 			const ::com::sun::star::uno::Reference<
95 				::com::sun::star::accessibility::XAccessibleEventListener >& xListener )
96 		throw (::com::sun::star::uno::RuntimeException);
97     virtual void SAL_CALL removeEventListener(
98 			const ::com::sun::star::uno::Reference<
99 				::com::sun::star::accessibility::XAccessibleEventListener >& xListener )
100 		throw (::com::sun::star::uno::RuntimeException);
101 
102 //	const SwTxtAttr *GetTxtAttr() const;
103 //	void Invalidate();
104     virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
105         const ::com::sun::star::uno::Type& aType )
106         throw (::com::sun::star::uno::RuntimeException);
107 
108     virtual void SAL_CALL acquire(  ) throw () ;
109     virtual void SAL_CALL release(  ) throw () ;
110 
111 public:
112 	//=====  XAccessible  =====================================================
113 
114     ///	Return the XAccessibleContext.
115     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext> SAL_CALL
116     	getAccessibleContext (void) throw (com::sun::star::uno::RuntimeException);
117 
118 	//=====  XAccessibleContext  ==============================================
119 
120     ///	Return the number of currently visible children.
121     virtual sal_Int32 SAL_CALL getAccessibleChildCount (void)
122         throw (::com::sun::star::uno::RuntimeException);
123 
124     ///	Return the specified child or NULL if index is invalid.
125     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL
126     	getAccessibleChild (long nIndex)
127         throw (::com::sun::star::uno::RuntimeException,
128 				::com::sun::star::lang::IndexOutOfBoundsException);
129 
130     ///	Return a reference to the parent.
131 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL
132     	getAccessibleParent (void)
133         throw (::com::sun::star::uno::RuntimeException);
134 
135     ///	Return this objects index among the parents children.
136 	virtual	sal_Int32 SAL_CALL
137     	getAccessibleIndexInParent (void)
138         throw (::com::sun::star::uno::RuntimeException);
139 
140     ///	Return this object's role.
141 	virtual sal_Int16 SAL_CALL
142     	getAccessibleRole (void)
143         throw (::com::sun::star::uno::RuntimeException);
144 
145     ///	Return this object's description.
146 	virtual ::rtl::OUString SAL_CALL
147     	getAccessibleDescription (void)
148         throw (::com::sun::star::uno::RuntimeException);
149 
150     ///	Return the object's current name.
151 	virtual ::rtl::OUString SAL_CALL
152     	getAccessibleName (void)
153         throw (::com::sun::star::uno::RuntimeException);
154 
155 	///	Return NULL to indicate that an empty relation set.
156 	virtual ::com::sun::star::uno::Reference<
157             ::com::sun::star::accessibility::XAccessibleRelationSet> SAL_CALL
158     	getAccessibleRelationSet (void)
159         throw (::com::sun::star::uno::RuntimeException);
160 
161     ///	Return the set of current states.
162 	virtual ::com::sun::star::uno::Reference<
163             ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL
164     	getAccessibleStateSet (void)
165         throw (::com::sun::star::uno::RuntimeException);
166 
167 	/**	Return the parents locale or throw exception if this object has no
168     	parent yet/anymore.
169     */
170 	virtual ::com::sun::star::lang::Locale SAL_CALL
171     	getLocale (void)
172 		throw (::com::sun::star::accessibility::IllegalAccessibleComponentStateException, ::com::sun::star::uno::RuntimeException);
173 
174 	//=====  XAccessibleComponent  ============================================
175     virtual sal_Bool SAL_CALL containsPoint(
176 			const ::com::sun::star::awt::Point& aPoint )
177 		throw (::com::sun::star::uno::RuntimeException);
178 
179     virtual ::com::sun::star::uno::Reference<
180 		::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(
181 				const ::com::sun::star::awt::Point& aPoint )
182 		throw (::com::sun::star::uno::RuntimeException);
183 
184     virtual ::com::sun::star::awt::Rectangle SAL_CALL getBounds()
185 		throw (::com::sun::star::uno::RuntimeException);
186 
187     virtual ::com::sun::star::awt::Point SAL_CALL getLocation()
188 		throw (::com::sun::star::uno::RuntimeException);
189 
190     virtual ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen()
191 		throw (::com::sun::star::uno::RuntimeException);
192 
193     virtual ::com::sun::star::awt::Size SAL_CALL getSize()
194 		throw (::com::sun::star::uno::RuntimeException);
195 
196     virtual void SAL_CALL grabFocus()
197 		throw (::com::sun::star::uno::RuntimeException);
198 
199     virtual sal_Int32 SAL_CALL getForeground()
200 		throw (::com::sun::star::uno::RuntimeException);
201     virtual sal_Int32 SAL_CALL getBackground()
202 		throw (::com::sun::star::uno::RuntimeException);
203 
204 
205     virtual ::com::sun::star::awt::Rectangle SAL_CALL
206         getBoundsImpl(sal_Bool bRelative)
207 		throw (::com::sun::star::uno::RuntimeException) ;
208 
209 
210 };
211 
212 #endif
213 
214