1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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_ACCESSIBLEPAGESHAPE_HXX
21 #define INCLUDED_SD_SOURCE_UI_INC_ACCESSIBLEPAGESHAPE_HXX
23 #include <svx/AccessibleShape.hxx>
24 #include <svx/AccessibleShapeTreeInfo.hxx>
25 #include <svx/IAccessibleViewForwarderListener.hxx>
26 #include <com/sun/star/accessibility/XAccessible.hpp>
27 #include <com/sun/star/accessibility/XAccessibleExtendedComponent.hpp>
28 #include <com/sun/star/accessibility/AccessibleRole.hpp>
29 #include <com/sun/star/drawing/XDrawPage.hpp>
30 #include <com/sun/star/lang/XEventListener.hpp>
32 #include <svx/AccessibleTextHelper.hxx>
34 namespace accessibility
{
36 /** A page shape represents the actual page as seen on the screen.
38 class AccessiblePageShape
39 : public AccessibleShape
42 //===== internal ========================================================
44 /** Create a new accessible object that makes the given shape accessible.
46 The accessible parent object. It will be used, for example when
47 the <member>getIndexInParent</member> method is called.
49 Bundel of information passed to this shape and all of its desendants.
51 Index used to disambiguate between objects that have the same
52 name. Passing a value of -1 leads to the use of the object's
53 z-order instead. Because that is not a good substitute, better
54 pass an ever increasing counter.
56 Always call the <member>init</member> method after creating a
57 new accessible shape. This is one way to overcome the potential
58 problem of registering the new object with e.g. event
59 broadcasters. That would delete the new object if a broadcaster
60 would not keep a strong reference to the new object.
63 const ::com::sun::star::uno::Reference
<
64 ::com::sun::star::drawing::XDrawPage
>& rxPage
,
65 const ::com::sun::star::uno::Reference
<
66 ::com::sun::star::accessibility::XAccessible
>& rxParent
,
67 const AccessibleShapeTreeInfo
& rShapeTreeInfo
,
70 virtual ~AccessiblePageShape();
72 /** Initialize a new shape. See the documentation of the constructor
73 for the reason of this method's existence.
75 virtual void Init() SAL_OVERRIDE
;
77 //===== XAccessibleContext ==============================================
79 /// Returns always 0 because there can be no children.
80 virtual sal_Int32 SAL_CALL
81 getAccessibleChildCount()
82 throw (std::exception
) SAL_OVERRIDE
;
84 /** Return the specified child.
86 Index of the requested child.
88 Reference of the requested child which is the accessible object
90 @raises IndexOutOfBoundsException
91 Throws always an exception because there are no children.
93 virtual ::com::sun::star::uno::Reference
<
94 ::com::sun::star::accessibility::XAccessible
> SAL_CALL
95 getAccessibleChild (sal_Int32 nIndex
)
96 throw (css::lang::IndexOutOfBoundsException
, css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
98 //===== XAccessibleComponent ============================================
100 virtual ::com::sun::star::awt::Rectangle SAL_CALL
getBounds()
101 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
103 virtual sal_Int32 SAL_CALL
getForeground()
104 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
106 virtual sal_Int32 SAL_CALL
getBackground()
107 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
109 //===== XComponent ======================================================
111 virtual void SAL_CALL
113 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
115 //===== XServiceInfo ====================================================
117 virtual OUString SAL_CALL
118 getImplementationName()
119 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
121 virtual ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
122 getSupportedServiceNames()
123 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
125 //===== lang::XEventListener ============================================
127 virtual void SAL_CALL
128 disposing (const ::com::sun::star::lang::EventObject
& Source
)
129 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
131 using AccessibleShape::disposing
;
134 /** Create a base name string that contains the accessible name.
137 CreateAccessibleBaseName()
138 throw (::com::sun::star::uno::RuntimeException
) SAL_OVERRIDE
;
141 CreateAccessibleName()
142 throw (::com::sun::star::uno::RuntimeException
) SAL_OVERRIDE
;
144 /// Create a description string that contains the accessible description.
146 CreateAccessibleDescription()
147 throw (::com::sun::star::uno::RuntimeException
) SAL_OVERRIDE
;
150 ::com::sun::star::uno::Reference
<
151 ::com::sun::star::drawing::XDrawPage
> mxPage
;
153 AccessiblePageShape (const AccessiblePageShape
&) SAL_DELETED_FUNCTION
;
154 AccessibleShape
& operator= (const AccessiblePageShape
&) SAL_DELETED_FUNCTION
;
157 } // end of namespace accessibility
161 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */