build fix
[LibreOffice.git] / include / svx / AccessibleShapeTreeInfo.hxx
blobdf3d39a097ce3de00640a2a5b9529c32f0c7bc3b
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SVX_ACCESSIBLESHAPETREEINFO_HXX
21 #define INCLUDED_SVX_ACCESSIBLESHAPETREEINFO_HXX
23 #include <com/sun/star/accessibility/XAccessibleComponent.hpp>
24 #include <com/sun/star/beans/XPropertySet.hpp>
25 #include <com/sun/star/document/XEventBroadcaster.hpp>
26 #include <com/sun/star/frame/XController.hpp>
27 #include <svx/IAccessibleViewForwarder.hxx>
28 #include <svx/svxdllapi.h>
29 #include <vcl/vclptr.hxx>
31 class SdrView;
32 namespace vcl { class Window; }
34 namespace accessibility {
36 /** This class bundles all information that is passed down the tree of
37 accessible shapes so that each shape has access to that info.
39 There are basically four members that can be set and queried:
40 <ul>
41 <li>The model broadcaster is used for getting notified about shape
42 changes. Using this broadcaster makes in unnecessary to register at
43 each shape separately.</li>
44 <li>The view forwarder is responsible for transformation between
45 coordinate systems and for providing the visible area both with respect
46 to a specific window.</li>
47 <li>The SdrView is used for creating accessible edit engines.</li>
48 <li>The Window is used for creating accessible edit engines.</li>
49 </ul>
51 class SVX_DLLPUBLIC AccessibleShapeTreeInfo
53 public:
54 /** Use this constructor to create an empty object that is filled later
55 with more meaningfull data.
57 AccessibleShapeTreeInfo();
59 /** Create a copy of the given shape info.
60 @param rInfo
61 The shape tree info object to copy.
63 AccessibleShapeTreeInfo (const AccessibleShapeTreeInfo& rInfo);
65 ~AccessibleShapeTreeInfo();
67 AccessibleShapeTreeInfo& operator= (const AccessibleShapeTreeInfo& rInfo);
69 void dispose();
71 /** Deprecated. Don't use this method.
73 void SetDocumentWindow (const css::uno::Reference<
74 css::accessibility::XAccessibleComponent>& rxViewWindow);
76 /** Deprecated. Don't use this method.
78 const css::uno::Reference<
79 css::accessibility::XAccessibleComponent>&
80 GetDocumentWindow() const { return mxDocumentWindow;}
82 /** Set a new broadcaster that sends events indicating shape changes.
83 The broadcaster usually is or belongs to a document model.
84 @param rxModelBroadcaster
85 The new broadcaster. It replaces the current one. An empty
86 reference may be passed to unset the broadcaster
88 void SetModelBroadcaster (const css::uno::Reference<
89 css::document::XEventBroadcaster>& rxModelBroadcaster);
91 /** Return the current model broadcaster.
92 @return
93 The returned reference may be empty if the broadcaster has not
94 been set or has been set to an empty reference.
96 const css::uno::Reference<
97 css::document::XEventBroadcaster>&
98 GetModelBroadcaster() const { return mxModelBroadcaster;}
100 /** Set the view that will be used to construct SvxTextEditSources which
101 in turn are used to create accessible edit engines.
102 @param pView
103 The new SdrView that replaces the current one. A NULL pointer
104 may be passed to unset the view.
106 void SetSdrView (SdrView* pView);
108 /** Return the current SdrView.
109 @return
110 The returned value may be NULL.
112 SdrView* GetSdrView() const { return mpView;}
114 /** Set a new controller. This will usually but not necessarily
115 correspond to the SdrView.
116 @param rxController
117 The new controller that replaces the current one. An empty
118 reference may be passed to unset the controller.
120 void SetController (const css::uno::Reference<
121 css::frame::XController>& rxController);
123 /** Return the currently set controller.
124 @return
125 The reference to the currently set controller may be empty.
127 const css::uno::Reference<
128 css::frame::XController>&
129 GetController() const { return mxController;}
131 /** Set the window that is used to construct SvxTextEditSources which in
132 turn is used to create accessible edit engines.
134 void SetWindow (vcl::Window* pWindow);
136 /** Return the current Window.
137 @return
138 The returned value may be NULL.
140 vcl::Window* GetWindow() const { return mpWindow;}
142 /** The view forwarder allows the transformation between internal
143 and pixel coordinates and can be asked for the visible area.
144 @param pViewForwarder
145 This view forwarder replaces the current one.
147 void SetViewForwarder (const IAccessibleViewForwarder* pViewForwarder);
149 /** Return the current view forwarder.
150 @return
151 The returned pointer may be NULL.
153 const IAccessibleViewForwarder* GetViewForwarder() const { return mpViewForwarder;}
155 private:
156 /** Deprecated.
158 css::uno::Reference<
159 css::accessibility::XAccessibleComponent> mxDocumentWindow;
161 /** this broadcaster sends events indicating shape changes.
162 The broadcaster usually is or belongs to a document model.
164 This once was named mxControllerBroadcaster.
166 css::uno::Reference<
167 css::document::XEventBroadcaster> mxModelBroadcaster;
169 /** This view is necessary to construct an SvxTextEditSource which in
170 turn is used to create an accessible edit engine.
172 SdrView* mpView;
174 /** The controller is used e.g. for obtaining the selected shapes.
176 css::uno::Reference<
177 css::frame::XController> mxController;
179 /** This window is necessary to construct an SvxTextEditSource which in
180 turn is used to create an accessible edit engine.
182 VclPtr<vcl::Window> mpWindow;
184 /** The view forwarder allows the transformation between internal
185 and pixel coordinates and can be asked for the visible area.
187 const IAccessibleViewForwarder* mpViewForwarder;
190 } // end of namespace accessibility
192 #endif
194 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */