Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
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 SD_ACCESSIBILITY_ACCESSIBLE_SLIDE_SORTER_VIEW_HXX
30 : : #define SD_ACCESSIBILITY_ACCESSIBLE_SLIDE_SORTER_VIEW_HXX
31 : :
32 : : #include "MutexOwner.hxx"
33 : : #include <cppuhelper/compbase6.hxx>
34 : : #include <com/sun/star/accessibility/XAccessible.hpp>
35 : : #include <com/sun/star/accessibility/XAccessibleContext.hpp>
36 : : #include <com/sun/star/accessibility/XAccessibleComponent.hpp>
37 : : #include <com/sun/star/accessibility/XAccessibleSelection.hpp>
38 : : #include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
39 : : #include <com/sun/star/lang/XServiceInfo.hpp>
40 : : #include <com/sun/star/lang/DisposedException.hpp>
41 : : #include <com/sun/star/awt/XFocusListener.hpp>
42 : : #include <com/sun/star/document/XEventListener.hpp>
43 : :
44 : :
45 : : #include <memory>
46 : :
47 : : class Window;
48 : :
49 : : namespace sd { namespace slidesorter {
50 : : class SlideSorter;
51 : : } }
52 : :
53 : : namespace accessibility {
54 : :
55 : :
56 : : class AccessibleSlideSorterObject;
57 : :
58 : : typedef ::cppu::PartialWeakComponentImplHelper6<
59 : : ::com::sun::star::accessibility::XAccessible,
60 : : ::com::sun::star::accessibility::XAccessibleEventBroadcaster,
61 : : ::com::sun::star::accessibility::XAccessibleContext,
62 : : ::com::sun::star::accessibility::XAccessibleComponent,
63 : : ::com::sun::star::accessibility::XAccessibleSelection,
64 : : ::com::sun::star::lang::XServiceInfo
65 : : > AccessibleSlideSorterViewBase;
66 : :
67 : : /** This class makes the SlideSorterViewShell accessible. It uses objects
68 : : of the AccessibleSlideSorterObject class to the make the page objects
69 : : accessible.
70 : : */
71 : : class AccessibleSlideSorterView
72 : : : public ::sd::MutexOwner,
73 : : public AccessibleSlideSorterViewBase
74 : : {
75 : : public:
76 : : AccessibleSlideSorterView(
77 : : ::sd::slidesorter::SlideSorter& rSlideSorter,
78 : : const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> & rxParent,
79 : : ::Window* pParentWindow);
80 : :
81 : : void Init();
82 : :
83 : : virtual ~AccessibleSlideSorterView (void);
84 : :
85 : : /** This method acts like a dispose call. It sends a disposing to all
86 : : of its listeners. It may be called twice.
87 : : */
88 : : void Destroyed (void);
89 : :
90 : : void FireAccessibleEvent (
91 : : short nEventId,
92 : : const ::com::sun::star::uno::Any& rOldValue,
93 : : const ::com::sun::star::uno::Any& rNewValue);
94 : :
95 : : virtual void SAL_CALL disposing (void);
96 : :
97 : : /** Return the implementation object of the specified child.
98 : : @param nIndex
99 : : Index of the child for which to return the implementation object.
100 : : */
101 : : AccessibleSlideSorterObject* GetAccessibleChildImplementation (sal_Int32 nIndex);
102 : :
103 : : //===== XComponent ==============================================
104 : :
105 : 0 : virtual void SAL_CALL dispose()throw (::com::sun::star::uno::RuntimeException)
106 : 0 : { WeakComponentImplHelperBase::dispose(); }
107 : 0 : virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & xListener)throw (::com::sun::star::uno::RuntimeException)
108 : 0 : { WeakComponentImplHelperBase::addEventListener(xListener); }
109 : 0 : virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & xListener)throw (::com::sun::star::uno::RuntimeException)
110 : 0 : { WeakComponentImplHelperBase::removeEventListener(xListener); }
111 : :
112 : : //===== XAccessible =======================================================
113 : :
114 : : virtual ::com::sun::star::uno::Reference<
115 : : ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL
116 : : getAccessibleContext (void)
117 : : throw (::com::sun::star::uno::RuntimeException);
118 : :
119 : :
120 : : //===== XAccessibleEventBroadcaster =======================================
121 : : virtual void SAL_CALL
122 : : addEventListener(
123 : : const ::com::sun::star::uno::Reference<
124 : : ::com::sun::star::accessibility::XAccessibleEventListener >& rxListener)
125 : : throw (::com::sun::star::uno::RuntimeException);
126 : :
127 : : virtual void SAL_CALL
128 : : removeEventListener(
129 : : const ::com::sun::star::uno::Reference<
130 : : ::com::sun::star::accessibility::XAccessibleEventListener >& rxListener )
131 : : throw (::com::sun::star::uno::RuntimeException);
132 : :
133 : : //===== XAccessibleContext ==============================================
134 : :
135 : : /// Return the number of currently visible children.
136 : : virtual sal_Int32 SAL_CALL
137 : : getAccessibleChildCount (void) throw (::com::sun::star::uno::RuntimeException);
138 : :
139 : : /// Return the specified child or throw exception.
140 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL
141 : : getAccessibleChild (sal_Int32 nIndex)
142 : : throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
143 : :
144 : : /// Return a reference to the parent.
145 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL
146 : : getAccessibleParent (void)
147 : : throw (::com::sun::star::uno::RuntimeException);
148 : :
149 : : /// Return this objects index among the parents children.
150 : : virtual sal_Int32 SAL_CALL
151 : : getAccessibleIndexInParent (void)
152 : : throw (::com::sun::star::uno::RuntimeException);
153 : :
154 : : /// Return this object's role.
155 : : virtual sal_Int16 SAL_CALL
156 : : getAccessibleRole (void)
157 : : throw (::com::sun::star::uno::RuntimeException);
158 : :
159 : : /// Return this object's description.
160 : : virtual ::rtl::OUString SAL_CALL
161 : : getAccessibleDescription (void)
162 : : throw (::com::sun::star::uno::RuntimeException);
163 : :
164 : : /// Return the object's current name.
165 : : virtual ::rtl::OUString SAL_CALL
166 : : getAccessibleName (void)
167 : : throw (::com::sun::star::uno::RuntimeException);
168 : :
169 : : /// Return NULL to indicate that an empty relation set.
170 : : virtual ::com::sun::star::uno::Reference<
171 : : ::com::sun::star::accessibility::XAccessibleRelationSet> SAL_CALL
172 : : getAccessibleRelationSet (void)
173 : : throw (::com::sun::star::uno::RuntimeException);
174 : :
175 : : /// Return the set of current states.
176 : : virtual ::com::sun::star::uno::Reference<
177 : : ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL
178 : : getAccessibleStateSet (void)
179 : : throw (::com::sun::star::uno::RuntimeException);
180 : :
181 : : /** Return the parents locale or throw exception if this object has no
182 : : parent yet/anymore.
183 : : */
184 : : virtual ::com::sun::star::lang::Locale SAL_CALL
185 : : getLocale (void)
186 : : throw (::com::sun::star::uno::RuntimeException,
187 : : ::com::sun::star::accessibility::IllegalAccessibleComponentStateException);
188 : :
189 : : //===== XAccessibleComponent ================================================
190 : :
191 : : /** The default implementation uses the result of
192 : : <member>getBounds</member> to determine whether the given point lies
193 : : inside this object.
194 : : */
195 : : virtual sal_Bool SAL_CALL containsPoint (
196 : : const ::com::sun::star::awt::Point& aPoint)
197 : : throw (::com::sun::star::uno::RuntimeException);
198 : :
199 : : /** The default implementation returns an empty reference.
200 : : */
201 : : virtual ::com::sun::star::uno::Reference<
202 : : ::com::sun::star::accessibility::XAccessible > SAL_CALL
203 : : getAccessibleAtPoint (
204 : : const ::com::sun::star::awt::Point& aPoint)
205 : : throw (::com::sun::star::uno::RuntimeException);
206 : :
207 : : /** The default implementation returns an empty rectangle.
208 : : */
209 : : virtual ::com::sun::star::awt::Rectangle SAL_CALL getBounds (void)
210 : : throw (::com::sun::star::uno::RuntimeException);
211 : :
212 : : /** The default implementation uses the result of
213 : : <member>getBounds</member> to determine the location.
214 : : */
215 : : virtual ::com::sun::star::awt::Point SAL_CALL getLocation (void)
216 : : throw (::com::sun::star::uno::RuntimeException);
217 : :
218 : : /** The default implementation returns an empty position, i.e. the
219 : : * result of the default constructor of <type>com::sun::star::awt::Point</type>.
220 : : */
221 : : virtual ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen (void)
222 : : throw (::com::sun::star::uno::RuntimeException);
223 : :
224 : : /** The default implementation uses the result of
225 : : <member>getBounds</member> to determine the size.
226 : : */
227 : : virtual ::com::sun::star::awt::Size SAL_CALL getSize (void)
228 : : throw (::com::sun::star::uno::RuntimeException);
229 : :
230 : : /** The default implementation does nothing.
231 : : */
232 : : virtual void SAL_CALL grabFocus (void)
233 : : throw (::com::sun::star::uno::RuntimeException);
234 : :
235 : : /** Returns black as the default foreground color.
236 : : */
237 : : virtual sal_Int32 SAL_CALL getForeground (void)
238 : : throw (::com::sun::star::uno::RuntimeException);
239 : :
240 : : /** Returns white as the default background color.
241 : : */
242 : : virtual sal_Int32 SAL_CALL getBackground (void)
243 : : throw (::com::sun::star::uno::RuntimeException);
244 : :
245 : :
246 : : //===== XAccessibleSelection ==============================================
247 : :
248 : : virtual void SAL_CALL
249 : : selectAccessibleChild (sal_Int32 nChildIndex)
250 : : throw (::com::sun::star::lang::IndexOutOfBoundsException,
251 : : ::com::sun::star::uno::RuntimeException);
252 : :
253 : : virtual sal_Bool SAL_CALL
254 : : isAccessibleChildSelected( sal_Int32 nChildIndex )
255 : : throw (::com::sun::star::lang::IndexOutOfBoundsException,
256 : : ::com::sun::star::uno::RuntimeException);
257 : :
258 : : virtual void SAL_CALL
259 : : clearAccessibleSelection( )
260 : : throw (::com::sun::star::uno::RuntimeException);
261 : :
262 : : virtual void SAL_CALL
263 : : selectAllAccessibleChildren( )
264 : : throw (::com::sun::star::uno::RuntimeException);
265 : :
266 : : virtual sal_Int32 SAL_CALL
267 : : getSelectedAccessibleChildCount( )
268 : : throw (::com::sun::star::uno::RuntimeException);
269 : :
270 : : virtual ::com::sun::star::uno::Reference<
271 : : ::com::sun::star::accessibility::XAccessible > SAL_CALL
272 : : getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex )
273 : : throw (::com::sun::star::lang::IndexOutOfBoundsException,
274 : : ::com::sun::star::uno::RuntimeException);
275 : :
276 : : virtual void SAL_CALL
277 : : deselectAccessibleChild( sal_Int32 nSelectedChildIndex )
278 : : throw (::com::sun::star::lang::IndexOutOfBoundsException,
279 : : ::com::sun::star::uno::RuntimeException);
280 : :
281 : :
282 : : //===== XServiceInfo ====================================================
283 : :
284 : : /** Returns an identifier for the implementation of this object.
285 : : */
286 : : virtual ::rtl::OUString SAL_CALL
287 : : getImplementationName (void)
288 : : throw (::com::sun::star::uno::RuntimeException);
289 : :
290 : : /** Return whether the specified service is supported by this class.
291 : : */
292 : : virtual sal_Bool SAL_CALL
293 : : supportsService (const ::rtl::OUString& sServiceName)
294 : : throw (::com::sun::star::uno::RuntimeException);
295 : :
296 : : /** Returns a list of all supported services.
297 : : */
298 : : virtual ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL
299 : : getSupportedServiceNames (void)
300 : : throw (::com::sun::star::uno::RuntimeException);
301 : :
302 : :
303 : : private:
304 : : class Implementation;
305 : : ::std::auto_ptr<Implementation> mpImpl;
306 : :
307 : : ::sd::slidesorter::SlideSorter& mrSlideSorter;
308 : :
309 : : ::com::sun::star::uno::Reference<
310 : : ::com::sun::star::accessibility::XAccessible> mxParent;
311 : :
312 : : sal_uInt32 mnClientId;
313 : :
314 : : ::Window* mpContentWindow;
315 : :
316 : : /** Check whether or not the object has been disposed (or is in the
317 : : state of beeing disposed). If that is the case then
318 : : DisposedException is thrown to inform the (indirect) caller of the
319 : : foul deed.
320 : : */
321 : : void ThrowIfDisposed (void)
322 : : throw (::com::sun::star::lang::DisposedException);
323 : :
324 : : /** Check whether or not the object has been disposed (or is in the
325 : : state of beeing disposed).
326 : :
327 : : @return sal_True, if the object is disposed or in the course
328 : : of being disposed. Otherwise, sal_False is returned.
329 : : */
330 : : sal_Bool IsDisposed (void);
331 : : };
332 : :
333 : : } // end of namespace ::accessibility
334 : :
335 : : #endif
336 : :
337 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|