1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: AccessiblePageShape.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
32 #ifndef _SD_ACCESSIBILITY_ACCESSIBLE_PAGE_SHAPE_HXX
33 #define _SD_ACCESSIBILITY_ACCESSIBLE_PAGE_SHAPE_HXX
35 #include <svx/AccessibleShape.hxx>
36 #include <svx/AccessibleShapeTreeInfo.hxx>
37 #include <svx/IAccessibleViewForwarderListener.hxx>
38 #include <com/sun/star/accessibility/XAccessible.hpp>
39 #include <com/sun/star/accessibility/XAccessibleExtendedComponent.hpp>
40 #include <com/sun/star/accessibility/AccessibleRole.hpp>
41 #include <com/sun/star/drawing/XDrawPage.hpp>
42 #include <com/sun/star/lang/XEventListener.hpp>
44 #include <svx/AccessibleTextHelper.hxx>
46 namespace accessibility
{
48 /** A page shape represents the actual page as seen on the screen.
50 class AccessiblePageShape
51 : public AccessibleShape
54 //===== internal ========================================================
56 /** Create a new accessible object that makes the given shape accessible.
58 The accessible parent object. It will be used, for example when
59 the <member>getIndexInParent</member> method is called.
61 Bundel of information passed to this shape and all of its desendants.
63 Index used to disambiguate between objects that have the same
64 name. Passing a value of -1 leads to the use of the object's
65 z-order instead. Because that is not a good substitute, better
66 pass an ever increasing counter.
68 Always call the <member>init</member> method after creating a
69 new accessible shape. This is one way to overcome the potential
70 problem of registering the new object with e.g. event
71 broadcasters. That would delete the new object if a broadcaster
72 would not keep a strong reference to the new object.
75 const ::com::sun::star::uno::Reference
<
76 ::com::sun::star::drawing::XDrawPage
>& rxPage
,
77 const ::com::sun::star::uno::Reference
<
78 ::com::sun::star::accessibility::XAccessible
>& rxParent
,
79 const AccessibleShapeTreeInfo
& rShapeTreeInfo
,
82 virtual ~AccessiblePageShape (void);
84 /** Initialize a new shape. See the documentation of the constructor
85 for the reason of this method's existence.
87 virtual void Init (void);
89 //===== XAccessibleContext ==============================================
91 /// Returns always 0 because there can be no children.
92 virtual sal_Int32 SAL_CALL
93 getAccessibleChildCount (void)
96 /** Return the specified child.
98 Index of the requested child.
100 Reference of the requested child which is the accessible object
102 @raises IndexOutOfBoundsException
103 Throws always an exception because there are no children.
105 virtual ::com::sun::star::uno::Reference
<
106 ::com::sun::star::accessibility::XAccessible
> SAL_CALL
107 getAccessibleChild (sal_Int32 nIndex
)
108 throw (::com::sun::star::uno::RuntimeException
);
111 //===== XAccessibleComponent ============================================
113 virtual ::com::sun::star::awt::Rectangle SAL_CALL
getBounds (void)
114 throw (::com::sun::star::uno::RuntimeException
);
116 virtual sal_Int32 SAL_CALL
getForeground (void)
117 throw (::com::sun::star::uno::RuntimeException
);
119 virtual sal_Int32 SAL_CALL
getBackground (void)
120 throw (::com::sun::star::uno::RuntimeException
);
122 //===== XComponent ======================================================
124 virtual void SAL_CALL
126 throw (::com::sun::star::uno::RuntimeException
);
129 //===== XServiceInfo ====================================================
131 virtual ::rtl::OUString SAL_CALL
132 getImplementationName (void)
133 throw (::com::sun::star::uno::RuntimeException
);
135 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
136 getSupportedServiceNames (void)
137 throw (::com::sun::star::uno::RuntimeException
);
140 //===== lang::XEventListener ============================================
142 virtual void SAL_CALL
143 disposing (const ::com::sun::star::lang::EventObject
& Source
)
144 throw (::com::sun::star::uno::RuntimeException
);
147 using AccessibleShape::disposing
;
150 /** Create a base name string that contains the accessible name.
152 virtual ::rtl::OUString
153 CreateAccessibleBaseName (void)
154 throw (::com::sun::star::uno::RuntimeException
);
156 virtual ::rtl::OUString
157 CreateAccessibleName (void)
158 throw (::com::sun::star::uno::RuntimeException
);
160 /// Create a description string that contains the accessible description.
161 virtual ::rtl::OUString
162 CreateAccessibleDescription (void)
163 throw (::com::sun::star::uno::RuntimeException
);
166 ::com::sun::star::uno::Reference
<
167 ::com::sun::star::drawing::XDrawPage
> mxPage
;
169 /** Don't use the default constructor. Use the public constructor that
170 takes the original shape and the parent as arguments instead.
172 explicit AccessiblePageShape (void);
173 /// Don't use the copy constructor. Is there any use for it?
174 explicit AccessiblePageShape (const AccessiblePageShape
&);
175 /// Don't use the assignment operator. Do we need this?
176 AccessibleShape
& operator= (const AccessiblePageShape
&);
179 } // end of namespace accessibility