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_ACCESSIBLE_SHAPE_TREE_INFO_HXX
25cdf0e10cSrcweir #define _SVX_ACCESSIBILITY_ACCESSIBLE_SHAPE_TREE_INFO_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <com/sun/star/accessibility/XAccessibleComponent.hpp>
28cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp>
29cdf0e10cSrcweir #include <com/sun/star/document/XEventBroadcaster.hpp>
30cdf0e10cSrcweir #include <com/sun/star/frame/XController.hpp>
31cdf0e10cSrcweir #include <svx/IAccessibleViewForwarder.hxx>
32cdf0e10cSrcweir #include "svx/svxdllapi.h"
33cdf0e10cSrcweir 
34cdf0e10cSrcweir class SdrView;
35cdf0e10cSrcweir class Window;
36cdf0e10cSrcweir 
37cdf0e10cSrcweir namespace accessibility {
38cdf0e10cSrcweir 
39cdf0e10cSrcweir /** This class bundles all information that is passed down the tree of
40cdf0e10cSrcweir     accessible shapes so that each shape has access to that info.
41cdf0e10cSrcweir 
42cdf0e10cSrcweir     There are basically four members that can be set and queried:
43cdf0e10cSrcweir     <ul>
44cdf0e10cSrcweir     <li>The model broadcaster is used for getting notified about shape
45cdf0e10cSrcweir     changes.  Using this broadcaster makes in unnecessary to register at
4686e1cf34SPedro Giffuni     each shape separately.</li>
47cdf0e10cSrcweir     <li>The view forwarder is responsible for transformation between
48cdf0e10cSrcweir     coordinate systems and for providing the visible area both with respect
49cdf0e10cSrcweir     to a specific window.</li>
50cdf0e10cSrcweir     <li>The SdrView is used for creating accessible edit engines.</li>
51cdf0e10cSrcweir     <li>The Window is used for creating accessible edit engines.</li>
52cdf0e10cSrcweir     </ul>
53cdf0e10cSrcweir */
54cdf0e10cSrcweir class SVX_DLLPUBLIC AccessibleShapeTreeInfo
55cdf0e10cSrcweir {
56cdf0e10cSrcweir public:
57cdf0e10cSrcweir     /** Deprecated.  Don't use this constructor any more.
58cdf0e10cSrcweir     */
59cdf0e10cSrcweir     AccessibleShapeTreeInfo (
60cdf0e10cSrcweir         const ::com::sun::star::uno::Reference<
61cdf0e10cSrcweir             ::com::sun::star::accessibility::XAccessibleComponent>& rxDocumentWindow,
62cdf0e10cSrcweir         const ::com::sun::star::uno::Reference<
63cdf0e10cSrcweir             ::com::sun::star::document::XEventBroadcaster>& rxBroadcaster);
64cdf0e10cSrcweir 
65cdf0e10cSrcweir     /** Use this constructor to create an empty object that is filled later
66*b1bc2d97SMatthias Seidel         with more meaningful data.
67cdf0e10cSrcweir     */
68cdf0e10cSrcweir     AccessibleShapeTreeInfo (void);
69cdf0e10cSrcweir 
70cdf0e10cSrcweir     /** Create a copy of the given shape info.
71cdf0e10cSrcweir         @param rInfo
72cdf0e10cSrcweir             The shape tree info object to copy.
73cdf0e10cSrcweir     */
74cdf0e10cSrcweir     AccessibleShapeTreeInfo (const AccessibleShapeTreeInfo& rInfo);
75cdf0e10cSrcweir 
76cdf0e10cSrcweir     ~AccessibleShapeTreeInfo (void);
77cdf0e10cSrcweir 
78cdf0e10cSrcweir     AccessibleShapeTreeInfo& operator= (const AccessibleShapeTreeInfo& rInfo);
79cdf0e10cSrcweir 
80cdf0e10cSrcweir     /** Deprecated.  Don't use this method.
81cdf0e10cSrcweir     */
82cdf0e10cSrcweir     void SetDocumentWindow (const ::com::sun::star::uno::Reference<
83cdf0e10cSrcweir         ::com::sun::star::accessibility::XAccessibleComponent>& rxViewWindow);
84cdf0e10cSrcweir     /** Deprecated.  Don't use this method.
85cdf0e10cSrcweir     */
86cdf0e10cSrcweir     ::com::sun::star::uno::Reference<
87cdf0e10cSrcweir         ::com::sun::star::accessibility::XAccessibleComponent>
88cdf0e10cSrcweir         GetDocumentWindow (void) const;
89cdf0e10cSrcweir 
90cdf0e10cSrcweir     /** Deprecated.   Use the correctly named SetModelBroadcaster method
91cdf0e10cSrcweir         instead.
92cdf0e10cSrcweir     */
93cdf0e10cSrcweir     void SetControllerBroadcaster (const ::com::sun::star::uno::Reference<
94cdf0e10cSrcweir         ::com::sun::star::document::XEventBroadcaster>& rxControllerBroadcaster);
95cdf0e10cSrcweir     /** Deprecated.   Use the correctly named GetModelBroadcaster method
96cdf0e10cSrcweir         instead.
97cdf0e10cSrcweir     */
98cdf0e10cSrcweir     ::com::sun::star::uno::Reference<
99cdf0e10cSrcweir         ::com::sun::star::document::XEventBroadcaster>
100cdf0e10cSrcweir         GetControllerBroadcaster (void) const;
101cdf0e10cSrcweir 
102cdf0e10cSrcweir     /** Set a new broadcaster that sends events indicating shape changes.
103cdf0e10cSrcweir         The broadcaster usually is or belongs to a document model.
104cdf0e10cSrcweir         @param rxModelBroadcaster
105cdf0e10cSrcweir             The new broadcaster.  It replaces the current one.  An empty
106cdf0e10cSrcweir             reference may be passed to unset the broadcaster
107cdf0e10cSrcweir     */
108cdf0e10cSrcweir     void SetModelBroadcaster (const ::com::sun::star::uno::Reference<
109cdf0e10cSrcweir         ::com::sun::star::document::XEventBroadcaster>& rxModelBroadcaster);
110cdf0e10cSrcweir 
111cdf0e10cSrcweir     /** Return the current model broadcaster.
112cdf0e10cSrcweir         @return
113cdf0e10cSrcweir             The returned reference may be empty if the broadcaster has not
114cdf0e10cSrcweir             been set or has been set to an empty reference.
115cdf0e10cSrcweir     */
116cdf0e10cSrcweir     ::com::sun::star::uno::Reference<
117cdf0e10cSrcweir         ::com::sun::star::document::XEventBroadcaster>
118cdf0e10cSrcweir         GetModelBroadcaster (void) const;
119cdf0e10cSrcweir 
120cdf0e10cSrcweir     /** Set the view that will be used to construct SvxTextEditSources which
121cdf0e10cSrcweir         in turn are used to create accessible edit engines.
122cdf0e10cSrcweir         @param pView
123cdf0e10cSrcweir             The new SdrView that replaces the current one.  A NULL pointer
124cdf0e10cSrcweir             may be passed to unset the view.
125cdf0e10cSrcweir     */
126cdf0e10cSrcweir     void SetSdrView (SdrView* pView);
127cdf0e10cSrcweir 
128cdf0e10cSrcweir     /** Return the current SdrView.
129cdf0e10cSrcweir         @return
130cdf0e10cSrcweir             The returned value may be NULL.
131cdf0e10cSrcweir     */
132cdf0e10cSrcweir     SdrView* GetSdrView (void) const;
133cdf0e10cSrcweir 
134cdf0e10cSrcweir     /** Set a new controller.  This will usually but not necessarily
135cdf0e10cSrcweir         correspond to the SdrView.
136cdf0e10cSrcweir         @param rxController
137cdf0e10cSrcweir             The new controller that replaces the current one.  An empty
138cdf0e10cSrcweir             reference may be passed to unset the controller.
139cdf0e10cSrcweir     */
140cdf0e10cSrcweir     void SetController (const ::com::sun::star::uno::Reference<
141cdf0e10cSrcweir         ::com::sun::star::frame::XController>& rxController);
142cdf0e10cSrcweir 
143cdf0e10cSrcweir     /** Return the currently set controller.
144cdf0e10cSrcweir         @return
145cdf0e10cSrcweir             The reference to the currently set controller may be empty.
146cdf0e10cSrcweir     */
147cdf0e10cSrcweir     ::com::sun::star::uno::Reference<
148cdf0e10cSrcweir         ::com::sun::star::frame::XController>
149cdf0e10cSrcweir         GetController (void) const;
150cdf0e10cSrcweir 
151cdf0e10cSrcweir     /** Set the window that is used to construct SvxTextEditSources which in
152cdf0e10cSrcweir         turn is used to create accessible edit engines.
153cdf0e10cSrcweir     */
154cdf0e10cSrcweir     void SetWindow (Window* pWindow);
155cdf0e10cSrcweir 
156cdf0e10cSrcweir     /** Return the current Window.
157cdf0e10cSrcweir         @return
158cdf0e10cSrcweir             The returned value may be NULL.
159cdf0e10cSrcweir     */
160cdf0e10cSrcweir     Window* GetWindow (void) const;
161cdf0e10cSrcweir 
162cdf0e10cSrcweir     /** The view forwarder allows the transformation between internal
163cdf0e10cSrcweir         and pixel coordinates and can be asked for the visible area.
164cdf0e10cSrcweir         @param pViewForwarder
165cdf0e10cSrcweir             This view forwarder replaces the current one.
166cdf0e10cSrcweir     */
167cdf0e10cSrcweir     void SetViewForwarder (const IAccessibleViewForwarder* pViewForwarder);
168cdf0e10cSrcweir 
169cdf0e10cSrcweir     /** Return the current view forwarder.
170cdf0e10cSrcweir         @return
171cdf0e10cSrcweir             The returned pointer may be NULL.
172cdf0e10cSrcweir     */
173cdf0e10cSrcweir     const IAccessibleViewForwarder* GetViewForwarder (void) const;
174cdf0e10cSrcweir 
175cdf0e10cSrcweir private:
176cdf0e10cSrcweir     /** Deprecated.
177cdf0e10cSrcweir     */
178cdf0e10cSrcweir     ::com::sun::star::uno::Reference<
179cdf0e10cSrcweir         ::com::sun::star::accessibility::XAccessibleComponent> mxDocumentWindow;
180cdf0e10cSrcweir 
181cdf0e10cSrcweir     /** this broadcaster sends events indicating shape changes.
182cdf0e10cSrcweir         The broadcaster usually is or belongs to a document model.
183cdf0e10cSrcweir 
184cdf0e10cSrcweir         This once was named mxControllerBroadcaster.
185cdf0e10cSrcweir     */
186cdf0e10cSrcweir     ::com::sun::star::uno::Reference<
187cdf0e10cSrcweir         ::com::sun::star::document::XEventBroadcaster> mxModelBroadcaster;
188cdf0e10cSrcweir 
189cdf0e10cSrcweir     /** This view is necessary to construct an SvxTextEditSource which in
190cdf0e10cSrcweir         turn is used to create an accessible edit engine.
191cdf0e10cSrcweir     */
192cdf0e10cSrcweir     SdrView* mpView;
193cdf0e10cSrcweir 
194cdf0e10cSrcweir     /** The controller is used e.g. for obtaining the selected shapes.
195cdf0e10cSrcweir     */
196cdf0e10cSrcweir     ::com::sun::star::uno::Reference<
197cdf0e10cSrcweir         ::com::sun::star::frame::XController> mxController;
198cdf0e10cSrcweir 
199cdf0e10cSrcweir     /** This window is necessary to construct an SvxTextEditSource which in
200cdf0e10cSrcweir         turn is used to create an accessible edit engine.
201cdf0e10cSrcweir     */
202cdf0e10cSrcweir     Window* mpWindow;
203cdf0e10cSrcweir 
204cdf0e10cSrcweir     /** The view forwarder allows the transformation between internal
205cdf0e10cSrcweir         and pixel coordinates and can be asked for the visible area.
206cdf0e10cSrcweir     */
207cdf0e10cSrcweir     const IAccessibleViewForwarder* mpViewForwarder;
208cdf0e10cSrcweir };
209cdf0e10cSrcweir 
210cdf0e10cSrcweir } // end of namespace accessibility
211cdf0e10cSrcweir 
212cdf0e10cSrcweir #endif
213