Update ooo320-m1
[ooovba.git] / svx / inc / svx / AccessibleShapeTreeInfo.hxx
blob32106b1d08f8d9e335abed86b4ceb3f0de3f4afc
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: AccessibleShapeTreeInfo.hxx,v $
10 * $Revision: 1.3 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _SVX_ACCESSIBILITY_ACCESSIBLE_SHAPE_TREE_INFO_HXX
32 #define _SVX_ACCESSIBILITY_ACCESSIBLE_SHAPE_TREE_INFO_HXX
34 #include <com/sun/star/accessibility/XAccessibleComponent.hpp>
35 #include <com/sun/star/beans/XPropertySet.hpp>
36 #include <com/sun/star/document/XEventBroadcaster.hpp>
37 #include <com/sun/star/frame/XController.hpp>
38 #include <svx/IAccessibleViewForwarder.hxx>
39 #include "svx/svxdllapi.h"
41 class SdrView;
42 class Window;
44 namespace accessibility {
46 /** This class bundles all information that is passed down the tree of
47 accessible shapes so that each shape has access to that info.
49 There are basically four members that can be set and queried:
50 <ul>
51 <li>The model broadcaster is used for getting notified about shape
52 changes. Using this broadcaster makes in unnecessary to register at
53 each shape seperately.</li>
54 <li>The view forwarder is responsible for transformation between
55 coordinate systems and for providing the visible area both with respect
56 to a specific window.</li>
57 <li>The SdrView is used for creating accessible edit engines.</li>
58 <li>The Window is used for creating accessible edit engines.</li>
59 </ul>
61 class SVX_DLLPUBLIC AccessibleShapeTreeInfo
63 public:
64 /** Deprecated. Don't use this constructor any more.
66 AccessibleShapeTreeInfo (
67 const ::com::sun::star::uno::Reference<
68 ::com::sun::star::accessibility::XAccessibleComponent>& rxDocumentWindow,
69 const ::com::sun::star::uno::Reference<
70 ::com::sun::star::document::XEventBroadcaster>& rxBroadcaster);
72 /** Use this constructor to create an empty object that is filled later
73 with more meaningfull data.
75 AccessibleShapeTreeInfo (void);
77 /** Create a copy of the given shape info.
78 @param rInfo
79 The shape tree info object to copy.
81 AccessibleShapeTreeInfo (const AccessibleShapeTreeInfo& rInfo);
83 ~AccessibleShapeTreeInfo (void);
85 AccessibleShapeTreeInfo& operator= (const AccessibleShapeTreeInfo& rInfo);
87 /** Deprecated. Don't use this method.
89 void SetDocumentWindow (const ::com::sun::star::uno::Reference<
90 ::com::sun::star::accessibility::XAccessibleComponent>& rxViewWindow);
91 /** Deprecated. Don't use this method.
93 ::com::sun::star::uno::Reference<
94 ::com::sun::star::accessibility::XAccessibleComponent>
95 GetDocumentWindow (void) const;
97 /** Deprecated. Use the correctly named SetModelBroadcaster method
98 instead.
100 void SetControllerBroadcaster (const ::com::sun::star::uno::Reference<
101 ::com::sun::star::document::XEventBroadcaster>& rxControllerBroadcaster);
102 /** Deprecated. Use the correctly named GetModelBroadcaster method
103 instead.
105 ::com::sun::star::uno::Reference<
106 ::com::sun::star::document::XEventBroadcaster>
107 GetControllerBroadcaster (void) const;
109 /** Set a new broadcaster that sends events indicating shape changes.
110 The broadcaster usually is or belongs to a document model.
111 @param rxModelBroadcaster
112 The new broadcaster. It replaces the current one. An empty
113 reference may be passed to unset the broadcaster
115 void SetModelBroadcaster (const ::com::sun::star::uno::Reference<
116 ::com::sun::star::document::XEventBroadcaster>& rxModelBroadcaster);
118 /** Return the current model broadcaster.
119 @return
120 The returned reference may be empty if the broadcaster has not
121 been set or has been set to an empty reference.
123 ::com::sun::star::uno::Reference<
124 ::com::sun::star::document::XEventBroadcaster>
125 GetModelBroadcaster (void) const;
127 /** Set the view that will be used to construct SvxTextEditSources which
128 in turn are used to create accessible edit engines.
129 @param pView
130 The new SdrView that replaces the current one. A NULL pointer
131 may be passed to unset the view.
133 void SetSdrView (SdrView* pView);
135 /** Return the current SdrView.
136 @return
137 The returned value may be NULL.
139 SdrView* GetSdrView (void) const;
141 /** Set a new controller. This will usually but not necessarily
142 correspond to the SdrView.
143 @param rxController
144 The new controller that replaces the current one. An empty
145 reference may be passed to unset the controller.
147 void SetController (const ::com::sun::star::uno::Reference<
148 ::com::sun::star::frame::XController>& rxController);
150 /** Return the currently set controller.
151 @return
152 The reference to the currently set controller may be empty.
154 ::com::sun::star::uno::Reference<
155 ::com::sun::star::frame::XController>
156 GetController (void) const;
158 /** Set the window that is used to construct SvxTextEditSources which in
159 turn is used to create accessible edit engines.
161 void SetWindow (Window* pWindow);
163 /** Return the current Window.
164 @return
165 The returned value may be NULL.
167 Window* GetWindow (void) const;
169 /** The view forwarder allows the transformation between internal
170 and pixel coordinates and can be asked for the visible area.
171 @param pViewForwarder
172 This view forwarder replaces the current one.
174 void SetViewForwarder (const IAccessibleViewForwarder* pViewForwarder);
176 /** Return the current view forwarder.
177 @return
178 The returned pointer may be NULL.
180 const IAccessibleViewForwarder* GetViewForwarder (void) const;
182 private:
183 /** Deprecated.
185 ::com::sun::star::uno::Reference<
186 ::com::sun::star::accessibility::XAccessibleComponent> mxDocumentWindow;
188 /** this broadcaster sends events indicating shape changes.
189 The broadcaster usually is or belongs to a document model.
191 This once was named mxControllerBroadcaster.
193 ::com::sun::star::uno::Reference<
194 ::com::sun::star::document::XEventBroadcaster> mxModelBroadcaster;
196 /** This view is necessary to construct an SvxTextEditSource which in
197 turn is used to create an accessible edit engine.
199 SdrView* mpView;
201 /** The controller is used e.g. for obtaining the selected shapes.
203 ::com::sun::star::uno::Reference<
204 ::com::sun::star::frame::XController> mxController;
206 /** This window is necessary to construct an SvxTextEditSource which in
207 turn is used to create an accessible edit engine.
209 Window* mpWindow;
211 /** The view forwarder allows the transformation between internal
212 and pixel coordinates and can be asked for the visible area.
214 const IAccessibleViewForwarder* mpViewForwarder;
217 } // end of namespace accessibility
219 #endif