xref: /trunk/main/sw/source/core/access/accfield.hxx (revision 91144cd0085a7583d2099b982122deb2184ab956)
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     virtual void SAL_CALL removeEventListener(
97             const ::com::sun::star::uno::Reference<
98                 ::com::sun::star::accessibility::XAccessibleEventListener >& xListener );
99 
100 //  const SwTxtAttr *GetTxtAttr() const;
101 //  void Invalidate();
102     virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
103         const ::com::sun::star::uno::Type& aType );
104 
105     virtual void SAL_CALL acquire(  ) throw () ;
106     virtual void SAL_CALL release(  ) throw () ;
107 
108 public:
109     //=====  XAccessible  =====================================================
110 
111     /// Return the XAccessibleContext.
112     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext> SAL_CALL
113         getAccessibleContext (void);
114 
115     //=====  XAccessibleContext  ==============================================
116 
117     /// Return the number of currently visible children.
118     virtual sal_Int32 SAL_CALL getAccessibleChildCount (void);
119 
120     /// Return the specified child or NULL if index is invalid.
121     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL
122         getAccessibleChild (long nIndex);
123 
124     /// Return a reference to the parent.
125     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL
126         getAccessibleParent (void);
127 
128     /// Return this objects index among the parents children.
129     virtual sal_Int32 SAL_CALL
130         getAccessibleIndexInParent (void);
131 
132     /// Return this object's role.
133     virtual sal_Int16 SAL_CALL
134         getAccessibleRole (void);
135 
136     /// Return this object's description.
137     virtual ::rtl::OUString SAL_CALL
138         getAccessibleDescription (void);
139 
140     /// Return the object's current name.
141     virtual ::rtl::OUString SAL_CALL
142         getAccessibleName (void);
143 
144     /// Return NULL to indicate that an empty relation set.
145     virtual ::com::sun::star::uno::Reference<
146             ::com::sun::star::accessibility::XAccessibleRelationSet> SAL_CALL
147         getAccessibleRelationSet (void);
148 
149     /// Return the set of current states.
150     virtual ::com::sun::star::uno::Reference<
151             ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL
152         getAccessibleStateSet (void);
153 
154     /** Return the parents locale or throw exception if this object has no
155         parent yet/anymore.
156     */
157     virtual ::com::sun::star::lang::Locale SAL_CALL
158         getLocale (void);
159 
160     //=====  XAccessibleComponent  ============================================
161     virtual sal_Bool SAL_CALL containsPoint(
162             const ::com::sun::star::awt::Point& aPoint );
163 
164     virtual ::com::sun::star::uno::Reference<
165         ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(
166                 const ::com::sun::star::awt::Point& aPoint );
167 
168     virtual ::com::sun::star::awt::Rectangle SAL_CALL getBounds();
169 
170     virtual ::com::sun::star::awt::Point SAL_CALL getLocation();
171 
172     virtual ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen();
173 
174     virtual ::com::sun::star::awt::Size SAL_CALL getSize();
175 
176     virtual void SAL_CALL grabFocus();
177 
178     virtual sal_Int32 SAL_CALL getForeground();
179     virtual sal_Int32 SAL_CALL getBackground();
180 
181 
182     virtual ::com::sun::star::awt::Rectangle SAL_CALL
183         getBoundsImpl(sal_Bool bRelative) ;
184 
185 
186 };
187 
188 #endif
189