bump product version to 4.1.6.2
[LibreOffice.git] / sd / source / ui / inc / AccessibleSlideSorterObject.hxx
blob2c51b2251cb9a76f2268143202834d5f729de152
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef SD_ACCESSIBILITY_ACCESSIBLE_SLIDE_SORTER_OBJECT_HXX
21 #define SD_ACCESSIBILITY_ACCESSIBLE_SLIDE_SORTER_OBJECT_HXX
23 #include "MutexOwner.hxx"
24 #include <cppuhelper/compbase5.hxx>
25 #include <com/sun/star/accessibility/XAccessible.hpp>
26 #include <com/sun/star/accessibility/XAccessibleContext.hpp>
27 #include <com/sun/star/accessibility/XAccessibleComponent.hpp>
28 #include <com/sun/star/accessibility/XAccessibleSelection.hpp>
29 #include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
30 #include <com/sun/star/awt/XFocusListener.hpp>
31 #include <com/sun/star/lang/XServiceInfo.hpp>
32 #include <com/sun/star/lang/DisposedException.hpp>
34 class SdPage;
36 namespace sd { namespace slidesorter {
37 class SlideSorter;
38 } }
40 namespace accessibility {
43 typedef ::cppu::PartialWeakComponentImplHelper5<
44 ::com::sun::star::accessibility::XAccessible,
45 ::com::sun::star::accessibility::XAccessibleEventBroadcaster,
46 ::com::sun::star::accessibility::XAccessibleContext,
47 ::com::sun::star::accessibility::XAccessibleComponent,
48 ::com::sun::star::lang::XServiceInfo > AccessibleSlideSorterObjectBase;
51 /** This class makes page objects of the slide sorter accessible.
53 class AccessibleSlideSorterObject
54 : public ::sd::MutexOwner,
55 public AccessibleSlideSorterObjectBase
57 public:
58 /** Create a new object that represents a page object in the slide
59 sorter.
60 @param rxParent
61 The accessible parent.
62 @param rSlideSorter
63 The slide sorter whose model manages the page.
64 @param nPageNumber
65 The number of the page in the range [0,nPageCount).
67 AccessibleSlideSorterObject(
68 const ::com::sun::star::uno::Reference<
69 ::com::sun::star::accessibility::XAccessible >& rxParent,
70 ::sd::slidesorter::SlideSorter& rSlideSorter,
71 sal_uInt16 nPageNumber);
72 ~AccessibleSlideSorterObject (void);
74 /** Return the page that is made accessible by the called object.
76 SdPage* GetPage (void) const;
78 /** The page number as given to the constructor.
80 sal_uInt16 GetPageNumber (void) const;
82 void FireAccessibleEvent (
83 short nEventId,
84 const ::com::sun::star::uno::Any& rOldValue,
85 const ::com::sun::star::uno::Any& rNewValue);
87 virtual void SAL_CALL disposing (void);
89 //===== XComponent ==============================================
91 virtual void SAL_CALL dispose()throw (::com::sun::star::uno::RuntimeException)
92 { WeakComponentImplHelperBase::dispose(); }
93 virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & xListener)throw (::com::sun::star::uno::RuntimeException)
94 { WeakComponentImplHelperBase::addEventListener(xListener); }
95 virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & xListener)throw (::com::sun::star::uno::RuntimeException)
96 { WeakComponentImplHelperBase::removeEventListener(xListener); }
98 //===== XAccessible =======================================================
100 virtual ::com::sun::star::uno::Reference<
101 ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL
102 getAccessibleContext (void)
103 throw (::com::sun::star::uno::RuntimeException);
106 //===== XAccessibleEventBroadcaster =======================================
107 virtual void SAL_CALL
108 addAccessibleEventListener(
109 const ::com::sun::star::uno::Reference<
110 ::com::sun::star::accessibility::XAccessibleEventListener >& rxListener)
111 throw (::com::sun::star::uno::RuntimeException);
113 virtual void SAL_CALL
114 removeAccessibleEventListener(
115 const ::com::sun::star::uno::Reference<
116 ::com::sun::star::accessibility::XAccessibleEventListener >& rxListener )
117 throw (::com::sun::star::uno::RuntimeException);
119 //===== XAccessibleContext ==============================================
121 virtual sal_Int32 SAL_CALL
122 getAccessibleChildCount (void) throw (::com::sun::star::uno::RuntimeException);
124 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL
125 getAccessibleChild (sal_Int32 nIndex)
126 throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
128 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL
129 getAccessibleParent (void)
130 throw (::com::sun::star::uno::RuntimeException);
132 virtual sal_Int32 SAL_CALL
133 getAccessibleIndexInParent (void)
134 throw (::com::sun::star::uno::RuntimeException);
136 virtual sal_Int16 SAL_CALL
137 getAccessibleRole (void)
138 throw (::com::sun::star::uno::RuntimeException);
140 virtual OUString SAL_CALL
141 getAccessibleDescription (void)
142 throw (::com::sun::star::uno::RuntimeException);
144 virtual OUString SAL_CALL
145 getAccessibleName (void)
146 throw (::com::sun::star::uno::RuntimeException);
148 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet> SAL_CALL
149 getAccessibleRelationSet (void)
150 throw (::com::sun::star::uno::RuntimeException);
152 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL
153 getAccessibleStateSet (void)
154 throw (::com::sun::star::uno::RuntimeException);
156 virtual ::com::sun::star::lang::Locale SAL_CALL
157 getLocale (void)
158 throw (::com::sun::star::uno::RuntimeException,
159 ::com::sun::star::accessibility::IllegalAccessibleComponentStateException);
162 //===== XAccessibleComponent ================================================
164 virtual sal_Bool SAL_CALL containsPoint (
165 const ::com::sun::star::awt::Point& aPoint)
166 throw (::com::sun::star::uno::RuntimeException);
168 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL
169 getAccessibleAtPoint (
170 const ::com::sun::star::awt::Point& aPoint)
171 throw (::com::sun::star::uno::RuntimeException);
173 virtual ::com::sun::star::awt::Rectangle SAL_CALL getBounds (void)
174 throw (::com::sun::star::uno::RuntimeException);
176 virtual ::com::sun::star::awt::Point SAL_CALL getLocation (void)
177 throw (::com::sun::star::uno::RuntimeException);
179 virtual ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen (void)
180 throw (::com::sun::star::uno::RuntimeException);
182 virtual ::com::sun::star::awt::Size SAL_CALL getSize (void)
183 throw (::com::sun::star::uno::RuntimeException);
185 virtual void SAL_CALL grabFocus (void)
186 throw (::com::sun::star::uno::RuntimeException);
188 virtual sal_Int32 SAL_CALL getForeground (void)
189 throw (::com::sun::star::uno::RuntimeException);
191 virtual sal_Int32 SAL_CALL getBackground (void)
192 throw (::com::sun::star::uno::RuntimeException);
196 //===== XServiceInfo ====================================================
198 /** Returns an identifier for the implementation of this object.
200 virtual OUString SAL_CALL
201 getImplementationName (void)
202 throw (::com::sun::star::uno::RuntimeException);
204 /** Return whether the specified service is supported by this class.
206 virtual sal_Bool SAL_CALL
207 supportsService (const OUString& sServiceName)
208 throw (::com::sun::star::uno::RuntimeException);
210 /** Returns a list of all supported services.
212 virtual ::com::sun::star::uno::Sequence< OUString> SAL_CALL
213 getSupportedServiceNames (void)
214 throw (::com::sun::star::uno::RuntimeException);
217 private:
218 ::com::sun::star::uno::Reference<
219 ::com::sun::star::accessibility::XAccessible> mxParent;
220 sal_uInt16 mnPageNumber;
221 ::sd::slidesorter::SlideSorter& mrSlideSorter;
222 sal_uInt32 mnClientId;
224 /** Check whether or not the object has been disposed (or is in the
225 state of beeing disposed). If that is the case then
226 DisposedException is thrown to inform the (indirect) caller of the
227 foul deed.
229 void ThrowIfDisposed (void)
230 throw (::com::sun::star::lang::DisposedException);
232 /** Check whether or not the object has been disposed (or is in the
233 state of beeing disposed).
235 @return sal_True, if the object is disposed or in the course
236 of being disposed. Otherwise, sal_False is returned.
238 sal_Bool IsDisposed (void);
243 } // end of namespace ::accessibility
245 #endif
247 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */