xref: /aoo41x/main/svx/inc/svx/IAccessibleParent.hxx (revision 9b8096d0)
13334a7e6SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
33334a7e6SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
43334a7e6SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
53334a7e6SAndrew Rist  * distributed with this work for additional information
63334a7e6SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
73334a7e6SAndrew Rist  * to you under the Apache License, Version 2.0 (the
83334a7e6SAndrew Rist  * "License"); you may not use this file except in compliance
93334a7e6SAndrew Rist  * with the License.  You may obtain a copy of the License at
103334a7e6SAndrew Rist  *
113334a7e6SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
123334a7e6SAndrew Rist  *
133334a7e6SAndrew Rist  * Unless required by applicable law or agreed to in writing,
143334a7e6SAndrew Rist  * software distributed under the License is distributed on an
153334a7e6SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
163334a7e6SAndrew Rist  * KIND, either express or implied.  See the License for the
173334a7e6SAndrew Rist  * specific language governing permissions and limitations
183334a7e6SAndrew Rist  * under the License.
193334a7e6SAndrew Rist  *
203334a7e6SAndrew Rist  *************************************************************/
213334a7e6SAndrew Rist 
223334a7e6SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _SVX_ACCESSIBILITY_IACCESSIBLE_PARENT_HXX
25cdf0e10cSrcweir #define _SVX_ACCESSIBILITY_IACCESSIBLE_PARENT_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <com/sun/star/uno/RuntimeException.hpp>
28cdf0e10cSrcweir #include <com/sun/star/drawing/XShape.hpp>
29cdf0e10cSrcweir #include <sal/types.h>
30*9b8096d0SSteve Yin //IAccessibility2 Implementation 2009-----
31*9b8096d0SSteve Yin #ifndef _SVX_ACCESSIBILITY_ACCESSIBLE_SHAPE_MANAGER_HXX
32*9b8096d0SSteve Yin #include "AccessibleControlShape.hxx"
33*9b8096d0SSteve Yin #endif
34*9b8096d0SSteve Yin //-----IAccessibility2 Implementation 2009
35cdf0e10cSrcweir namespace accessibility {
36cdf0e10cSrcweir 
37cdf0e10cSrcweir class AccessibleShape;
38cdf0e10cSrcweir class AccessibleShapeTreeInfo;
39cdf0e10cSrcweir 
40cdf0e10cSrcweir /** This interface contains methods missing from the
41cdf0e10cSrcweir     <type>XAccessibleContext</type> interface that allow the modification of
42cdf0e10cSrcweir     parent/child relationship.
43cdf0e10cSrcweir */
44cdf0e10cSrcweir class IAccessibleParent
45cdf0e10cSrcweir {
46cdf0e10cSrcweir public:
47cdf0e10cSrcweir     /** Allow for a virtual destructor.
48cdf0e10cSrcweir     */
49cdf0e10cSrcweir 	virtual ~IAccessibleParent (void){};
50cdf0e10cSrcweir 
51cdf0e10cSrcweir     /** A call to this method requests the implementor to replace one child
52cdf0e10cSrcweir         with another and send the appropriate notifications.  That are two
53cdf0e10cSrcweir         child events: One notifying the removal of the current child and one
54cdf0e10cSrcweir         about the existence of the new child.  The index of the new child is
55cdf0e10cSrcweir         implementation dependent, i.e. it is not garanteed that the
56cdf0e10cSrcweir         replacement has the same index as the current child has.
57cdf0e10cSrcweir 
58cdf0e10cSrcweir 		<p>A default implementation can just use the ShapeTypeHandler::CreateAccessibleObject
59cdf0e10cSrcweir 		to let a factory create the new instance with the parameters given, and then
60cdf0e10cSrcweir 		place the new shape into the own structures.</p>
61cdf0e10cSrcweir 
62cdf0e10cSrcweir 		@param pCurrentChild
63cdf0e10cSrcweir 			This child is about to be replaced.
64cdf0e10cSrcweir 
65cdf0e10cSrcweir 		@param _rxShape
66cdf0e10cSrcweir 			The UNO shape which the old and new child represent
67cdf0e10cSrcweir 
68cdf0e10cSrcweir 		@param _nIndex
69cdf0e10cSrcweir 			The IndexInParent of the old child. Note that the index in
70cdf0e10cSrcweir 			parent of the replacement is not necessarily the same as
71cdf0e10cSrcweir 			that of the current child.
72cdf0e10cSrcweir 
73cdf0e10cSrcweir 		@param _rShapeTreeInfo
74cdf0e10cSrcweir 			The TreeInfo for the old child.
75cdf0e10cSrcweir 
76cdf0e10cSrcweir 		@return
77cdf0e10cSrcweir            If the replacement has taken place successfully <TRUE/> is
78cdf0e10cSrcweir            returned.  If the replacement can not be carried out or an error
79cdf0e10cSrcweir            occurs that does not result in an exception then <FALSE/> is
80cdf0e10cSrcweir            returned.
81cdf0e10cSrcweir 
82cdf0e10cSrcweir 		@raises RuntimeException
83cdf0e10cSrcweir            in case something went heavily wrong
84cdf0e10cSrcweir     */
85cdf0e10cSrcweir     virtual sal_Bool ReplaceChild (
86cdf0e10cSrcweir         AccessibleShape* pCurrentChild,
87cdf0e10cSrcweir 		const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& _rxShape,
88cdf0e10cSrcweir 		const long _nIndex,
89cdf0e10cSrcweir 		const AccessibleShapeTreeInfo& _rShapeTreeInfo
90cdf0e10cSrcweir 	)	throw (::com::sun::star::uno::RuntimeException) = 0;
91*9b8096d0SSteve Yin 	//IAccessibility2 Implementation 2009-----
92*9b8096d0SSteve Yin 	//Add this method to support Form Controls
93*9b8096d0SSteve Yin 	virtual AccessibleControlShape* GetAccControlShapeFromModel
94*9b8096d0SSteve Yin 		(::com::sun::star::beans::XPropertySet*)
95*9b8096d0SSteve Yin 		throw (::com::sun::star::uno::RuntimeException){return NULL;};
96*9b8096d0SSteve Yin 	virtual  ::com::sun::star::uno::Reference<
97*9b8096d0SSteve Yin             ::com::sun::star::accessibility::XAccessible>
98*9b8096d0SSteve Yin         GetAccessibleCaption (const ::com::sun::star::uno::Reference<
99*9b8096d0SSteve Yin             ::com::sun::star::drawing::XShape>&)
100*9b8096d0SSteve Yin 			throw (::com::sun::star::uno::RuntimeException){return NULL;};
101*9b8096d0SSteve Yin 	virtual sal_Bool IsDocumentSelAll(){ return sal_False; }
102*9b8096d0SSteve Yin 	//-----IAccessibility2 Implementation 2009
103cdf0e10cSrcweir };
104cdf0e10cSrcweir 
105cdf0e10cSrcweir } // end of namespace accessibility
106cdf0e10cSrcweir 
107cdf0e10cSrcweir #endif
108