merge the formfield patch from ooo-build
[ooovba.git] / sd / source / ui / inc / AccessibleSlideSorterObject.hxx
blob58210ce505ac76c160a260b873741621cefbcd46
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: AccessibleSlideSorterObject.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_OBJECT_HXX
32 #define SD_ACCESSIBILITY_ACCESSIBLE_SLIDE_SORTER_OBJECT_HXX
34 #include "MutexOwner.hxx"
35 #include <cppuhelper/compbase5.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/awt/XFocusListener.hpp>
42 #include <com/sun/star/lang/XServiceInfo.hpp>
43 #include <com/sun/star/lang/DisposedException.hpp>
45 class SdPage;
47 namespace sd { namespace slidesorter {
48 class SlideSorter;
49 } }
51 namespace accessibility {
54 typedef ::cppu::WeakComponentImplHelper5<
55 ::com::sun::star::accessibility::XAccessible,
56 ::com::sun::star::accessibility::XAccessibleEventBroadcaster,
57 ::com::sun::star::accessibility::XAccessibleContext,
58 ::com::sun::star::accessibility::XAccessibleComponent,
59 ::com::sun::star::lang::XServiceInfo > AccessibleSlideSorterObjectBase;
62 /** This class makes page objects of the slide sorter accessible.
64 class AccessibleSlideSorterObject
65 : public ::sd::MutexOwner,
66 public AccessibleSlideSorterObjectBase
68 public:
69 /** Create a new object that represents a page object in the slide
70 sorter.
71 @param rxParent
72 The accessible parent.
73 @param rSlideSorter
74 The slide sorter whose model manages the page.
75 @param nPageNumber
76 The number of the page in the range [0,nPageCount).
78 AccessibleSlideSorterObject(
79 const ::com::sun::star::uno::Reference<
80 ::com::sun::star::accessibility::XAccessible >& rxParent,
81 ::sd::slidesorter::SlideSorter& rSlideSorter,
82 sal_uInt16 nPageNumber);
83 ~AccessibleSlideSorterObject (void);
85 /** Return the page that is made accessible by the called object.
87 SdPage* GetPage (void) const;
89 /** The page number as given to the constructor.
91 sal_uInt16 GetPageNumber (void) const;
93 void FireAccessibleEvent (
94 short nEventId,
95 const ::com::sun::star::uno::Any& rOldValue,
96 const ::com::sun::star::uno::Any& rNewValue);
98 virtual void SAL_CALL disposing (void);
102 //===== XAccessible =======================================================
104 virtual ::com::sun::star::uno::Reference<
105 ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL
106 getAccessibleContext (void)
107 throw (::com::sun::star::uno::RuntimeException);
110 //===== XAccessibleEventBroadcaster =======================================
111 virtual void SAL_CALL
112 addEventListener(
113 const ::com::sun::star::uno::Reference<
114 ::com::sun::star::accessibility::XAccessibleEventListener >& rxListener)
115 throw (::com::sun::star::uno::RuntimeException);
117 virtual void SAL_CALL
118 removeEventListener(
119 const ::com::sun::star::uno::Reference<
120 ::com::sun::star::accessibility::XAccessibleEventListener >& rxListener )
121 throw (::com::sun::star::uno::RuntimeException);
123 using cppu::WeakComponentImplHelperBase::addEventListener;
124 using cppu::WeakComponentImplHelperBase::removeEventListener;
126 //===== XAccessibleContext ==============================================
128 virtual sal_Int32 SAL_CALL
129 getAccessibleChildCount (void) throw (::com::sun::star::uno::RuntimeException);
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 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL
136 getAccessibleParent (void)
137 throw (::com::sun::star::uno::RuntimeException);
139 virtual sal_Int32 SAL_CALL
140 getAccessibleIndexInParent (void)
141 throw (::com::sun::star::uno::RuntimeException);
143 virtual sal_Int16 SAL_CALL
144 getAccessibleRole (void)
145 throw (::com::sun::star::uno::RuntimeException);
147 virtual ::rtl::OUString SAL_CALL
148 getAccessibleDescription (void)
149 throw (::com::sun::star::uno::RuntimeException);
151 virtual ::rtl::OUString SAL_CALL
152 getAccessibleName (void)
153 throw (::com::sun::star::uno::RuntimeException);
155 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet> SAL_CALL
156 getAccessibleRelationSet (void)
157 throw (::com::sun::star::uno::RuntimeException);
159 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL
160 getAccessibleStateSet (void)
161 throw (::com::sun::star::uno::RuntimeException);
163 virtual ::com::sun::star::lang::Locale SAL_CALL
164 getLocale (void)
165 throw (::com::sun::star::uno::RuntimeException,
166 ::com::sun::star::accessibility::IllegalAccessibleComponentStateException);
169 //===== XAccessibleComponent ================================================
171 virtual sal_Bool SAL_CALL containsPoint (
172 const ::com::sun::star::awt::Point& aPoint)
173 throw (::com::sun::star::uno::RuntimeException);
175 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL
176 getAccessibleAtPoint (
177 const ::com::sun::star::awt::Point& aPoint)
178 throw (::com::sun::star::uno::RuntimeException);
180 virtual ::com::sun::star::awt::Rectangle SAL_CALL getBounds (void)
181 throw (::com::sun::star::uno::RuntimeException);
183 virtual ::com::sun::star::awt::Point SAL_CALL getLocation (void)
184 throw (::com::sun::star::uno::RuntimeException);
186 virtual ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen (void)
187 throw (::com::sun::star::uno::RuntimeException);
189 virtual ::com::sun::star::awt::Size SAL_CALL getSize (void)
190 throw (::com::sun::star::uno::RuntimeException);
192 virtual void SAL_CALL grabFocus (void)
193 throw (::com::sun::star::uno::RuntimeException);
195 virtual sal_Int32 SAL_CALL getForeground (void)
196 throw (::com::sun::star::uno::RuntimeException);
198 virtual sal_Int32 SAL_CALL getBackground (void)
199 throw (::com::sun::star::uno::RuntimeException);
203 //===== XServiceInfo ====================================================
205 /** Returns an identifier for the implementation of this object.
207 virtual ::rtl::OUString SAL_CALL
208 getImplementationName (void)
209 throw (::com::sun::star::uno::RuntimeException);
211 /** Return whether the specified service is supported by this class.
213 virtual sal_Bool SAL_CALL
214 supportsService (const ::rtl::OUString& sServiceName)
215 throw (::com::sun::star::uno::RuntimeException);
217 /** Returns a list of all supported services.
219 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL
220 getSupportedServiceNames (void)
221 throw (::com::sun::star::uno::RuntimeException);
224 private:
225 ::com::sun::star::uno::Reference<
226 ::com::sun::star::accessibility::XAccessible> mxParent;
227 sal_uInt16 mnPageNumber;
228 ::sd::slidesorter::SlideSorter& mrSlideSorter;
229 sal_uInt32 mnClientId;
231 /** Check whether or not the object has been disposed (or is in the
232 state of beeing disposed). If that is the case then
233 DisposedException is thrown to inform the (indirect) caller of the
234 foul deed.
236 void ThrowIfDisposed (void)
237 throw (::com::sun::star::lang::DisposedException);
239 /** Check whether or not the object has been disposed (or is in the
240 state of beeing disposed).
242 @return sal_True, if the object is disposed or in the course
243 of being disposed. Otherwise, sal_False is returned.
245 sal_Bool IsDisposed (void);
250 } // end of namespace ::accessibility
252 #endif