CWS-TOOLING: integrate CWS os150
[LibreOffice.git] / sd / source / ui / inc / AccessibleSlideSorterView.hxx
blob16804e79cb8f731c56bfdc742cc666e284229911
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #ifndef SD_ACCESSIBILITY_ACCESSIBLE_SLIDE_SORTER_VIEW_HXX
29 #define SD_ACCESSIBILITY_ACCESSIBLE_SLIDE_SORTER_VIEW_HXX
31 #include "MutexOwner.hxx"
32 #include <cppuhelper/compbase6.hxx>
33 #include <com/sun/star/accessibility/XAccessible.hpp>
34 #include <com/sun/star/accessibility/XAccessibleContext.hpp>
35 #include <com/sun/star/accessibility/XAccessibleComponent.hpp>
36 #include <com/sun/star/accessibility/XAccessibleSelection.hpp>
37 #include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
38 #include <com/sun/star/lang/XServiceInfo.hpp>
39 #include <com/sun/star/lang/DisposedException.hpp>
40 #include <com/sun/star/awt/XFocusListener.hpp>
41 #include <com/sun/star/document/XEventListener.hpp>
44 #include <memory>
46 class Window;
48 namespace sd { namespace slidesorter {
49 class SlideSorter;
50 } }
52 namespace accessibility {
55 class AccessibleSlideSorterObject;
57 typedef ::cppu::WeakComponentImplHelper6<
58 ::com::sun::star::accessibility::XAccessible,
59 ::com::sun::star::accessibility::XAccessibleEventBroadcaster,
60 ::com::sun::star::accessibility::XAccessibleContext,
61 ::com::sun::star::accessibility::XAccessibleComponent,
62 ::com::sun::star::accessibility::XAccessibleSelection,
63 ::com::sun::star::lang::XServiceInfo
64 > AccessibleSlideSorterViewBase;
66 /** This class makes the SlideSorterViewShell accessible. It uses objects
67 of the AccessibleSlideSorterObject class to the make the page objects
68 accessible.
70 class AccessibleSlideSorterView
71 : public ::sd::MutexOwner,
72 public AccessibleSlideSorterViewBase
74 public:
75 AccessibleSlideSorterView(
76 ::sd::slidesorter::SlideSorter& rSlideSorter,
77 const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> & rxParent,
78 ::Window* pParentWindow);
80 virtual ~AccessibleSlideSorterView (void);
82 /** This method acts like a dispose call. It sends a disposing to all
83 of its listeners. It may be called twice.
85 void Destroyed (void);
87 void FireAccessibleEvent (
88 short nEventId,
89 const ::com::sun::star::uno::Any& rOldValue,
90 const ::com::sun::star::uno::Any& rNewValue);
92 virtual void SAL_CALL disposing (void);
94 /** Return the implementation object of the specified child.
95 @param nIndex
96 Index of the child for which to return the implementation object.
98 AccessibleSlideSorterObject* GetAccessibleChildImplementation (sal_Int32 nIndex);
100 //===== XAccessible =======================================================
102 virtual ::com::sun::star::uno::Reference<
103 ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL
104 getAccessibleContext (void)
105 throw (::com::sun::star::uno::RuntimeException);
108 //===== XAccessibleEventBroadcaster =======================================
109 virtual void SAL_CALL
110 addEventListener(
111 const ::com::sun::star::uno::Reference<
112 ::com::sun::star::accessibility::XAccessibleEventListener >& rxListener)
113 throw (::com::sun::star::uno::RuntimeException);
115 virtual void SAL_CALL
116 removeEventListener(
117 const ::com::sun::star::uno::Reference<
118 ::com::sun::star::accessibility::XAccessibleEventListener >& rxListener )
119 throw (::com::sun::star::uno::RuntimeException);
121 using cppu::WeakComponentImplHelperBase::addEventListener;
122 using cppu::WeakComponentImplHelperBase::removeEventListener;
124 //===== XAccessibleContext ==============================================
126 /// Return the number of currently visible children.
127 virtual sal_Int32 SAL_CALL
128 getAccessibleChildCount (void) throw (::com::sun::star::uno::RuntimeException);
130 /// Return the specified child or throw exception.
131 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL
132 getAccessibleChild (sal_Int32 nIndex)
133 throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
135 /// Return a reference to the parent.
136 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL
137 getAccessibleParent (void)
138 throw (::com::sun::star::uno::RuntimeException);
140 /// Return this objects index among the parents children.
141 virtual sal_Int32 SAL_CALL
142 getAccessibleIndexInParent (void)
143 throw (::com::sun::star::uno::RuntimeException);
145 /// Return this object's role.
146 virtual sal_Int16 SAL_CALL
147 getAccessibleRole (void)
148 throw (::com::sun::star::uno::RuntimeException);
150 /// Return this object's description.
151 virtual ::rtl::OUString SAL_CALL
152 getAccessibleDescription (void)
153 throw (::com::sun::star::uno::RuntimeException);
155 /// Return the object's current name.
156 virtual ::rtl::OUString SAL_CALL
157 getAccessibleName (void)
158 throw (::com::sun::star::uno::RuntimeException);
160 /// Return NULL to indicate that an empty relation set.
161 virtual ::com::sun::star::uno::Reference<
162 ::com::sun::star::accessibility::XAccessibleRelationSet> SAL_CALL
163 getAccessibleRelationSet (void)
164 throw (::com::sun::star::uno::RuntimeException);
166 /// Return the set of current states.
167 virtual ::com::sun::star::uno::Reference<
168 ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL
169 getAccessibleStateSet (void)
170 throw (::com::sun::star::uno::RuntimeException);
172 /** Return the parents locale or throw exception if this object has no
173 parent yet/anymore.
175 virtual ::com::sun::star::lang::Locale SAL_CALL
176 getLocale (void)
177 throw (::com::sun::star::uno::RuntimeException,
178 ::com::sun::star::accessibility::IllegalAccessibleComponentStateException);
180 //===== XAccessibleComponent ================================================
182 /** The default implementation uses the result of
183 <member>getBounds</member> to determine whether the given point lies
184 inside this object.
186 virtual sal_Bool SAL_CALL containsPoint (
187 const ::com::sun::star::awt::Point& aPoint)
188 throw (::com::sun::star::uno::RuntimeException);
190 /** The default implementation returns an empty reference.
192 virtual ::com::sun::star::uno::Reference<
193 ::com::sun::star::accessibility::XAccessible > SAL_CALL
194 getAccessibleAtPoint (
195 const ::com::sun::star::awt::Point& aPoint)
196 throw (::com::sun::star::uno::RuntimeException);
198 /** The default implementation returns an empty rectangle.
200 virtual ::com::sun::star::awt::Rectangle SAL_CALL getBounds (void)
201 throw (::com::sun::star::uno::RuntimeException);
203 /** The default implementation uses the result of
204 <member>getBounds</member> to determine the location.
206 virtual ::com::sun::star::awt::Point SAL_CALL getLocation (void)
207 throw (::com::sun::star::uno::RuntimeException);
209 /** The default implementation returns an empty position, i.e. the
210 * result of the default constructor of <type>com::sun::star::awt::Point</type>.
212 virtual ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen (void)
213 throw (::com::sun::star::uno::RuntimeException);
215 /** The default implementation uses the result of
216 <member>getBounds</member> to determine the size.
218 virtual ::com::sun::star::awt::Size SAL_CALL getSize (void)
219 throw (::com::sun::star::uno::RuntimeException);
221 /** The default implementation does nothing.
223 virtual void SAL_CALL grabFocus (void)
224 throw (::com::sun::star::uno::RuntimeException);
226 /** Returns black as the default foreground color.
228 virtual sal_Int32 SAL_CALL getForeground (void)
229 throw (::com::sun::star::uno::RuntimeException);
231 /** Returns white as the default background color.
233 virtual sal_Int32 SAL_CALL getBackground (void)
234 throw (::com::sun::star::uno::RuntimeException);
237 //===== XAccessibleSelection ==============================================
239 virtual void SAL_CALL
240 selectAccessibleChild (sal_Int32 nChildIndex)
241 throw (::com::sun::star::lang::IndexOutOfBoundsException,
242 ::com::sun::star::uno::RuntimeException);
244 virtual sal_Bool SAL_CALL
245 isAccessibleChildSelected( sal_Int32 nChildIndex )
246 throw (::com::sun::star::lang::IndexOutOfBoundsException,
247 ::com::sun::star::uno::RuntimeException);
249 virtual void SAL_CALL
250 clearAccessibleSelection( )
251 throw (::com::sun::star::uno::RuntimeException);
253 virtual void SAL_CALL
254 selectAllAccessibleChildren( )
255 throw (::com::sun::star::uno::RuntimeException);
257 virtual sal_Int32 SAL_CALL
258 getSelectedAccessibleChildCount( )
259 throw (::com::sun::star::uno::RuntimeException);
261 virtual ::com::sun::star::uno::Reference<
262 ::com::sun::star::accessibility::XAccessible > SAL_CALL
263 getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex )
264 throw (::com::sun::star::lang::IndexOutOfBoundsException,
265 ::com::sun::star::uno::RuntimeException);
267 virtual void SAL_CALL
268 deselectAccessibleChild( sal_Int32 nSelectedChildIndex )
269 throw (::com::sun::star::lang::IndexOutOfBoundsException,
270 ::com::sun::star::uno::RuntimeException);
273 //===== XServiceInfo ====================================================
275 /** Returns an identifier for the implementation of this object.
277 virtual ::rtl::OUString SAL_CALL
278 getImplementationName (void)
279 throw (::com::sun::star::uno::RuntimeException);
281 /** Return whether the specified service is supported by this class.
283 virtual sal_Bool SAL_CALL
284 supportsService (const ::rtl::OUString& sServiceName)
285 throw (::com::sun::star::uno::RuntimeException);
287 /** Returns a list of all supported services.
289 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL
290 getSupportedServiceNames (void)
291 throw (::com::sun::star::uno::RuntimeException);
294 private:
295 class Implementation;
296 ::std::auto_ptr<Implementation> mpImpl;
298 ::sd::slidesorter::SlideSorter& mrSlideSorter;
300 ::com::sun::star::uno::Reference<
301 ::com::sun::star::accessibility::XAccessible> mxParent;
303 sal_uInt32 mnClientId;
305 ::Window* mpContentWindow;
307 /** Check whether or not the object has been disposed (or is in the
308 state of beeing disposed). If that is the case then
309 DisposedException is thrown to inform the (indirect) caller of the
310 foul deed.
312 void ThrowIfDisposed (void)
313 throw (::com::sun::star::lang::DisposedException);
315 /** Check whether or not the object has been disposed (or is in the
316 state of beeing disposed).
318 @return sal_True, if the object is disposed or in the course
319 of being disposed. Otherwise, sal_False is returned.
321 sal_Bool IsDisposed (void);
324 } // end of namespace ::accessibility
326 #endif