Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #ifndef INCLUDED_SVX_ACCESSIBLESHAPETREEINFO_HXX
21 : #define INCLUDED_SVX_ACCESSIBLESHAPETREEINFO_HXX
22 :
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 :
30 : class SdrView;
31 : namespace vcl { class Window; }
32 :
33 : namespace accessibility {
34 :
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.
37 :
38 : There are basically four members that can be set and queried:
39 : <ul>
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>
48 : </ul>
49 : */
50 : class SVX_DLLPUBLIC AccessibleShapeTreeInfo
51 : {
52 : public:
53 : /** Use this constructor to create an empty object that is filled later
54 : with more meaningfull data.
55 : */
56 : AccessibleShapeTreeInfo (void);
57 :
58 : /** Create a copy of the given shape info.
59 : @param rInfo
60 : The shape tree info object to copy.
61 : */
62 : AccessibleShapeTreeInfo (const AccessibleShapeTreeInfo& rInfo);
63 :
64 : ~AccessibleShapeTreeInfo (void);
65 :
66 : AccessibleShapeTreeInfo& operator= (const AccessibleShapeTreeInfo& rInfo);
67 :
68 : /** Deprecated. Don't use this method.
69 : */
70 : void SetDocumentWindow (const ::com::sun::star::uno::Reference<
71 : ::com::sun::star::accessibility::XAccessibleComponent>& rxViewWindow);
72 :
73 : /** Deprecated. Don't use this method.
74 : */
75 : ::com::sun::star::uno::Reference<
76 : ::com::sun::star::accessibility::XAccessibleComponent>
77 0 : GetDocumentWindow (void) const { return mxDocumentWindow;}
78 :
79 : /** Deprecated. Use the correctly named SetModelBroadcaster method
80 : instead.
81 : */
82 : void SetControllerBroadcaster (const ::com::sun::star::uno::Reference<
83 : ::com::sun::star::document::XEventBroadcaster>& rxControllerBroadcaster);
84 : /** Deprecated. Use the correctly named GetModelBroadcaster method
85 : instead.
86 : */
87 : ::com::sun::star::uno::Reference<
88 : ::com::sun::star::document::XEventBroadcaster>
89 0 : GetControllerBroadcaster (void) const { return mxModelBroadcaster;}
90 :
91 : /** Set a new broadcaster that sends events indicating shape changes.
92 : The broadcaster usually is or belongs to a document model.
93 : @param rxModelBroadcaster
94 : The new broadcaster. It replaces the current one. An empty
95 : reference may be passed to unset the broadcaster
96 : */
97 : void SetModelBroadcaster (const ::com::sun::star::uno::Reference<
98 : ::com::sun::star::document::XEventBroadcaster>& rxModelBroadcaster);
99 :
100 : /** Return the current model broadcaster.
101 : @return
102 : The returned reference may be empty if the broadcaster has not
103 : been set or has been set to an empty reference.
104 : */
105 : ::com::sun::star::uno::Reference<
106 : ::com::sun::star::document::XEventBroadcaster>
107 128 : GetModelBroadcaster (void) const { return mxModelBroadcaster;}
108 :
109 : /** Set the view that will be used to construct SvxTextEditSources which
110 : in turn are used to create accessible edit engines.
111 : @param pView
112 : The new SdrView that replaces the current one. A NULL pointer
113 : may be passed to unset the view.
114 : */
115 : void SetSdrView (SdrView* pView);
116 :
117 : /** Return the current SdrView.
118 : @return
119 : The returned value may be NULL.
120 : */
121 52 : SdrView* GetSdrView (void) const { return mpView;}
122 :
123 : /** Set a new controller. This will usually but not necessarily
124 : correspond to the SdrView.
125 : @param rxController
126 : The new controller that replaces the current one. An empty
127 : reference may be passed to unset the controller.
128 : */
129 : void SetController (const ::com::sun::star::uno::Reference<
130 : ::com::sun::star::frame::XController>& rxController);
131 :
132 : /** Return the currently set controller.
133 : @return
134 : The reference to the currently set controller may be empty.
135 : */
136 : ::com::sun::star::uno::Reference<
137 : ::com::sun::star::frame::XController>
138 42 : GetController (void) const { return mxController;}
139 :
140 : /** Set the window that is used to construct SvxTextEditSources which in
141 : turn is used to create accessible edit engines.
142 : */
143 : void SetWindow (vcl::Window* pWindow);
144 :
145 : /** Return the current Window.
146 : @return
147 : The returned value may be NULL.
148 : */
149 34 : vcl::Window* GetWindow (void) const { return mpWindow;}
150 :
151 : /** The view forwarder allows the transformation between internal
152 : and pixel coordinates and can be asked for the visible area.
153 : @param pViewForwarder
154 : This view forwarder replaces the current one.
155 : */
156 : void SetViewForwarder (const IAccessibleViewForwarder* pViewForwarder);
157 :
158 : /** Return the current view forwarder.
159 : @return
160 : The returned pointer may be NULL.
161 : */
162 4086 : const IAccessibleViewForwarder* GetViewForwarder (void) const { return mpViewForwarder;}
163 :
164 : private:
165 : /** Deprecated.
166 : */
167 : ::com::sun::star::uno::Reference<
168 : ::com::sun::star::accessibility::XAccessibleComponent> mxDocumentWindow;
169 :
170 : /** this broadcaster sends events indicating shape changes.
171 : The broadcaster usually is or belongs to a document model.
172 :
173 : This once was named mxControllerBroadcaster.
174 : */
175 : ::com::sun::star::uno::Reference<
176 : ::com::sun::star::document::XEventBroadcaster> mxModelBroadcaster;
177 :
178 : /** This view is necessary to construct an SvxTextEditSource which in
179 : turn is used to create an accessible edit engine.
180 : */
181 : SdrView* mpView;
182 :
183 : /** The controller is used e.g. for obtaining the selected shapes.
184 : */
185 : ::com::sun::star::uno::Reference<
186 : ::com::sun::star::frame::XController> mxController;
187 :
188 : /** This window is necessary to construct an SvxTextEditSource which in
189 : turn is used to create an accessible edit engine.
190 : */
191 : vcl::Window* mpWindow;
192 :
193 : /** The view forwarder allows the transformation between internal
194 : and pixel coordinates and can be asked for the visible area.
195 : */
196 : const IAccessibleViewForwarder* mpViewForwarder;
197 : };
198 :
199 : } // end of namespace accessibility
200 :
201 : #endif
202 :
203 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|