bump product version to 5.0.4.1
[LibreOffice.git] / sd / source / ui / inc / AccessibleDrawDocumentView.hxx
blob5552c723c3f01a358e0635a1c95b37e8b0c6355e
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 {
29 /** This class makes draw documents in the general view modes
30 accessible. It passes all shapes on the current draw page to a
31 children manager and additionally creates a new shape that
32 represents the actual draw page.
34 Please see the documentation of the base class for further
35 explanations of the individual methods.
37 class AccessibleDrawDocumentView :
38 public AccessibleDocumentViewBase
39 ,public ::com::sun::star::accessibility::XAccessibleGroupPosition
41 public:
42 //===== internal ========================================================
44 AccessibleDrawDocumentView (::sd::Window* pSdWindow,
45 ::sd::ViewShell* pViewShell,
46 const ::com::sun::star::uno::Reference<
47 ::com::sun::star::frame::XController>& rxController,
48 const ::com::sun::star::uno::Reference<
49 ::com::sun::star::accessibility::XAccessible>& rxParent);
51 virtual ~AccessibleDrawDocumentView();
53 /** Complete the initialization begun in the constructor.
55 virtual void Init() SAL_OVERRIDE;
57 //===== IAccessibleViewForwarderListener ================================
59 virtual void ViewForwarderChanged (ChangeType aChangeType,
60 const IAccessibleViewForwarder* pViewForwarder) SAL_OVERRIDE;
62 //===== XAccessibleContext ==============================================
64 virtual sal_Int32 SAL_CALL
65 getAccessibleChildCount()
66 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
68 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL
69 getAccessibleChild (sal_Int32 nIndex)
70 throw (::com::sun::star::uno::RuntimeException,
71 ::com::sun::star::lang::IndexOutOfBoundsException, std::exception) SAL_OVERRIDE;
73 virtual OUString SAL_CALL
74 getAccessibleName()
75 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
77 //===== lang::XEventListener ============================================
79 virtual void SAL_CALL
80 disposing (const ::com::sun::star::lang::EventObject& rEventObject)
81 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
83 //===== XPropertyChangeListener =========================================
85 virtual void SAL_CALL
86 propertyChange (const ::com::sun::star::beans::PropertyChangeEvent& rEventObject)
87 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
88 //===== XInterface ======================================================
90 virtual com::sun::star::uno::Any SAL_CALL
91 queryInterface (const com::sun::star::uno::Type & rType)
92 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
94 virtual void SAL_CALL
95 acquire()
96 throw () SAL_OVERRIDE;
98 virtual void SAL_CALL
99 release()
100 throw () SAL_OVERRIDE;
102 //===== XAccessibleGroupPosition =========================================
103 virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL
104 getGroupPosition( const ::com::sun::star::uno::Any& rAny )
105 throw (::com::sun::star::uno::RuntimeException,
106 ::com::sun::star::lang::IndexOutOfBoundsException, std::exception) SAL_OVERRIDE;
107 virtual OUString SAL_CALL getObjectLink( const ::com::sun::star::uno::Any& accoject )
108 throw (::com::sun::star::uno::RuntimeException,
109 std::exception) SAL_OVERRIDE;
111 protected:
113 //===== XServiceInfo ====================================================
115 virtual OUString SAL_CALL
116 getImplementationName()
117 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
119 virtual ::com::sun::star::uno::Sequence< OUString> SAL_CALL
120 getSupportedServiceNames()
121 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
123 virtual bool
124 implIsSelected( sal_Int32 nAccessibleChildIndex )
125 throw (::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
127 /** Select or deselect the specified child or all children if the given
128 index has the special value ACCESSIBLE_SELECTION_CHILD_ALL.
129 Selecting or deselecting a child sets or resets the
130 <const>SELECTED</const> state and selects or deslects the UNO shape
131 being made accessible by the child.
132 @param nAccessibleChildIndex
133 Index of the child to select or deselect. If the parameter has
134 the value ACCESSIBLE_SELECTION_CHILD_ALL then all children are
135 selected or deslected.
136 @param bSelect
137 Indicates whether to select or deselect the specified child
138 reps. children.
140 virtual void
141 implSelect( sal_Int32 nAccessibleChildIndex, bool bSelect )
142 throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
143 private:
144 ::sd::ViewShell* mpSdViewSh;
146 protected:
147 /** This object manages the shapes of the represented draw page. It is
148 responsible to determine the visible shapes and create on demand the
149 accessible objects representing them.
151 ChildrenManager* mpChildrenManager;
153 // This method is called from the component helper base class while
154 // disposing.
155 virtual void SAL_CALL disposing() SAL_OVERRIDE;
157 /** Create a shape the represents the page as seen on the screen.
159 rtl::Reference<AccessiblePageShape> CreateDrawPageShape();
161 /// Create an accessible name that contains the current view mode.
162 virtual OUString
163 CreateAccessibleName ()
164 throw (::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
166 /** Create an accessible description that contains the current
167 view mode.
169 virtual OUString
170 CreateAccessibleDescription ()
171 throw (::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
173 /** Make sure that the currently focused shape sends a FOCUSED state
174 change event indicating that it has (regained) the focus.
176 virtual void Activated() SAL_OVERRIDE;
178 /** Make sure that the currently focused shape sends a FOCUSED state
179 change event indicating that it has lost the focus.
181 virtual void Deactivated() SAL_OVERRIDE;
183 virtual void impl_dispose() SAL_OVERRIDE;
185 //===== XAccessibleGetAccFromXShape ============================================
186 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >
187 SAL_CALL getAccFlowTo(const ::com::sun::star::uno::Any& rAny, sal_Int32 nType)
188 throw ( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
189 ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
190 GetSelAccContextInTable();
192 private:
193 void UpdateAccessibleName();
196 } // end of namespace accessibility
198 #endif
200 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */