bump product version to 6.3.0.0.beta1
[LibreOffice.git] / sd / source / ui / inc / AccessibleSlideSorterObject.hxx
bloba1c221c0c369deaa7655c79bc5aa26dae9ef8d38
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/compbase.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/XAccessibleEventBroadcaster.hpp>
29 #include <com/sun/star/lang/XServiceInfo.hpp>
31 class SdPage;
33 namespace sd { namespace slidesorter {
34 class SlideSorter;
35 } }
37 namespace accessibility {
39 typedef ::cppu::WeakComponentImplHelper<
40 css::accessibility::XAccessible,
41 css::accessibility::XAccessibleEventBroadcaster,
42 css::accessibility::XAccessibleContext,
43 css::accessibility::XAccessibleComponent,
44 css::lang::XServiceInfo > AccessibleSlideSorterObjectBase;
46 /** This class makes page objects of the slide sorter accessible.
48 class AccessibleSlideSorterObject
49 : public ::sd::MutexOwner,
50 public AccessibleSlideSorterObjectBase
52 public:
53 /** Create a new object that represents a page object in the slide
54 sorter.
55 @param rxParent
56 The accessible parent.
57 @param rSlideSorter
58 The slide sorter whose model manages the page.
59 @param nPageNumber
60 The number of the page in the range [0,nPageCount).
62 AccessibleSlideSorterObject(
63 const css::uno::Reference<css::accessibility::XAccessible >& rxParent,
64 ::sd::slidesorter::SlideSorter& rSlideSorter,
65 sal_uInt16 nPageNumber);
66 virtual ~AccessibleSlideSorterObject() override;
68 /** Return the page that is made accessible by the called object.
70 SdPage* GetPage() const;
72 /** The page number as given to the constructor.
74 sal_uInt16 GetPageNumber() const { return mnPageNumber;}
76 void FireAccessibleEvent (
77 short nEventId,
78 const css::uno::Any& rOldValue,
79 const css::uno::Any& rNewValue);
81 virtual void SAL_CALL disposing() override;
83 //===== XAccessible =======================================================
85 virtual css::uno::Reference<css::accessibility::XAccessibleContext > SAL_CALL
86 getAccessibleContext() override;
88 //===== XAccessibleEventBroadcaster =======================================
89 virtual void SAL_CALL
90 addAccessibleEventListener(
91 const css::uno::Reference<css::accessibility::XAccessibleEventListener >& rxListener) override;
93 virtual void SAL_CALL
94 removeAccessibleEventListener(
95 const css::uno::Reference<css::accessibility::XAccessibleEventListener >& rxListener ) override;
97 //===== XAccessibleContext ==============================================
99 virtual sal_Int32 SAL_CALL
100 getAccessibleChildCount() override;
102 virtual css::uno::Reference< css::accessibility::XAccessible> SAL_CALL
103 getAccessibleChild (sal_Int32 nIndex) override;
105 virtual css::uno::Reference< css::accessibility::XAccessible> SAL_CALL
106 getAccessibleParent() override;
108 virtual sal_Int32 SAL_CALL
109 getAccessibleIndexInParent() override;
111 virtual sal_Int16 SAL_CALL
112 getAccessibleRole() override;
114 virtual OUString SAL_CALL
115 getAccessibleDescription() override;
117 virtual OUString SAL_CALL
118 getAccessibleName() override;
120 virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet> SAL_CALL
121 getAccessibleRelationSet() override;
123 virtual css::uno::Reference< css::accessibility::XAccessibleStateSet> SAL_CALL
124 getAccessibleStateSet() override;
126 virtual css::lang::Locale SAL_CALL
127 getLocale() override;
129 //===== XAccessibleComponent ================================================
131 virtual sal_Bool SAL_CALL containsPoint (
132 const css::awt::Point& aPoint) override;
134 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL
135 getAccessibleAtPoint (
136 const css::awt::Point& aPoint) override;
138 virtual css::awt::Rectangle SAL_CALL getBounds() override;
140 virtual css::awt::Point SAL_CALL getLocation() override;
142 virtual css::awt::Point SAL_CALL getLocationOnScreen() override;
144 virtual css::awt::Size SAL_CALL getSize() override;
146 virtual void SAL_CALL grabFocus() override;
148 virtual sal_Int32 SAL_CALL getForeground() override;
150 virtual sal_Int32 SAL_CALL getBackground() override;
152 //===== XServiceInfo ====================================================
154 /** Returns an identifier for the implementation of this object.
156 virtual OUString SAL_CALL
157 getImplementationName() override;
159 /** Return whether the specified service is supported by this class.
161 virtual sal_Bool SAL_CALL
162 supportsService (const OUString& sServiceName) override;
164 /** Returns a list of all supported services.
166 virtual css::uno::Sequence< OUString> SAL_CALL
167 getSupportedServiceNames() override;
169 private:
170 css::uno::Reference<css::accessibility::XAccessible> mxParent;
171 sal_uInt16 const mnPageNumber;
172 ::sd::slidesorter::SlideSorter& mrSlideSorter;
173 sal_uInt32 mnClientId;
175 /** Check whether or not the object has been disposed (or is in the
176 state of being disposed). If that is the case then
177 DisposedException is thrown to inform the (indirect) caller of the
178 foul deed.
180 @throws css::lang::DisposedException
182 void ThrowIfDisposed();
184 /** Check whether or not the object has been disposed (or is in the
185 state of being disposed).
187 @return sal_True, if the object is disposed or in the course
188 of being disposed. Otherwise, sal_False is returned.
190 bool IsDisposed();
193 } // end of namespace ::accessibility
195 #endif
197 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */