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