update dev300-m58
[ooovba.git] / svx / source / accessibility / AccessibleEmptyEditSource.hxx
bloba3737c181af2a5ca43b107b4ba21cabac860d847
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: AccessibleEmptyEditSource.hxx,v $
10 * $Revision: 1.5 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _SVX_ACCESSIBLEEMPTYEDITSOURCE_HXX
32 #define _SVX_ACCESSIBLEEMPTYEDITSOURCE_HXX
34 #include <svtools/brdcst.hxx>
35 #include <svtools/lstner.hxx>
37 #include <memory>
38 #include <svx/unoedsrc.hxx>
40 class SdrObject;
41 class SdrView;
42 class Window;
44 namespace accessibility
46 /** Proxy edit source for shapes without text
48 Extracted from old SvxDummyEditSource
50 class AccessibleEmptyEditSource : public SvxEditSource, public SfxListener, public SfxBroadcaster
52 public:
53 /** Create proxy edit source for shapes without text
55 Since the views don't broadcast their dying, make sure that
56 this object gets destroyed if the view becomes invalid
58 The window is necessary, since our views can display on multiple windows
60 Make sure you only create such an object if the shape _really_
61 does not contain text.
63 AccessibleEmptyEditSource( SdrObject& rObj, SdrView& rView, const Window& rViewWindow );
64 ~AccessibleEmptyEditSource();
66 // from the SvxEditSource interface
67 SvxTextForwarder* GetTextForwarder();
68 SvxViewForwarder* GetViewForwarder();
70 SvxEditSource* Clone() const;
72 // this method internally switches from empty to proxy mode,
73 // creating an SvxTextEditSource for the functionality.
74 SvxEditViewForwarder* GetEditViewForwarder( sal_Bool bCreate = sal_False );
76 void UpdateData();
77 SfxBroadcaster& GetBroadcaster() const;
79 // from the SfxListener interface
80 void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
82 private:
83 void Switch2ProxyEditSource();
85 /** Pointer to edit source implementation. This is switched on
86 a GetEditViewForwarder( true ) call, to actually create a
87 SvxTextEditSource.
89 @dyn
91 std::auto_ptr< SvxEditSource > mpEditSource;
93 SdrObject& mrObj;
94 SdrView& mrView;
95 const Window& mrViewWindow;
97 bool mbEditSourceEmpty;
100 } // namespace accessibility
102 #endif