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 _SVX_ACCESSIBILITY_ACCESSIBLE_SHAPE_TREE_INFO_HXX
21 #define _SVX_ACCESSIBILITY_ACCESSIBLE_SHAPE_TREE_INFO_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"
33 namespace accessibility
{
35 /** This class bundles all information that is passed down the tree of
36 accessible shapes so that each shape has access to that info.
38 There are basically four members that can be set and queried:
40 <li>The model broadcaster is used for getting notified about shape
41 changes. Using this broadcaster makes in unnecessary to register at
42 each shape separately.</li>
43 <li>The view forwarder is responsible for transformation between
44 coordinate systems and for providing the visible area both with respect
45 to a specific window.</li>
46 <li>The SdrView is used for creating accessible edit engines.</li>
47 <li>The Window is used for creating accessible edit engines.</li>
50 class SVX_DLLPUBLIC AccessibleShapeTreeInfo
53 /** Use this constructor to create an empty object that is filled later
54 with more meaningfull data.
56 AccessibleShapeTreeInfo (void);
58 /** Create a copy of the given shape info.
60 The shape tree info object to copy.
62 AccessibleShapeTreeInfo (const AccessibleShapeTreeInfo
& rInfo
);
64 ~AccessibleShapeTreeInfo (void);
66 AccessibleShapeTreeInfo
& operator= (const AccessibleShapeTreeInfo
& rInfo
);
68 /** Deprecated. Don't use this method.
70 void SetDocumentWindow (const ::com::sun::star::uno::Reference
<
71 ::com::sun::star::accessibility::XAccessibleComponent
>& rxViewWindow
);
73 /** Deprecated. Use the correctly named SetModelBroadcaster method
76 void SetControllerBroadcaster (const ::com::sun::star::uno::Reference
<
77 ::com::sun::star::document::XEventBroadcaster
>& rxControllerBroadcaster
);
78 /** Deprecated. Use the correctly named GetModelBroadcaster method
81 ::com::sun::star::uno::Reference
<
82 ::com::sun::star::document::XEventBroadcaster
>
83 GetControllerBroadcaster (void) const;
85 /** Set a new broadcaster that sends events indicating shape changes.
86 The broadcaster usually is or belongs to a document model.
87 @param rxModelBroadcaster
88 The new broadcaster. It replaces the current one. An empty
89 reference may be passed to unset the broadcaster
91 void SetModelBroadcaster (const ::com::sun::star::uno::Reference
<
92 ::com::sun::star::document::XEventBroadcaster
>& rxModelBroadcaster
);
94 /** Return the current model broadcaster.
96 The returned reference may be empty if the broadcaster has not
97 been set or has been set to an empty reference.
99 ::com::sun::star::uno::Reference
<
100 ::com::sun::star::document::XEventBroadcaster
>
101 GetModelBroadcaster (void) const;
103 /** Set the view that will be used to construct SvxTextEditSources which
104 in turn are used to create accessible edit engines.
106 The new SdrView that replaces the current one. A NULL pointer
107 may be passed to unset the view.
109 void SetSdrView (SdrView
* pView
);
111 /** Return the current SdrView.
113 The returned value may be NULL.
115 SdrView
* GetSdrView (void) const;
117 /** Set a new controller. This will usually but not necessarily
118 correspond to the SdrView.
120 The new controller that replaces the current one. An empty
121 reference may be passed to unset the controller.
123 void SetController (const ::com::sun::star::uno::Reference
<
124 ::com::sun::star::frame::XController
>& rxController
);
126 /** Return the currently set controller.
128 The reference to the currently set controller may be empty.
130 ::com::sun::star::uno::Reference
<
131 ::com::sun::star::frame::XController
>
132 GetController (void) const;
134 /** Set the window that is used to construct SvxTextEditSources which in
135 turn is used to create accessible edit engines.
137 void SetWindow (Window
* pWindow
);
139 /** Return the current Window.
141 The returned value may be NULL.
143 Window
* GetWindow (void) const;
145 /** The view forwarder allows the transformation between internal
146 and pixel coordinates and can be asked for the visible area.
147 @param pViewForwarder
148 This view forwarder replaces the current one.
150 void SetViewForwarder (const IAccessibleViewForwarder
* pViewForwarder
);
152 /** Return the current view forwarder.
154 The returned pointer may be NULL.
156 const IAccessibleViewForwarder
* GetViewForwarder (void) const;
161 ::com::sun::star::uno::Reference
<
162 ::com::sun::star::accessibility::XAccessibleComponent
> mxDocumentWindow
;
164 /** this broadcaster sends events indicating shape changes.
165 The broadcaster usually is or belongs to a document model.
167 This once was named mxControllerBroadcaster.
169 ::com::sun::star::uno::Reference
<
170 ::com::sun::star::document::XEventBroadcaster
> mxModelBroadcaster
;
172 /** This view is necessary to construct an SvxTextEditSource which in
173 turn is used to create an accessible edit engine.
177 /** The controller is used e.g. for obtaining the selected shapes.
179 ::com::sun::star::uno::Reference
<
180 ::com::sun::star::frame::XController
> mxController
;
182 /** This window is necessary to construct an SvxTextEditSource which in
183 turn is used to create an accessible edit engine.
187 /** The view forwarder allows the transformation between internal
188 and pixel coordinates and can be asked for the visible area.
190 const IAccessibleViewForwarder
* mpViewForwarder
;
193 } // end of namespace accessibility
197 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */