lok: use "None" string item in the ListBox control
[LibreOffice.git] / include / svx / AccessibleShapeTreeInfo.hxx
blob82f98759902ff3e32ed2a0710f318405c9a0818b
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/uno/Reference.hxx>
24 #include <svx/svxdllapi.h>
25 #include <vcl/window.hxx>
27 namespace com { namespace sun { namespace star {
28 namespace accessibility { class XAccessibleComponent; }
29 namespace document { class XShapeEventBroadcaster; }
30 namespace frame { class XController; }
31 } } }
33 class SdrView;
35 namespace accessibility {
37 class IAccessibleViewForwarder;
39 /** This class bundles all information that is passed down the tree of
40 accessible shapes so that each shape has access to that info.
42 There are basically four members that can be set and queried:
43 <ul>
44 <li>The model broadcaster is used for getting notified about shape
45 changes. Using this broadcaster makes in unnecessary to register at
46 each shape separately.</li>
47 <li>The view forwarder is responsible for transformation between
48 coordinate systems and for providing the visible area both with respect
49 to a specific window.</li>
50 <li>The SdrView is used for creating accessible edit engines.</li>
51 <li>The Window is used for creating accessible edit engines.</li>
52 </ul>
54 class SVX_DLLPUBLIC AccessibleShapeTreeInfo
56 public:
57 /** Use this constructor to create an empty object that is filled later
58 with more meaningful data.
60 AccessibleShapeTreeInfo();
62 /** Create a copy of the given shape info.
63 @param rInfo
64 The shape tree info object to copy.
66 AccessibleShapeTreeInfo (const AccessibleShapeTreeInfo& rInfo);
68 ~AccessibleShapeTreeInfo();
70 AccessibleShapeTreeInfo& operator= (const AccessibleShapeTreeInfo& rInfo);
72 void dispose();
74 /** Deprecated. Don't use this method.
76 void SetDocumentWindow (const css::uno::Reference<
77 css::accessibility::XAccessibleComponent>& rxViewWindow);
79 /** Deprecated. Don't use this method.
81 const css::uno::Reference<
82 css::accessibility::XAccessibleComponent>&
83 GetDocumentWindow() const { return mxDocumentWindow;}
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 css::uno::Reference<
92 css::document::XShapeEventBroadcaster>& rxModelBroadcaster);
94 /** Return the current model broadcaster.
95 @return
96 The returned reference may be empty if the broadcaster has not
97 been set or has been set to an empty reference.
99 const css::uno::Reference<
100 css::document::XShapeEventBroadcaster>&
101 GetModelBroadcaster() const { return mxModelBroadcaster;}
103 /** Set the view that will be used to construct SvxTextEditSources which
104 in turn are used to create accessible edit engines.
105 @param pView
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.
112 @return
113 The returned value may be NULL.
115 SdrView* GetSdrView() const { return mpView;}
117 /** Set a new controller. This will usually but not necessarily
118 correspond to the SdrView.
119 @param rxController
120 The new controller that replaces the current one. An empty
121 reference may be passed to unset the controller.
123 void SetController (const css::uno::Reference<
124 css::frame::XController>& rxController);
126 /** Return the currently set controller.
127 @return
128 The reference to the currently set controller may be empty.
130 const css::uno::Reference<
131 css::frame::XController>&
132 GetController() const { return mxController;}
134 /** Set the window that is used to construct SvxTextEditSources which in
135 turn is used to create accessible edit engines.
137 void SetDevice(OutputDevice* pWindow);
139 /** Return the current Window.
140 @return
141 The returned value may be NULL.
143 vcl::Window* GetWindow() const
145 if (mpWindow && mpWindow->GetOutDevType() == OUTDEV_WINDOW)
146 return static_cast<vcl::Window*>(mpWindow.get());
147 return nullptr;
149 OutputDevice* GetDevice() const { return mpWindow;}
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.
156 void SetViewForwarder (const IAccessibleViewForwarder* pViewForwarder);
158 /** Return the current view forwarder.
159 @return
160 The returned pointer may be NULL.
162 const IAccessibleViewForwarder* GetViewForwarder() const { return mpViewForwarder;}
164 private:
165 /** Deprecated.
167 css::uno::Reference<
168 css::accessibility::XAccessibleComponent> mxDocumentWindow;
170 /** this broadcaster sends events indicating shape changes.
171 The broadcaster usually is or belongs to a document model.
173 This once was named mxControllerBroadcaster.
175 css::uno::Reference<
176 css::document::XShapeEventBroadcaster> mxModelBroadcaster;
178 /** This view is necessary to construct an SvxTextEditSource which in
179 turn is used to create an accessible edit engine.
181 SdrView* mpView;
183 /** The controller is used e.g. for obtaining the selected shapes.
185 css::uno::Reference<
186 css::frame::XController> mxController;
188 /** This window is necessary to construct an SvxTextEditSource which in
189 turn is used to create an accessible edit engine.
191 VclPtr<OutputDevice> mpWindow;
193 /** The view forwarder allows the transformation between internal
194 and pixel coordinates and can be asked for the visible area.
196 const IAccessibleViewForwarder* mpViewForwarder;
199 } // end of namespace accessibility
201 #endif
203 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */