LibreOffice Module editeng (master) 1
AccessibleImageBullet.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
22#include <rtl/ref.hxx>
23#include <tools/gen.hxx>
25
26#include <com/sun/star/uno/Reference.hxx>
27#include <com/sun/star/lang/XServiceInfo.hpp>
28#include <com/sun/star/accessibility/XAccessible.hpp>
29#include <com/sun/star/accessibility/XAccessibleContext.hpp>
30#include <com/sun/star/accessibility/XAccessibleComponent.hpp>
31#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
32
33class SvxEditSource;
36
37namespace accessibility
38{
39 typedef ::cppu::WeakImplHelper< css::accessibility::XAccessible,
40 css::accessibility::XAccessibleContext,
41 css::accessibility::XAccessibleComponent,
42 css::accessibility::XAccessibleEventBroadcaster,
43 css::lang::XServiceInfo > AccessibleImageBulletInterfaceBase;
44
48 {
49
50 public:
52 AccessibleImageBullet ( css::uno::Reference< css::accessibility::XAccessible > xParent );
53
54 virtual ~AccessibleImageBullet () override;
55
56 // XAccessible
57 virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) override;
58
59 // XAccessibleContext
60 virtual sal_Int64 SAL_CALL getAccessibleChildCount() override;
61 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int64 i ) override;
62 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override;
63 virtual sal_Int64 SAL_CALL getAccessibleIndexInParent() override;
64 virtual sal_Int16 SAL_CALL getAccessibleRole() override;
65 virtual OUString SAL_CALL getAccessibleDescription() override;
66 virtual OUString SAL_CALL getAccessibleName() override;
67 virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() override;
68 virtual sal_Int64 SAL_CALL getAccessibleStateSet() override;
69 virtual css::lang::Locale SAL_CALL getLocale() override;
70
71 // XAccessibleEventBroadcaster
72 virtual void SAL_CALL addAccessibleEventListener( const css::uno::Reference< css::accessibility::XAccessibleEventListener >& xListener ) override;
73 virtual void SAL_CALL removeAccessibleEventListener( const css::uno::Reference< css::accessibility::XAccessibleEventListener >& xListener ) override;
74
75 // XAccessibleComponent
76 virtual sal_Bool SAL_CALL containsPoint( const css::awt::Point& aPoint ) override;
77 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) override;
78 virtual css::awt::Rectangle SAL_CALL getBounds( ) override;
79 virtual css::awt::Point SAL_CALL getLocation( ) override;
80 virtual css::awt::Point SAL_CALL getLocationOnScreen( ) override;
81 virtual css::awt::Size SAL_CALL getSize( ) override;
82 virtual void SAL_CALL grabFocus( ) override;
83 virtual sal_Int32 SAL_CALL getForeground( ) override;
84 virtual sal_Int32 SAL_CALL getBackground( ) override;
85
86 // XServiceInfo
87 virtual OUString SAL_CALL getImplementationName() override;
88 virtual sal_Bool SAL_CALL supportsService (const OUString& sServiceName) override;
89 virtual css::uno::Sequence< OUString> SAL_CALL getSupportedServiceNames() override;
90
98 void SetIndexInParent( sal_Int32 nIndex );
99
107 void SetEEOffset( const Point& rOffset );
108
116 void SetEditSource( SvxEditSource* pEditSource );
117
122 void Dispose();
123
131 void SetParagraphIndex( sal_Int32 nIndex );
132
140 sal_Int32 GetParagraphIndex() const { return mnParagraphIndex; }
141
143 void FireEvent(const sal_Int16 nEventId, const css::uno::Any& rNewValue, const css::uno::Any& rOldValue = css::uno::Any() ) const;
144
145 private:
148
149 // maintain state set and send STATE_CHANGE events
150 void SetState( const sal_Int64 nStateId );
151 void UnSetState( const sal_Int64 nStateId );
152
154
156
165
174
175 css::awt::Rectangle implGetBounds();
176
177 // the paragraph index in the edit engine (guarded by solar mutex)
179
180 // our current index in the parent (guarded by solar mutex)
182
183 // the current edit source (guarded by solar mutex)
185
186 // the offset of the underlying EditEngine from the shape/cell (guarded by solar mutex)
188
189 // the current state set (updated from SetState/UnSetState and guarded by solar mutex)
190 sal_Int64 mnStateSet = 0;
191
193 css::uno::Reference< css::accessibility::XAccessible > mxParent;
194
197 };
198
199} // end of namespace accessibility
200
201/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Wrapper class for unified EditEngine/Outliner access.
Definition: unoedsrc.hxx:56
Contains an EditEngine or an Outliner and unifies access to them.
Definition: unoedsrc.hxx:142
Encapsulates the document view for the purpose of unified EditEngine/Outliner access.
Definition: unoedsrc.hxx:452
This class implements the image bullets for the EditEngine/Outliner UAA.
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
void SetEEOffset(const Point &rOffset)
Set the edit engine offset.
css::uno::Reference< css::accessibility::XAccessible > mxParent
The shape we're the accessible for (unguarded)
sal_Int32 GetParagraphIndex() const
Query the current paragraph number (0 - nParas-1)
void SetIndexInParent(sal_Int32 nIndex)
Set the current index in the accessibility parent.
virtual OUString SAL_CALL getAccessibleName() override
virtual sal_Int16 SAL_CALL getAccessibleRole() override
AccessibleImageBullet & operator=(const AccessibleImageBullet &)=delete
virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() override
virtual sal_Bool SAL_CALL containsPoint(const css::awt::Point &aPoint) override
virtual void SAL_CALL addAccessibleEventListener(const css::uno::Reference< css::accessibility::XAccessibleEventListener > &xListener) override
virtual css::awt::Point SAL_CALL getLocation() override
void FireEvent(const sal_Int16 nEventId, const css::uno::Any &rNewValue, const css::uno::Any &rOldValue=css::uno::Any()) const
Calls all Listener objects to tell them the change. Don't hold locks when calling this!
virtual css::awt::Rectangle SAL_CALL getBounds() override
virtual OUString SAL_CALL getImplementationName() override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override
virtual void SAL_CALL removeAccessibleEventListener(const css::uno::Reference< css::accessibility::XAccessibleEventListener > &xListener) override
SvxTextForwarder & GetTextForwarder() const
Query the SvxTextForwarder for EditEngine access.
int mnNotifierClientId
Our listeners (guarded by maMutex)
void SetEditSource(SvxEditSource *pEditSource)
Set the EditEngine offset.
void SetState(const sal_Int64 nStateId)
virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext() override
virtual OUString SAL_CALL getAccessibleDescription() override
AccessibleImageBullet(const AccessibleImageBullet &)=delete
virtual sal_Int64 SAL_CALL getAccessibleStateSet() override
void SetParagraphIndex(sal_Int32 nIndex)
Set the current paragraph number.
void UnSetState(const sal_Int64 nStateId)
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(const css::awt::Point &aPoint) override
virtual css::awt::Point SAL_CALL getLocationOnScreen() override
virtual sal_Int32 SAL_CALL getBackground() override
virtual css::lang::Locale SAL_CALL getLocale() override
virtual void SAL_CALL grabFocus() override
virtual sal_Int64 SAL_CALL getAccessibleChildCount() override
virtual sal_Bool SAL_CALL supportsService(const OUString &sServiceName) override
SvxViewForwarder & GetViewForwarder() const
Query the SvxViewForwarder for EditEngine access.
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int64 i) override
virtual sal_Int64 SAL_CALL getAccessibleIndexInParent() override
virtual sal_Int32 SAL_CALL getForeground() override
AccessibleImageBullet(css::uno::Reference< css::accessibility::XAccessible > xParent)
Create accessible object for given parent.
virtual css::awt::Size SAL_CALL getSize() override
::cppu::WeakImplHelper< css::accessibility::XAccessible, css::accessibility::XAccessibleContext, css::accessibility::XAccessibleComponent, css::accessibility::XAccessibleEventBroadcaster, css::lang::XServiceInfo > AccessibleImageBulletInterfaceBase
unsigned char sal_Bool