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_OBJECT_HXX
30 : : #define SD_ACCESSIBILITY_ACCESSIBLE_SLIDE_SORTER_OBJECT_HXX
31 : :
32 : : #include "MutexOwner.hxx"
33 : : #include <cppuhelper/compbase5.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/awt/XFocusListener.hpp>
40 : : #include <com/sun/star/lang/XServiceInfo.hpp>
41 : : #include <com/sun/star/lang/DisposedException.hpp>
42 : :
43 : : class SdPage;
44 : :
45 : : namespace sd { namespace slidesorter {
46 : : class SlideSorter;
47 : : } }
48 : :
49 : : namespace accessibility {
50 : :
51 : :
52 : : typedef ::cppu::PartialWeakComponentImplHelper5<
53 : : ::com::sun::star::accessibility::XAccessible,
54 : : ::com::sun::star::accessibility::XAccessibleEventBroadcaster,
55 : : ::com::sun::star::accessibility::XAccessibleContext,
56 : : ::com::sun::star::accessibility::XAccessibleComponent,
57 : : ::com::sun::star::lang::XServiceInfo > AccessibleSlideSorterObjectBase;
58 : :
59 : :
60 : : /** This class makes page objects of the slide sorter accessible.
61 : : */
62 : : class AccessibleSlideSorterObject
63 : : : public ::sd::MutexOwner,
64 : : public AccessibleSlideSorterObjectBase
65 : : {
66 : : public:
67 : : /** Create a new object that represents a page object in the slide
68 : : sorter.
69 : : @param rxParent
70 : : The accessible parent.
71 : : @param rSlideSorter
72 : : The slide sorter whose model manages the page.
73 : : @param nPageNumber
74 : : The number of the page in the range [0,nPageCount).
75 : : */
76 : : AccessibleSlideSorterObject(
77 : : const ::com::sun::star::uno::Reference<
78 : : ::com::sun::star::accessibility::XAccessible >& rxParent,
79 : : ::sd::slidesorter::SlideSorter& rSlideSorter,
80 : : sal_uInt16 nPageNumber);
81 : : ~AccessibleSlideSorterObject (void);
82 : :
83 : : /** Return the page that is made accessible by the called object.
84 : : */
85 : : SdPage* GetPage (void) const;
86 : :
87 : : /** The page number as given to the constructor.
88 : : */
89 : : sal_uInt16 GetPageNumber (void) const;
90 : :
91 : : void FireAccessibleEvent (
92 : : short nEventId,
93 : : const ::com::sun::star::uno::Any& rOldValue,
94 : : const ::com::sun::star::uno::Any& rNewValue);
95 : :
96 : : virtual void SAL_CALL disposing (void);
97 : :
98 : : //===== XComponent ==============================================
99 : :
100 : 0 : virtual void SAL_CALL dispose()throw (::com::sun::star::uno::RuntimeException)
101 : 0 : { WeakComponentImplHelperBase::dispose(); }
102 : 0 : virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & xListener)throw (::com::sun::star::uno::RuntimeException)
103 : 0 : { WeakComponentImplHelperBase::addEventListener(xListener); }
104 : 0 : virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & xListener)throw (::com::sun::star::uno::RuntimeException)
105 : 0 : { WeakComponentImplHelperBase::removeEventListener(xListener); }
106 : :
107 : : //===== XAccessible =======================================================
108 : :
109 : : virtual ::com::sun::star::uno::Reference<
110 : : ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL
111 : : getAccessibleContext (void)
112 : : throw (::com::sun::star::uno::RuntimeException);
113 : :
114 : :
115 : : //===== XAccessibleEventBroadcaster =======================================
116 : : virtual void SAL_CALL
117 : : addEventListener(
118 : : const ::com::sun::star::uno::Reference<
119 : : ::com::sun::star::accessibility::XAccessibleEventListener >& rxListener)
120 : : throw (::com::sun::star::uno::RuntimeException);
121 : :
122 : : virtual void SAL_CALL
123 : : removeEventListener(
124 : : const ::com::sun::star::uno::Reference<
125 : : ::com::sun::star::accessibility::XAccessibleEventListener >& rxListener )
126 : : throw (::com::sun::star::uno::RuntimeException);
127 : :
128 : : //===== XAccessibleContext ==============================================
129 : :
130 : : virtual sal_Int32 SAL_CALL
131 : : getAccessibleChildCount (void) throw (::com::sun::star::uno::RuntimeException);
132 : :
133 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL
134 : : getAccessibleChild (sal_Int32 nIndex)
135 : : throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
136 : :
137 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL
138 : : getAccessibleParent (void)
139 : : throw (::com::sun::star::uno::RuntimeException);
140 : :
141 : : virtual sal_Int32 SAL_CALL
142 : : getAccessibleIndexInParent (void)
143 : : throw (::com::sun::star::uno::RuntimeException);
144 : :
145 : : virtual sal_Int16 SAL_CALL
146 : : getAccessibleRole (void)
147 : : throw (::com::sun::star::uno::RuntimeException);
148 : :
149 : : virtual ::rtl::OUString SAL_CALL
150 : : getAccessibleDescription (void)
151 : : throw (::com::sun::star::uno::RuntimeException);
152 : :
153 : : virtual ::rtl::OUString SAL_CALL
154 : : getAccessibleName (void)
155 : : throw (::com::sun::star::uno::RuntimeException);
156 : :
157 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet> SAL_CALL
158 : : getAccessibleRelationSet (void)
159 : : throw (::com::sun::star::uno::RuntimeException);
160 : :
161 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL
162 : : getAccessibleStateSet (void)
163 : : throw (::com::sun::star::uno::RuntimeException);
164 : :
165 : : virtual ::com::sun::star::lang::Locale SAL_CALL
166 : : getLocale (void)
167 : : throw (::com::sun::star::uno::RuntimeException,
168 : : ::com::sun::star::accessibility::IllegalAccessibleComponentStateException);
169 : :
170 : :
171 : : //===== XAccessibleComponent ================================================
172 : :
173 : : virtual sal_Bool SAL_CALL containsPoint (
174 : : const ::com::sun::star::awt::Point& aPoint)
175 : : throw (::com::sun::star::uno::RuntimeException);
176 : :
177 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL
178 : : getAccessibleAtPoint (
179 : : const ::com::sun::star::awt::Point& aPoint)
180 : : throw (::com::sun::star::uno::RuntimeException);
181 : :
182 : : virtual ::com::sun::star::awt::Rectangle SAL_CALL getBounds (void)
183 : : throw (::com::sun::star::uno::RuntimeException);
184 : :
185 : : virtual ::com::sun::star::awt::Point SAL_CALL getLocation (void)
186 : : throw (::com::sun::star::uno::RuntimeException);
187 : :
188 : : virtual ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen (void)
189 : : throw (::com::sun::star::uno::RuntimeException);
190 : :
191 : : virtual ::com::sun::star::awt::Size SAL_CALL getSize (void)
192 : : throw (::com::sun::star::uno::RuntimeException);
193 : :
194 : : virtual void SAL_CALL grabFocus (void)
195 : : throw (::com::sun::star::uno::RuntimeException);
196 : :
197 : : virtual sal_Int32 SAL_CALL getForeground (void)
198 : : throw (::com::sun::star::uno::RuntimeException);
199 : :
200 : : virtual sal_Int32 SAL_CALL getBackground (void)
201 : : throw (::com::sun::star::uno::RuntimeException);
202 : :
203 : :
204 : :
205 : : //===== XServiceInfo ====================================================
206 : :
207 : : /** Returns an identifier for the implementation of this object.
208 : : */
209 : : virtual ::rtl::OUString SAL_CALL
210 : : getImplementationName (void)
211 : : throw (::com::sun::star::uno::RuntimeException);
212 : :
213 : : /** Return whether the specified service is supported by this class.
214 : : */
215 : : virtual sal_Bool SAL_CALL
216 : : supportsService (const ::rtl::OUString& sServiceName)
217 : : throw (::com::sun::star::uno::RuntimeException);
218 : :
219 : : /** Returns a list of all supported services.
220 : : */
221 : : virtual ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL
222 : : getSupportedServiceNames (void)
223 : : throw (::com::sun::star::uno::RuntimeException);
224 : :
225 : :
226 : : private:
227 : : ::com::sun::star::uno::Reference<
228 : : ::com::sun::star::accessibility::XAccessible> mxParent;
229 : : sal_uInt16 mnPageNumber;
230 : : ::sd::slidesorter::SlideSorter& mrSlideSorter;
231 : : sal_uInt32 mnClientId;
232 : :
233 : : /** Check whether or not the object has been disposed (or is in the
234 : : state of beeing disposed). If that is the case then
235 : : DisposedException is thrown to inform the (indirect) caller of the
236 : : foul deed.
237 : : */
238 : : void ThrowIfDisposed (void)
239 : : throw (::com::sun::star::lang::DisposedException);
240 : :
241 : : /** Check whether or not the object has been disposed (or is in the
242 : : state of beeing disposed).
243 : :
244 : : @return sal_True, if the object is disposed or in the course
245 : : of being disposed. Otherwise, sal_False is returned.
246 : : */
247 : : sal_Bool IsDisposed (void);
248 : : };
249 : :
250 : :
251 : :
252 : : } // end of namespace ::accessibility
253 : :
254 : : #endif
255 : :
256 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|