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