cid#1607171 Data race condition
[LibreOffice.git] / sd / source / ui / inc / AccessibleDrawDocumentView.hxx
blob924723a311203db2cc0ce6cf09185eb64e3c2e45
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 "AccessibleDocumentViewBase.hxx"
24 #include <com/sun/star/accessibility/XAccessibleGroupPosition.hpp>
26 namespace accessibility { class AccessiblePageShape; }
27 namespace accessibility { class ChildrenManager; }
29 namespace accessibility {
31 /** This class makes draw documents in the general view modes
32 accessible. It passes all shapes on the current draw page to a
33 children manager and additionally creates a new shape that
34 represents the actual draw page.
36 Please see the documentation of the base class for further
37 explanations of the individual methods.
39 class AccessibleDrawDocumentView final :
40 public AccessibleDocumentViewBase
41 ,public css::accessibility::XAccessibleGroupPosition
43 public:
44 //===== internal ========================================================
46 AccessibleDrawDocumentView (::sd::Window* pSdWindow,
47 ::sd::ViewShell* pViewShell,
48 const css::uno::Reference<css::frame::XController>& rxController,
49 const css::uno::Reference<css::accessibility::XAccessible>& rxParent);
51 virtual ~AccessibleDrawDocumentView() override;
53 /** Complete the initialization begun in the constructor.
55 virtual void Init() override;
57 //===== IAccessibleViewForwarderListener ================================
59 virtual void ViewForwarderChanged() override;
61 //===== XAccessibleContext ==============================================
63 virtual sal_Int64 SAL_CALL
64 getAccessibleChildCount() override;
66 virtual css::uno::Reference< css::accessibility::XAccessible> SAL_CALL
67 getAccessibleChild (sal_Int64 nIndex) override;
69 virtual OUString SAL_CALL
70 getAccessibleName() override;
72 //===== lang::XEventListener ============================================
74 virtual void SAL_CALL
75 disposing (const css::lang::EventObject& rEventObject) override;
77 //===== XPropertyChangeListener =========================================
79 virtual void SAL_CALL
80 propertyChange (const css::beans::PropertyChangeEvent& rEventObject) override;
81 //===== XInterface ======================================================
83 virtual css::uno::Any SAL_CALL
84 queryInterface (const css::uno::Type & rType) override;
86 virtual void SAL_CALL
87 acquire()
88 noexcept override;
90 virtual void SAL_CALL
91 release()
92 noexcept override;
94 //===== XAccessibleGroupPosition =========================================
95 virtual css::uno::Sequence< sal_Int32 > SAL_CALL
96 getGroupPosition( const css::uno::Any& rAny ) override;
97 virtual OUString SAL_CALL getObjectLink( const css::uno::Any& accoject ) override;
99 private:
101 //===== XServiceInfo ====================================================
103 virtual OUString SAL_CALL
104 getImplementationName() override;
106 virtual css::uno::Sequence< OUString> SAL_CALL
107 getSupportedServiceNames() override;
109 virtual bool
110 implIsSelected( sal_Int64 nAccessibleChildIndex ) override;
112 /** Select or deselect the specified child or all children if the given
113 index has the special value ACCESSIBLE_SELECTION_CHILD_ALL.
114 Selecting or deselecting a child sets or resets the
115 <const>SELECTED</const> state and selects or deselects the UNO shape
116 being made accessible by the child.
117 @param nAccessibleChildIndex
118 Index of the child to select or deselect. If the parameter has
119 the value ACCESSIBLE_SELECTION_CHILD_ALL then all children are
120 selected or deselected.
121 @param bSelect
122 Indicates whether to select or deselect the specified child
123 reps. children.
125 virtual void
126 implSelect( sal_Int64 nAccessibleChildIndex, bool bSelect ) override;
128 ::sd::ViewShell* mpSdViewSh;
130 /** This object manages the shapes of the represented draw page. It is
131 responsible to determine the visible shapes and create on demand the
132 accessible objects representing them.
134 std::unique_ptr<ChildrenManager> mpChildrenManager;
136 // This method is called from the component helper base class while
137 // disposing.
138 virtual void SAL_CALL disposing() override;
140 /** Create a shape the represents the page as seen on the screen.
142 rtl::Reference<AccessiblePageShape> CreateDrawPageShape();
144 /// Create an accessible name that contains the current view mode.
145 virtual OUString
146 CreateAccessibleName () override;
148 /** Make sure that the currently focused shape sends a FOCUSED state
149 change event indicating that it has (regained) the focus.
151 virtual void Activated() override;
153 /** Make sure that the currently focused shape sends a FOCUSED state
154 change event indicating that it has lost the focus.
156 virtual void Deactivated() override;
158 virtual void impl_dispose() override;
160 void UpdateAccessibleName();
163 } // end of namespace accessibility
165 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */