bump product version to 6.3.0.0.beta1
[LibreOffice.git] / sd / source / ui / inc / AccessibleDrawDocumentView.hxx
blobfd8b42f7161fd3033c7d62e4447cab96b8ceb700
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_ACCESSIBLEDRAWDOCUMENTVIEW_HXX
21 #define INCLUDED_SD_SOURCE_UI_INC_ACCESSIBLEDRAWDOCUMENTVIEW_HXX
23 #include "AccessibleDocumentViewBase.hxx"
25 #include <com/sun/star/accessibility/XAccessibleGroupPosition.hpp>
27 namespace accessibility { class AccessiblePageShape; }
28 namespace accessibility { class ChildrenManager; }
30 namespace accessibility {
32 /** This class makes draw documents in the general view modes
33 accessible. It passes all shapes on the current draw page to a
34 children manager and additionally creates a new shape that
35 represents the actual draw page.
37 Please see the documentation of the base class for further
38 explanations of the individual methods.
40 class AccessibleDrawDocumentView final :
41 public AccessibleDocumentViewBase
42 ,public css::accessibility::XAccessibleGroupPosition
44 public:
45 //===== internal ========================================================
47 AccessibleDrawDocumentView (::sd::Window* pSdWindow,
48 ::sd::ViewShell* pViewShell,
49 const css::uno::Reference<css::frame::XController>& rxController,
50 const css::uno::Reference<css::accessibility::XAccessible>& rxParent);
52 virtual ~AccessibleDrawDocumentView() override;
54 /** Complete the initialization begun in the constructor.
56 virtual void Init() override;
58 //===== IAccessibleViewForwarderListener ================================
60 virtual void ViewForwarderChanged() override;
62 //===== XAccessibleContext ==============================================
64 virtual sal_Int32 SAL_CALL
65 getAccessibleChildCount() override;
67 virtual css::uno::Reference< css::accessibility::XAccessible> SAL_CALL
68 getAccessibleChild (sal_Int32 nIndex) override;
70 virtual OUString SAL_CALL
71 getAccessibleName() override;
73 //===== lang::XEventListener ============================================
75 virtual void SAL_CALL
76 disposing (const css::lang::EventObject& rEventObject) override;
78 //===== XPropertyChangeListener =========================================
80 virtual void SAL_CALL
81 propertyChange (const css::beans::PropertyChangeEvent& rEventObject) override;
82 //===== XInterface ======================================================
84 virtual css::uno::Any SAL_CALL
85 queryInterface (const css::uno::Type & rType) override;
87 virtual void SAL_CALL
88 acquire()
89 throw () override;
91 virtual void SAL_CALL
92 release()
93 throw () override;
95 //===== XAccessibleGroupPosition =========================================
96 virtual css::uno::Sequence< sal_Int32 > SAL_CALL
97 getGroupPosition( const css::uno::Any& rAny ) override;
98 virtual OUString SAL_CALL getObjectLink( const css::uno::Any& accoject ) override;
100 private:
102 //===== XServiceInfo ====================================================
104 virtual OUString SAL_CALL
105 getImplementationName() override;
107 virtual css::uno::Sequence< OUString> SAL_CALL
108 getSupportedServiceNames() override;
110 virtual bool
111 implIsSelected( sal_Int32 nAccessibleChildIndex ) override;
113 /** Select or deselect the specified child or all children if the given
114 index has the special value ACCESSIBLE_SELECTION_CHILD_ALL.
115 Selecting or deselecting a child sets or resets the
116 <const>SELECTED</const> state and selects or deselects the UNO shape
117 being made accessible by the child.
118 @param nAccessibleChildIndex
119 Index of the child to select or deselect. If the parameter has
120 the value ACCESSIBLE_SELECTION_CHILD_ALL then all children are
121 selected or deselected.
122 @param bSelect
123 Indicates whether to select or deselect the specified child
124 reps. children.
126 virtual void
127 implSelect( sal_Int32 nAccessibleChildIndex, bool bSelect ) override;
129 ::sd::ViewShell* const mpSdViewSh;
131 /** This object manages the shapes of the represented draw page. It is
132 responsible to determine the visible shapes and create on demand the
133 accessible objects representing them.
135 std::unique_ptr<ChildrenManager> mpChildrenManager;
137 // This method is called from the component helper base class while
138 // disposing.
139 virtual void SAL_CALL disposing() override;
141 /** Create a shape the represents the page as seen on the screen.
143 rtl::Reference<AccessiblePageShape> CreateDrawPageShape();
145 /// Create an accessible name that contains the current view mode.
146 virtual OUString
147 CreateAccessibleName () override;
149 /** Make sure that the currently focused shape sends a FOCUSED state
150 change event indicating that it has (regained) the focus.
152 virtual void Activated() override;
154 /** Make sure that the currently focused shape sends a FOCUSED state
155 change event indicating that it has lost the focus.
157 virtual void Deactivated() override;
159 virtual void impl_dispose() override;
161 //===== XAccessibleGetAccFromXShape ============================================
162 css::uno::Sequence< css::uno::Any >
163 SAL_CALL getAccFlowTo(const css::uno::Any& rAny, sal_Int32 nType) override;
164 css::uno::Reference< css::accessibility::XAccessible >
165 GetSelAccContextInTable();
167 void UpdateAccessibleName();
170 } // end of namespace accessibility
172 #endif
174 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */