nss: upgrade to release 3.73
[LibreOffice.git] / editeng / source / accessibility / AccessibleImageBullet.hxx
blobb1041ce4aa56e23aec61a8796605e164b69bcab4
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 #pragma once
22 #include <tools/gen.hxx>
23 #include <cppuhelper/implbase.hxx>
25 #include <com/sun/star/uno/Reference.hxx>
26 #include <com/sun/star/lang/XServiceInfo.hpp>
27 #include <com/sun/star/accessibility/XAccessible.hpp>
28 #include <com/sun/star/accessibility/XAccessibleContext.hpp>
29 #include <com/sun/star/accessibility/XAccessibleComponent.hpp>
30 #include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
32 class SvxEditSource;
33 class SvxTextForwarder;
34 class SvxViewForwarder;
36 namespace accessibility
38 typedef ::cppu::WeakImplHelper< css::accessibility::XAccessible,
39 css::accessibility::XAccessibleContext,
40 css::accessibility::XAccessibleComponent,
41 css::accessibility::XAccessibleEventBroadcaster,
42 css::lang::XServiceInfo > AccessibleImageBulletInterfaceBase;
44 /** This class implements the image bullets for the EditEngine/Outliner UAA
46 class AccessibleImageBullet final : public AccessibleImageBulletInterfaceBase
49 public:
50 /// Create accessible object for given parent
51 AccessibleImageBullet ( const css::uno::Reference< css::accessibility::XAccessible >& rParent );
53 virtual ~AccessibleImageBullet () override;
55 // XAccessible
56 virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) override;
58 // XAccessibleContext
59 virtual sal_Int32 SAL_CALL getAccessibleChildCount() override;
60 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) override;
61 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override;
62 virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() override;
63 virtual sal_Int16 SAL_CALL getAccessibleRole() override;
64 virtual OUString SAL_CALL getAccessibleDescription() override;
65 virtual OUString SAL_CALL getAccessibleName() override;
66 virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() override;
67 virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet() override;
68 virtual css::lang::Locale SAL_CALL getLocale() override;
70 // XAccessibleEventBroadcaster
71 virtual void SAL_CALL addAccessibleEventListener( const css::uno::Reference< css::accessibility::XAccessibleEventListener >& xListener ) override;
72 virtual void SAL_CALL removeAccessibleEventListener( const css::uno::Reference< css::accessibility::XAccessibleEventListener >& xListener ) override;
74 // XAccessibleComponent
75 virtual sal_Bool SAL_CALL containsPoint( const css::awt::Point& aPoint ) override;
76 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) override;
77 virtual css::awt::Rectangle SAL_CALL getBounds( ) override;
78 virtual css::awt::Point SAL_CALL getLocation( ) override;
79 virtual css::awt::Point SAL_CALL getLocationOnScreen( ) override;
80 virtual css::awt::Size SAL_CALL getSize( ) override;
81 virtual void SAL_CALL grabFocus( ) override;
82 virtual sal_Int32 SAL_CALL getForeground( ) override;
83 virtual sal_Int32 SAL_CALL getBackground( ) override;
85 // XServiceInfo
86 virtual OUString SAL_CALL getImplementationName() override;
87 virtual sal_Bool SAL_CALL supportsService (const OUString& sServiceName) override;
88 virtual css::uno::Sequence< OUString> SAL_CALL getSupportedServiceNames() override;
90 /** Set the current index in the accessibility parent
92 @attention This method does not lock the SolarMutex,
93 leaving that to the calling code. This is because only
94 there potential deadlock situations can be resolved. Thus,
95 make sure SolarMutex is locked when calling this.
97 void SetIndexInParent( sal_Int32 nIndex );
99 /** Set the edit engine offset
101 @attention This method does not lock the SolarMutex,
102 leaving that to the calling code. This is because only
103 there potential deadlock situations can be resolved. Thus,
104 make sure SolarMutex is locked when calling this.
106 void SetEEOffset( const Point& rOffset );
108 /** Set the EditEngine offset
110 @attention This method does not lock the SolarMutex,
111 leaving that to the calling code. This is because only
112 there potential deadlock situations can be resolved. Thus,
113 make sure SolarMutex is locked when calling this.
115 void SetEditSource( SvxEditSource* pEditSource );
117 /** Dispose this object
119 Notifies and deregisters the listeners, drops all references.
121 void Dispose();
123 /** Set the current paragraph number
125 @attention This method does not lock the SolarMutex,
126 leaving that to the calling code. This is because only
127 there potential deadlock situations can be resolved. Thus,
128 make sure SolarMutex is locked when calling this.
130 void SetParagraphIndex( sal_Int32 nIndex );
132 /** Query the current paragraph number (0 - nParas-1)
134 @attention This method does not lock the SolarMutex,
135 leaving that to the calling code. This is because only
136 there potential deadlock situations can be resolved. Thus,
137 make sure SolarMutex is locked when calling this.
139 sal_Int32 GetParagraphIndex() const { return mnParagraphIndex; }
141 /// Calls all Listener objects to tell them the change. Don't hold locks when calling this!
142 void FireEvent(const sal_Int16 nEventId, const css::uno::Any& rNewValue, const css::uno::Any& rOldValue = css::uno::Any() ) const;
144 private:
145 AccessibleImageBullet( const AccessibleImageBullet& ) = delete;
146 AccessibleImageBullet& operator= ( const AccessibleImageBullet& ) = delete;
148 // maintain state set and send STATE_CHANGE events
149 void SetState( const sal_Int16 nStateId );
150 void UnSetState( const sal_Int16 nStateId );
152 SvxEditSource& GetEditSource() const;
154 int getNotifierClientId() const { return mnNotifierClientId; }
156 /** Query the SvxTextForwarder for EditEngine access.
158 @attention This method does not lock the SolarMutex,
159 leaving that to the calling code. This is because only
160 there potential deadlock situations can be resolved. Thus,
161 make sure SolarMutex is locked when calling this.
163 SvxTextForwarder& GetTextForwarder() const;
165 /** Query the SvxViewForwarder for EditEngine access.
167 @attention This method does not lock the SolarMutex,
168 leaving that to the calling code. This is because only
169 there potential deadlock situations can be resolved. Thus,
170 make sure SolarMutex is locked when calling this.
172 SvxViewForwarder& GetViewForwarder() const;
174 css::awt::Rectangle implGetBounds();
176 // the paragraph index in the edit engine (guarded by solar mutex)
177 sal_Int32 mnParagraphIndex;
179 // our current index in the parent (guarded by solar mutex)
180 sal_Int32 mnIndexInParent;
182 // the current edit source (guarded by solar mutex)
183 SvxEditSource* mpEditSource;
185 // the offset of the underlying EditEngine from the shape/cell (guarded by solar mutex)
186 Point maEEOffset;
188 // the current state set (updated from SetState/UnSetState and guarded by solar mutex)
189 css::uno::Reference< css::accessibility::XAccessibleStateSet > mxStateSet;
191 /// The shape we're the accessible for (unguarded)
192 css::uno::Reference< css::accessibility::XAccessible > mxParent;
194 /// Our listeners (guarded by maMutex)
195 int mnNotifierClientId;
198 } // end of namespace accessibility
200 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */