1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _SVX_ACCESSIBILITY_ACCESSIBLE_SHAPE_INFO_HXX
25 #define _SVX_ACCESSIBILITY_ACCESSIBLE_SHAPE_INFO_HXX
26 
27 #include <com/sun/star/drawing/XShape.hpp>
28 #include <com/sun/star/accessibility/XAccessible.hpp>
29 #include <svx/IAccessibleParent.hxx>
30 #include "svx/svxdllapi.h"
31 
32 namespace accessibility {
33 
34 /** @descr
35         This class is a container for the information specific for a single
36         shape that is passed to the constructor of that shape.  It allows to
37         separate the class definitions of the shapes from the information
38         needed on construction.  Only the shapes' implementation has to be
39         adapted to a modified <type>AccessibleShapeInfo</type> definition.
40 
41         <p>Note that this class complements the
42         <type>AccessibleShapeTreeInfo</type> interface which contains
43         information that is passed to all shapes in a subtree not just to a
44         single shape. </p>
45 */
46 class SVX_DLLPUBLIC AccessibleShapeInfo
47 {
48 public:
49     /** The shape itself for which an accessible object is to be
50         constructed.
51     */
52     ::com::sun::star::uno::Reference<
53         ::com::sun::star::drawing::XShape> mxShape;
54 
55     /** The accessible parent object of the shape.
56     */
57     ::com::sun::star::uno::Reference<
58         ::com::sun::star::accessibility::XAccessible> mxParent;
59 
60     /** This object that may be realized by the same implementation as that
61         of that of <member>mxParent</member> can be used to modify
62         parent/child relationships with the shape as initiator.
63         Note that NULL is a valid value for this member.
64     */
65     IAccessibleParent* mpChildrenManager;
66 
67     /** This index is used to disambiguate names of accessible objects. A
68         value of (the default) -1 leads to the use of the object's z-order
69         instead.  Because that is not a good substitute, better pass an ever
70         increasing counter.
71     */
72     sal_Int32 mnIndex;
73 
74     /** Copy the given values into the members described above.
75     */
76     AccessibleShapeInfo (
77         const ::com::sun::star::uno::Reference<
78             ::com::sun::star::drawing::XShape>& rxShape,
79         const ::com::sun::star::uno::Reference<
80             ::com::sun::star::accessibility::XAccessible>& rxParent,
81         IAccessibleParent* pChildrenManager,
82         sal_Int32 nIndex = -1);
83 
84     /** Copy the given values into the members described above.
85         The accessible parent implementation object is set to NULL.
86     */
87     AccessibleShapeInfo (
88         const ::com::sun::star::uno::Reference<
89             ::com::sun::star::drawing::XShape>& rxShape,
90         const ::com::sun::star::uno::Reference<
91             ::com::sun::star::accessibility::XAccessible>& rxParent,
92         sal_Int32 nIndex = -1);
93 
94     ~AccessibleShapeInfo (void);
95 
96     AccessibleShapeInfo (const AccessibleShapeInfo&);
97 private:
98     // Don't use these three methods.
99     SVX_DLLPRIVATE explicit AccessibleShapeInfo (void);
100     SVX_DLLPRIVATE AccessibleShapeInfo& operator= (const AccessibleShapeInfo&);
101 };
102 
103 } // end of namespace accessibility
104 
105 #endif
106