xref: /trunk/main/sw/source/core/access/accfield.hxx (revision ca62e2c2083b5d0995f1245bad6c2edfb455fbec)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright IBM Corporation 2010.
6  * Copyright 2000, 2010 Oracle and/or its affiliates.
7  *
8  * OpenOffice.org - a multi-platform office productivity suite
9  *
10  * This file is part of OpenOffice.org.
11  *
12  * OpenOffice.org is free software: you can redistribute it and/or modify
13  * it under the terms of the GNU Lesser General Public License version 3
14  * only, as published by the Free Software Foundation.
15  *
16  * OpenOffice.org is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU Lesser General Public License version 3 for more details
20  * (a copy is included in the LICENSE file that accompanied this code).
21  *
22  * You should have received a copy of the GNU Lesser General Public License
23  * version 3 along with OpenOffice.org.  If not, see
24  * <http://www.openoffice.org/license.html>
25  * for a copy of the LGPLv3 License.
26  *
27  ************************************************************************/
28 
29 #ifndef _ACCFIELD_HXX
30 #define _ACCFIELD_HXX
31 
32 #ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLE_HPP_
33 #include <com/sun/star/accessibility/XAccessible.hpp>
34 #endif
35 #ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLECONTEXT_HPP_
36 #include <com/sun/star/accessibility/XAccessibleContext.hpp>
37 #endif
38 #ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLECOMPONENT_HPP_
39 #include <com/sun/star/accessibility/XAccessibleComponent.hpp>
40 #endif
41 #ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLEEVENTBROADCASTER_HPP_
42 #include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
43 #endif
44 #ifndef _COM_SUN_STAR_ACCESSIBILITY_ILLEGALACCESSIBLECOMPONENTSTATEEXCEPTION_HDL_
45 #include <com/sun/star/accessibility/IllegalAccessibleComponentStateException.hpp>
46 #endif
47 #ifndef _COM_SUN_STAR_LANG_DISPOSEDEXCEPTION_HPP_
48 #include <com/sun/star/lang/DisposedException.hpp>
49 #endif
50 #ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
51 #include <com/sun/star/lang/XServiceInfo.hpp>
52 #endif
53 #ifndef _COM_SUN_STAR_LANG_INDEXOUTOFBOUNDSEXCEPTION_HPP_
54 #include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
55 #endif
56 #ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLEHYPERLINK_HPP_
57 #include <com/sun/star/accessibility/XAccessibleHyperlink.hpp>
58 #endif
59 #ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLEVALUE_HPP_
60 #include <com/sun/star/accessibility/XAccessibleValue.hpp>
61 #endif
62 #ifndef _COM_SUN_STAR_UNO_RUNTIMEEXCEPTION_HPP_
63 #include <com/sun/star/uno/RuntimeException.hpp>
64 #endif
65 #ifndef _VOS_REF_HXX_
66 #include <vos/ref.hxx>
67 #endif
68 #ifndef _CPPUHELPER_IMPLBASE4_HXX_
69 #include <cppuhelper/implbase4.hxx>
70 #endif
71 #ifndef _FMTINFMT_HXX //autogen
72 #include <fmtinfmt.hxx>
73 #endif
74 
75 class SwAccessibleParagraph;
76 class SwField;
77 class SwAccessibleField :
78     public ::cppu::WeakImplHelper4<
79                 ::com::sun::star::accessibility::XAccessible,
80                 ::com::sun::star::accessibility::XAccessibleContext,
81                 ::com::sun::star::accessibility::XAccessibleComponent,
82                 ::com::sun::star::accessibility::XAccessibleEventBroadcaster
83                 >
84 {
85     friend class SwAccessibleParagraph;
86     friend class SwAccessibleHyperTextData;
87 
88 protected:
89 //  sal_uInt16 nHintPos;
90     ::vos::ORef< SwAccessibleParagraph > m_xPara;
91     SwField *m_pSwField;
92 
93     sal_uInt32 m_nClientId;   // client id in the AccessibleEventNotifier queue
94     sal_Int16 m_nRole;      // immutable outside constructor
95 //  sal_Int32 nStartIdx;
96 //  sal_Int32 nEndIdx;
97 public:
98     SwAccessibleField( SwField *pSwFld,SwAccessibleParagraph *p,sal_Int16);
99 
100     virtual void SAL_CALL addEventListener(
101             const ::com::sun::star::uno::Reference<
102                 ::com::sun::star::accessibility::XAccessibleEventListener >& xListener )
103         throw (::com::sun::star::uno::RuntimeException);
104     virtual void SAL_CALL removeEventListener(
105             const ::com::sun::star::uno::Reference<
106                 ::com::sun::star::accessibility::XAccessibleEventListener >& xListener )
107         throw (::com::sun::star::uno::RuntimeException);
108 
109 //  const SwTxtAttr *GetTxtAttr() const;
110 //  void Invalidate();
111     virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
112         const ::com::sun::star::uno::Type& aType )
113         throw (::com::sun::star::uno::RuntimeException);
114 
115     virtual void SAL_CALL acquire(  ) throw () ;
116     virtual void SAL_CALL release(  ) throw () ;
117 
118 public:
119     //=====  XAccessible  =====================================================
120 
121     /// Return the XAccessibleContext.
122     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext> SAL_CALL
123         getAccessibleContext (void) throw (com::sun::star::uno::RuntimeException);
124 
125     //=====  XAccessibleContext  ==============================================
126 
127     /// Return the number of currently visible children.
128     virtual long SAL_CALL getAccessibleChildCount (void)
129         throw (::com::sun::star::uno::RuntimeException);
130 
131     /// Return the specified child or NULL if index is invalid.
132     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL
133         getAccessibleChild (long nIndex)
134         throw (::com::sun::star::uno::RuntimeException,
135                 ::com::sun::star::lang::IndexOutOfBoundsException);
136 
137     /// Return a reference to the parent.
138     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL
139         getAccessibleParent (void)
140         throw (::com::sun::star::uno::RuntimeException);
141 
142     /// Return this objects index among the parents children.
143     virtual sal_Int32 SAL_CALL
144         getAccessibleIndexInParent (void)
145         throw (::com::sun::star::uno::RuntimeException);
146 
147     /// Return this object's role.
148     virtual sal_Int16 SAL_CALL
149         getAccessibleRole (void)
150         throw (::com::sun::star::uno::RuntimeException);
151 
152     /// Return this object's description.
153     virtual ::rtl::OUString SAL_CALL
154         getAccessibleDescription (void)
155         throw (::com::sun::star::uno::RuntimeException);
156 
157     /// Return the object's current name.
158     virtual ::rtl::OUString SAL_CALL
159         getAccessibleName (void)
160         throw (::com::sun::star::uno::RuntimeException);
161 
162     /// Return NULL to indicate that an empty relation set.
163     virtual ::com::sun::star::uno::Reference<
164             ::com::sun::star::accessibility::XAccessibleRelationSet> SAL_CALL
165         getAccessibleRelationSet (void)
166         throw (::com::sun::star::uno::RuntimeException);
167 
168     /// Return the set of current states.
169     virtual ::com::sun::star::uno::Reference<
170             ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL
171         getAccessibleStateSet (void)
172         throw (::com::sun::star::uno::RuntimeException);
173 
174     /** Return the parents locale or throw exception if this object has no
175         parent yet/anymore.
176     */
177     virtual ::com::sun::star::lang::Locale SAL_CALL
178         getLocale (void)
179         throw (::com::sun::star::accessibility::IllegalAccessibleComponentStateException, ::com::sun::star::uno::RuntimeException);
180 
181     //=====  XAccessibleComponent  ============================================
182     virtual sal_Bool SAL_CALL containsPoint(
183             const ::com::sun::star::awt::Point& aPoint )
184         throw (::com::sun::star::uno::RuntimeException);
185 
186     virtual ::com::sun::star::uno::Reference<
187         ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(
188                 const ::com::sun::star::awt::Point& aPoint )
189         throw (::com::sun::star::uno::RuntimeException);
190 
191     virtual ::com::sun::star::awt::Rectangle SAL_CALL getBounds()
192         throw (::com::sun::star::uno::RuntimeException);
193 
194     virtual ::com::sun::star::awt::Point SAL_CALL getLocation()
195         throw (::com::sun::star::uno::RuntimeException);
196 
197     virtual ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen()
198         throw (::com::sun::star::uno::RuntimeException);
199 
200     virtual ::com::sun::star::awt::Size SAL_CALL getSize()
201         throw (::com::sun::star::uno::RuntimeException);
202 
203     virtual void SAL_CALL grabFocus()
204         throw (::com::sun::star::uno::RuntimeException);
205 
206     virtual sal_Int32 SAL_CALL getForeground()
207         throw (::com::sun::star::uno::RuntimeException);
208     virtual sal_Int32 SAL_CALL getBackground()
209         throw (::com::sun::star::uno::RuntimeException);
210 
211 
212     virtual ::com::sun::star::awt::Rectangle SAL_CALL
213         getBoundsImpl(sal_Bool bRelative)
214         throw (::com::sun::star::uno::RuntimeException) ;
215 
216 
217 };
218 
219 #endif
220 
221