bump product version to 5.0.4.1
[LibreOffice.git] / sd / source / ui / inc / AccessibleSlideSorterObject.hxx
blob9464ac14de06edd5c5d4634ec1c2c14158412203
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 INCLUDED_SD_SOURCE_UI_INC_ACCESSIBLESLIDESORTEROBJECT_HXX
21 #define INCLUDED_SD_SOURCE_UI_INC_ACCESSIBLESLIDESORTEROBJECT_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 {
42 typedef ::cppu::WeakComponentImplHelper5<
43 ::com::sun::star::accessibility::XAccessible,
44 ::com::sun::star::accessibility::XAccessibleEventBroadcaster,
45 ::com::sun::star::accessibility::XAccessibleContext,
46 ::com::sun::star::accessibility::XAccessibleComponent,
47 ::com::sun::star::lang::XServiceInfo > AccessibleSlideSorterObjectBase;
49 /** This class makes page objects of the slide sorter accessible.
51 class AccessibleSlideSorterObject
52 : public ::sd::MutexOwner,
53 public AccessibleSlideSorterObjectBase
55 public:
56 /** Create a new object that represents a page object in the slide
57 sorter.
58 @param rxParent
59 The accessible parent.
60 @param rSlideSorter
61 The slide sorter whose model manages the page.
62 @param nPageNumber
63 The number of the page in the range [0,nPageCount).
65 AccessibleSlideSorterObject(
66 const ::com::sun::star::uno::Reference<
67 ::com::sun::star::accessibility::XAccessible >& rxParent,
68 ::sd::slidesorter::SlideSorter& rSlideSorter,
69 sal_uInt16 nPageNumber);
70 virtual ~AccessibleSlideSorterObject();
72 /** Return the page that is made accessible by the called object.
74 SdPage* GetPage() const;
76 /** The page number as given to the constructor.
78 sal_uInt16 GetPageNumber() const { return mnPageNumber;}
80 void FireAccessibleEvent (
81 short nEventId,
82 const ::com::sun::star::uno::Any& rOldValue,
83 const ::com::sun::star::uno::Any& rNewValue);
85 virtual void SAL_CALL disposing() SAL_OVERRIDE;
87 //===== XAccessible =======================================================
89 virtual ::com::sun::star::uno::Reference<
90 ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL
91 getAccessibleContext()
92 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
94 //===== XAccessibleEventBroadcaster =======================================
95 virtual void SAL_CALL
96 addAccessibleEventListener(
97 const ::com::sun::star::uno::Reference<
98 ::com::sun::star::accessibility::XAccessibleEventListener >& rxListener)
99 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
101 virtual void SAL_CALL
102 removeAccessibleEventListener(
103 const ::com::sun::star::uno::Reference<
104 ::com::sun::star::accessibility::XAccessibleEventListener >& rxListener )
105 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
107 //===== XAccessibleContext ==============================================
109 virtual sal_Int32 SAL_CALL
110 getAccessibleChildCount() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
112 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL
113 getAccessibleChild (sal_Int32 nIndex)
114 throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
116 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL
117 getAccessibleParent()
118 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
120 virtual sal_Int32 SAL_CALL
121 getAccessibleIndexInParent()
122 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
124 virtual sal_Int16 SAL_CALL
125 getAccessibleRole()
126 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
128 virtual OUString SAL_CALL
129 getAccessibleDescription()
130 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
132 virtual OUString SAL_CALL
133 getAccessibleName()
134 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
136 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet> SAL_CALL
137 getAccessibleRelationSet()
138 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
140 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL
141 getAccessibleStateSet()
142 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
144 virtual ::com::sun::star::lang::Locale SAL_CALL
145 getLocale()
146 throw (::com::sun::star::uno::RuntimeException,
147 ::com::sun::star::accessibility::IllegalAccessibleComponentStateException, std::exception) SAL_OVERRIDE;
149 //===== XAccessibleComponent ================================================
151 virtual sal_Bool SAL_CALL containsPoint (
152 const ::com::sun::star::awt::Point& aPoint)
153 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
155 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL
156 getAccessibleAtPoint (
157 const ::com::sun::star::awt::Point& aPoint)
158 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
160 virtual ::com::sun::star::awt::Rectangle SAL_CALL getBounds()
161 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
163 virtual ::com::sun::star::awt::Point SAL_CALL getLocation()
164 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
166 virtual ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen()
167 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
169 virtual ::com::sun::star::awt::Size SAL_CALL getSize()
170 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
172 virtual void SAL_CALL grabFocus()
173 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
175 virtual sal_Int32 SAL_CALL getForeground()
176 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
178 virtual sal_Int32 SAL_CALL getBackground()
179 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
181 //===== XServiceInfo ====================================================
183 /** Returns an identifier for the implementation of this object.
185 virtual OUString SAL_CALL
186 getImplementationName()
187 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
189 /** Return whether the specified service is supported by this class.
191 virtual sal_Bool SAL_CALL
192 supportsService (const OUString& sServiceName)
193 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
195 /** Returns a list of all supported services.
197 virtual ::com::sun::star::uno::Sequence< OUString> SAL_CALL
198 getSupportedServiceNames()
199 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
201 private:
202 ::com::sun::star::uno::Reference<
203 ::com::sun::star::accessibility::XAccessible> mxParent;
204 sal_uInt16 mnPageNumber;
205 ::sd::slidesorter::SlideSorter& mrSlideSorter;
206 sal_uInt32 mnClientId;
208 /** Check whether or not the object has been disposed (or is in the
209 state of being disposed). If that is the case then
210 DisposedException is thrown to inform the (indirect) caller of the
211 foul deed.
213 void ThrowIfDisposed()
214 throw (::com::sun::star::lang::DisposedException);
216 /** Check whether or not the object has been disposed (or is in the
217 state of being disposed).
219 @return sal_True, if the object is disposed or in the course
220 of being disposed. Otherwise, sal_False is returned.
222 bool IsDisposed();
225 } // end of namespace ::accessibility
227 #endif
229 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */