Update ooo320-m1
[ooovba.git] / sd / source / ui / inc / AccessibleSlideSorterView.hxx
blob4faef395f0edd88a57de040be073708355c46b9e
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: AccessibleSlideSorterView.hxx,v $
10 * $Revision: 1.7 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SD_ACCESSIBILITY_ACCESSIBLE_SLIDE_SORTER_VIEW_HXX
32 #define SD_ACCESSIBILITY_ACCESSIBLE_SLIDE_SORTER_VIEW_HXX
34 #include "MutexOwner.hxx"
35 #include <cppuhelper/compbase6.hxx>
36 #include <com/sun/star/accessibility/XAccessible.hpp>
37 #include <com/sun/star/accessibility/XAccessibleContext.hpp>
38 #include <com/sun/star/accessibility/XAccessibleComponent.hpp>
39 #include <com/sun/star/accessibility/XAccessibleSelection.hpp>
40 #include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
41 #include <com/sun/star/lang/XServiceInfo.hpp>
42 #include <com/sun/star/lang/DisposedException.hpp>
43 #include <com/sun/star/awt/XFocusListener.hpp>
44 #include <com/sun/star/document/XEventListener.hpp>
47 #include <memory>
49 class Window;
51 namespace sd { namespace slidesorter {
52 class SlideSorter;
53 } }
55 namespace accessibility {
58 class AccessibleSlideSorterObject;
60 typedef ::cppu::WeakComponentImplHelper6<
61 ::com::sun::star::accessibility::XAccessible,
62 ::com::sun::star::accessibility::XAccessibleEventBroadcaster,
63 ::com::sun::star::accessibility::XAccessibleContext,
64 ::com::sun::star::accessibility::XAccessibleComponent,
65 ::com::sun::star::accessibility::XAccessibleSelection,
66 ::com::sun::star::lang::XServiceInfo
67 > AccessibleSlideSorterViewBase;
69 /** This class makes the SlideSorterViewShell accessible. It uses objects
70 of the AccessibleSlideSorterObject class to the make the page objects
71 accessible.
73 class AccessibleSlideSorterView
74 : public ::sd::MutexOwner,
75 public AccessibleSlideSorterViewBase
77 public:
78 AccessibleSlideSorterView(
79 ::sd::slidesorter::SlideSorter& rSlideSorter,
80 const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> & rxParent,
81 ::Window* pParentWindow);
83 virtual ~AccessibleSlideSorterView (void);
85 /** This method acts like a dispose call. It sends a disposing to all
86 of its listeners. It may be called twice.
88 void Destroyed (void);
90 void FireAccessibleEvent (
91 short nEventId,
92 const ::com::sun::star::uno::Any& rOldValue,
93 const ::com::sun::star::uno::Any& rNewValue);
95 virtual void SAL_CALL disposing (void);
97 /** Return the implementation object of the specified child.
98 @param nIndex
99 Index of the child for which to return the implementation object.
101 AccessibleSlideSorterObject* GetAccessibleChildImplementation (sal_Int32 nIndex);
103 //===== XAccessible =======================================================
105 virtual ::com::sun::star::uno::Reference<
106 ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL
107 getAccessibleContext (void)
108 throw (::com::sun::star::uno::RuntimeException);
111 //===== XAccessibleEventBroadcaster =======================================
112 virtual void SAL_CALL
113 addEventListener(
114 const ::com::sun::star::uno::Reference<
115 ::com::sun::star::accessibility::XAccessibleEventListener >& rxListener)
116 throw (::com::sun::star::uno::RuntimeException);
118 virtual void SAL_CALL
119 removeEventListener(
120 const ::com::sun::star::uno::Reference<
121 ::com::sun::star::accessibility::XAccessibleEventListener >& rxListener )
122 throw (::com::sun::star::uno::RuntimeException);
124 using cppu::WeakComponentImplHelperBase::addEventListener;
125 using cppu::WeakComponentImplHelperBase::removeEventListener;
127 //===== XAccessibleContext ==============================================
129 /// Return the number of currently visible children.
130 virtual sal_Int32 SAL_CALL
131 getAccessibleChildCount (void) throw (::com::sun::star::uno::RuntimeException);
133 /// Return the specified child or throw exception.
134 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL
135 getAccessibleChild (sal_Int32 nIndex)
136 throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
138 /// Return a reference to the parent.
139 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL
140 getAccessibleParent (void)
141 throw (::com::sun::star::uno::RuntimeException);
143 /// Return this objects index among the parents children.
144 virtual sal_Int32 SAL_CALL
145 getAccessibleIndexInParent (void)
146 throw (::com::sun::star::uno::RuntimeException);
148 /// Return this object's role.
149 virtual sal_Int16 SAL_CALL
150 getAccessibleRole (void)
151 throw (::com::sun::star::uno::RuntimeException);
153 /// Return this object's description.
154 virtual ::rtl::OUString SAL_CALL
155 getAccessibleDescription (void)
156 throw (::com::sun::star::uno::RuntimeException);
158 /// Return the object's current name.
159 virtual ::rtl::OUString SAL_CALL
160 getAccessibleName (void)
161 throw (::com::sun::star::uno::RuntimeException);
163 /// Return NULL to indicate that an empty relation set.
164 virtual ::com::sun::star::uno::Reference<
165 ::com::sun::star::accessibility::XAccessibleRelationSet> SAL_CALL
166 getAccessibleRelationSet (void)
167 throw (::com::sun::star::uno::RuntimeException);
169 /// Return the set of current states.
170 virtual ::com::sun::star::uno::Reference<
171 ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL
172 getAccessibleStateSet (void)
173 throw (::com::sun::star::uno::RuntimeException);
175 /** Return the parents locale or throw exception if this object has no
176 parent yet/anymore.
178 virtual ::com::sun::star::lang::Locale SAL_CALL
179 getLocale (void)
180 throw (::com::sun::star::uno::RuntimeException,
181 ::com::sun::star::accessibility::IllegalAccessibleComponentStateException);
183 //===== XAccessibleComponent ================================================
185 /** The default implementation uses the result of
186 <member>getBounds</member> to determine whether the given point lies
187 inside this object.
189 virtual sal_Bool SAL_CALL containsPoint (
190 const ::com::sun::star::awt::Point& aPoint)
191 throw (::com::sun::star::uno::RuntimeException);
193 /** The default implementation returns an empty reference.
195 virtual ::com::sun::star::uno::Reference<
196 ::com::sun::star::accessibility::XAccessible > SAL_CALL
197 getAccessibleAtPoint (
198 const ::com::sun::star::awt::Point& aPoint)
199 throw (::com::sun::star::uno::RuntimeException);
201 /** The default implementation returns an empty rectangle.
203 virtual ::com::sun::star::awt::Rectangle SAL_CALL getBounds (void)
204 throw (::com::sun::star::uno::RuntimeException);
206 /** The default implementation uses the result of
207 <member>getBounds</member> to determine the location.
209 virtual ::com::sun::star::awt::Point SAL_CALL getLocation (void)
210 throw (::com::sun::star::uno::RuntimeException);
212 /** The default implementation returns an empty position, i.e. the
213 * result of the default constructor of <type>com::sun::star::awt::Point</type>.
215 virtual ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen (void)
216 throw (::com::sun::star::uno::RuntimeException);
218 /** The default implementation uses the result of
219 <member>getBounds</member> to determine the size.
221 virtual ::com::sun::star::awt::Size SAL_CALL getSize (void)
222 throw (::com::sun::star::uno::RuntimeException);
224 /** The default implementation does nothing.
226 virtual void SAL_CALL grabFocus (void)
227 throw (::com::sun::star::uno::RuntimeException);
229 /** Returns black as the default foreground color.
231 virtual sal_Int32 SAL_CALL getForeground (void)
232 throw (::com::sun::star::uno::RuntimeException);
234 /** Returns white as the default background color.
236 virtual sal_Int32 SAL_CALL getBackground (void)
237 throw (::com::sun::star::uno::RuntimeException);
240 //===== XAccessibleSelection ==============================================
242 virtual void SAL_CALL
243 selectAccessibleChild (sal_Int32 nChildIndex)
244 throw (::com::sun::star::lang::IndexOutOfBoundsException,
245 ::com::sun::star::uno::RuntimeException);
247 virtual sal_Bool SAL_CALL
248 isAccessibleChildSelected( sal_Int32 nChildIndex )
249 throw (::com::sun::star::lang::IndexOutOfBoundsException,
250 ::com::sun::star::uno::RuntimeException);
252 virtual void SAL_CALL
253 clearAccessibleSelection( )
254 throw (::com::sun::star::uno::RuntimeException);
256 virtual void SAL_CALL
257 selectAllAccessibleChildren( )
258 throw (::com::sun::star::uno::RuntimeException);
260 virtual sal_Int32 SAL_CALL
261 getSelectedAccessibleChildCount( )
262 throw (::com::sun::star::uno::RuntimeException);
264 virtual ::com::sun::star::uno::Reference<
265 ::com::sun::star::accessibility::XAccessible > SAL_CALL
266 getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex )
267 throw (::com::sun::star::lang::IndexOutOfBoundsException,
268 ::com::sun::star::uno::RuntimeException);
270 virtual void SAL_CALL
271 deselectAccessibleChild( sal_Int32 nSelectedChildIndex )
272 throw (::com::sun::star::lang::IndexOutOfBoundsException,
273 ::com::sun::star::uno::RuntimeException);
276 //===== XServiceInfo ====================================================
278 /** Returns an identifier for the implementation of this object.
280 virtual ::rtl::OUString SAL_CALL
281 getImplementationName (void)
282 throw (::com::sun::star::uno::RuntimeException);
284 /** Return whether the specified service is supported by this class.
286 virtual sal_Bool SAL_CALL
287 supportsService (const ::rtl::OUString& sServiceName)
288 throw (::com::sun::star::uno::RuntimeException);
290 /** Returns a list of all supported services.
292 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL
293 getSupportedServiceNames (void)
294 throw (::com::sun::star::uno::RuntimeException);
297 private:
298 class Implementation;
299 ::std::auto_ptr<Implementation> mpImpl;
301 ::sd::slidesorter::SlideSorter& mrSlideSorter;
303 ::com::sun::star::uno::Reference<
304 ::com::sun::star::accessibility::XAccessible> mxParent;
306 sal_uInt32 mnClientId;
308 ::Window* mpContentWindow;
310 /** Check whether or not the object has been disposed (or is in the
311 state of beeing disposed). If that is the case then
312 DisposedException is thrown to inform the (indirect) caller of the
313 foul deed.
315 void ThrowIfDisposed (void)
316 throw (::com::sun::star::lang::DisposedException);
318 /** Check whether or not the object has been disposed (or is in the
319 state of beeing disposed).
321 @return sal_True, if the object is disposed or in the course
322 of being disposed. Otherwise, sal_False is returned.
324 sal_Bool IsDisposed (void);
327 } // end of namespace ::accessibility
329 #endif