1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/uno/Reference.hxx>
24 #include <svx/svxdllapi.h>
25 #include <vcl/vclptr.hxx>
27 namespace com
{ namespace sun
{ namespace star
{
28 namespace accessibility
{ class XAccessibleComponent
; }
29 namespace document
{ class XEventBroadcaster
; }
30 namespace frame
{ class XController
; }
34 namespace vcl
{ class Window
; }
36 namespace accessibility
{
38 class IAccessibleViewForwarder
;
40 /** This class bundles all information that is passed down the tree of
41 accessible shapes so that each shape has access to that info.
43 There are basically four members that can be set and queried:
45 <li>The model broadcaster is used for getting notified about shape
46 changes. Using this broadcaster makes in unnecessary to register at
47 each shape separately.</li>
48 <li>The view forwarder is responsible for transformation between
49 coordinate systems and for providing the visible area both with respect
50 to a specific window.</li>
51 <li>The SdrView is used for creating accessible edit engines.</li>
52 <li>The Window is used for creating accessible edit engines.</li>
55 class SVX_DLLPUBLIC AccessibleShapeTreeInfo
58 /** Use this constructor to create an empty object that is filled later
59 with more meaningfull data.
61 AccessibleShapeTreeInfo();
63 /** Create a copy of the given shape info.
65 The shape tree info object to copy.
67 AccessibleShapeTreeInfo (const AccessibleShapeTreeInfo
& rInfo
);
69 ~AccessibleShapeTreeInfo();
71 AccessibleShapeTreeInfo
& operator= (const AccessibleShapeTreeInfo
& rInfo
);
75 /** Deprecated. Don't use this method.
77 void SetDocumentWindow (const css::uno::Reference
<
78 css::accessibility::XAccessibleComponent
>& rxViewWindow
);
80 /** Deprecated. Don't use this method.
82 const css::uno::Reference
<
83 css::accessibility::XAccessibleComponent
>&
84 GetDocumentWindow() const { return mxDocumentWindow
;}
86 /** Set a new broadcaster that sends events indicating shape changes.
87 The broadcaster usually is or belongs to a document model.
88 @param rxModelBroadcaster
89 The new broadcaster. It replaces the current one. An empty
90 reference may be passed to unset the broadcaster
92 void SetModelBroadcaster (const css::uno::Reference
<
93 css::document::XEventBroadcaster
>& rxModelBroadcaster
);
95 /** Return the current model broadcaster.
97 The returned reference may be empty if the broadcaster has not
98 been set or has been set to an empty reference.
100 const css::uno::Reference
<
101 css::document::XEventBroadcaster
>&
102 GetModelBroadcaster() const { return mxModelBroadcaster
;}
104 /** Set the view that will be used to construct SvxTextEditSources which
105 in turn are used to create accessible edit engines.
107 The new SdrView that replaces the current one. A NULL pointer
108 may be passed to unset the view.
110 void SetSdrView (SdrView
* pView
);
112 /** Return the current SdrView.
114 The returned value may be NULL.
116 SdrView
* GetSdrView() const { return mpView
;}
118 /** Set a new controller. This will usually but not necessarily
119 correspond to the SdrView.
121 The new controller that replaces the current one. An empty
122 reference may be passed to unset the controller.
124 void SetController (const css::uno::Reference
<
125 css::frame::XController
>& rxController
);
127 /** Return the currently set controller.
129 The reference to the currently set controller may be empty.
131 const css::uno::Reference
<
132 css::frame::XController
>&
133 GetController() const { return mxController
;}
135 /** Set the window that is used to construct SvxTextEditSources which in
136 turn is used to create accessible edit engines.
138 void SetWindow (vcl::Window
* pWindow
);
140 /** Return the current Window.
142 The returned value may be NULL.
144 vcl::Window
* GetWindow() const { return mpWindow
;}
146 /** The view forwarder allows the transformation between internal
147 and pixel coordinates and can be asked for the visible area.
148 @param pViewForwarder
149 This view forwarder replaces the current one.
151 void SetViewForwarder (const IAccessibleViewForwarder
* pViewForwarder
);
153 /** Return the current view forwarder.
155 The returned pointer may be NULL.
157 const IAccessibleViewForwarder
* GetViewForwarder() const { return mpViewForwarder
;}
163 css::accessibility::XAccessibleComponent
> mxDocumentWindow
;
165 /** this broadcaster sends events indicating shape changes.
166 The broadcaster usually is or belongs to a document model.
168 This once was named mxControllerBroadcaster.
171 css::document::XEventBroadcaster
> mxModelBroadcaster
;
173 /** This view is necessary to construct an SvxTextEditSource which in
174 turn is used to create an accessible edit engine.
178 /** The controller is used e.g. for obtaining the selected shapes.
181 css::frame::XController
> mxController
;
183 /** This window is necessary to construct an SvxTextEditSource which in
184 turn is used to create an accessible edit engine.
186 VclPtr
<vcl::Window
> mpWindow
;
188 /** The view forwarder allows the transformation between internal
189 and pixel coordinates and can be asked for the visible area.
191 const IAccessibleViewForwarder
* mpViewForwarder
;
194 } // end of namespace accessibility
198 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */