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/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>
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:
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>
51 class SVX_DLLPUBLIC AccessibleShapeTreeInfo
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.
61 The shape tree info object to copy.
63 AccessibleShapeTreeInfo (const AccessibleShapeTreeInfo
& rInfo
);
65 ~AccessibleShapeTreeInfo();
67 AccessibleShapeTreeInfo
& operator= (const AccessibleShapeTreeInfo
& rInfo
);
69 /** Deprecated. Don't use this method.
71 void SetDocumentWindow (const ::com::sun::star::uno::Reference
<
72 ::com::sun::star::accessibility::XAccessibleComponent
>& rxViewWindow
);
74 /** Deprecated. Don't use this method.
76 ::com::sun::star::uno::Reference
<
77 ::com::sun::star::accessibility::XAccessibleComponent
>
78 GetDocumentWindow() const { return mxDocumentWindow
;}
80 /** Set a new broadcaster that sends events indicating shape changes.
81 The broadcaster usually is or belongs to a document model.
82 @param rxModelBroadcaster
83 The new broadcaster. It replaces the current one. An empty
84 reference may be passed to unset the broadcaster
86 void SetModelBroadcaster (const ::com::sun::star::uno::Reference
<
87 ::com::sun::star::document::XEventBroadcaster
>& rxModelBroadcaster
);
89 /** Return the current model broadcaster.
91 The returned reference may be empty if the broadcaster has not
92 been set or has been set to an empty reference.
94 ::com::sun::star::uno::Reference
<
95 ::com::sun::star::document::XEventBroadcaster
>
96 GetModelBroadcaster() const { return mxModelBroadcaster
;}
98 /** Set the view that will be used to construct SvxTextEditSources which
99 in turn are used to create accessible edit engines.
101 The new SdrView that replaces the current one. A NULL pointer
102 may be passed to unset the view.
104 void SetSdrView (SdrView
* pView
);
106 /** Return the current SdrView.
108 The returned value may be NULL.
110 SdrView
* GetSdrView() const { return mpView
;}
112 /** Set a new controller. This will usually but not necessarily
113 correspond to the SdrView.
115 The new controller that replaces the current one. An empty
116 reference may be passed to unset the controller.
118 void SetController (const ::com::sun::star::uno::Reference
<
119 ::com::sun::star::frame::XController
>& rxController
);
121 /** Return the currently set controller.
123 The reference to the currently set controller may be empty.
125 ::com::sun::star::uno::Reference
<
126 ::com::sun::star::frame::XController
>
127 GetController() const { return mxController
;}
129 /** Set the window that is used to construct SvxTextEditSources which in
130 turn is used to create accessible edit engines.
132 void SetWindow (vcl::Window
* pWindow
);
134 /** Return the current Window.
136 The returned value may be NULL.
138 vcl::Window
* GetWindow() const { return mpWindow
;}
140 /** The view forwarder allows the transformation between internal
141 and pixel coordinates and can be asked for the visible area.
142 @param pViewForwarder
143 This view forwarder replaces the current one.
145 void SetViewForwarder (const IAccessibleViewForwarder
* pViewForwarder
);
147 /** Return the current view forwarder.
149 The returned pointer may be NULL.
151 const IAccessibleViewForwarder
* GetViewForwarder() const { return mpViewForwarder
;}
156 ::com::sun::star::uno::Reference
<
157 ::com::sun::star::accessibility::XAccessibleComponent
> mxDocumentWindow
;
159 /** this broadcaster sends events indicating shape changes.
160 The broadcaster usually is or belongs to a document model.
162 This once was named mxControllerBroadcaster.
164 ::com::sun::star::uno::Reference
<
165 ::com::sun::star::document::XEventBroadcaster
> mxModelBroadcaster
;
167 /** This view is necessary to construct an SvxTextEditSource which in
168 turn is used to create an accessible edit engine.
172 /** The controller is used e.g. for obtaining the selected shapes.
174 ::com::sun::star::uno::Reference
<
175 ::com::sun::star::frame::XController
> mxController
;
177 /** This window is necessary to construct an SvxTextEditSource which in
178 turn is used to create an accessible edit engine.
180 VclPtr
<vcl::Window
> mpWindow
;
182 /** The view forwarder allows the transformation between internal
183 and pixel coordinates and can be asked for the visible area.
185 const IAccessibleViewForwarder
* mpViewForwarder
;
188 } // end of namespace accessibility
192 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */