Version 4.3.0.0.beta1, tag libreoffice-4.3.0.0.beta1
[LibreOffice.git] / svx / source / accessibility / AccessibleEmptyEditSource.hxx
blobbe7fadc83f75b3ff49109a1d965d82236844b603
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_SOURCE_ACCESSIBILITY_ACCESSIBLEEMPTYEDITSOURCE_HXX
21 #define INCLUDED_SVX_SOURCE_ACCESSIBILITY_ACCESSIBLEEMPTYEDITSOURCE_HXX
23 #include <svl/brdcst.hxx>
24 #include <svl/lstner.hxx>
26 #include <memory>
27 #include <editeng/unoedsrc.hxx>
29 class SdrObject;
30 class SdrView;
31 class Window;
33 namespace accessibility
35 /** Proxy edit source for shapes without text
37 Extracted from old SvxDummyEditSource
39 class AccessibleEmptyEditSource : public SvxEditSource, public SfxListener, public SfxBroadcaster
41 public:
42 /** Create proxy edit source for shapes without text
44 Since the views don't broadcast their dying, make sure that
45 this object gets destroyed if the view becomes invalid
47 The window is necessary, since our views can display on multiple windows
49 Make sure you only create such an object if the shape _really_
50 does not contain text.
52 AccessibleEmptyEditSource( SdrObject& rObj, SdrView& rView, const Window& rViewWindow );
53 virtual ~AccessibleEmptyEditSource();
55 // from the SvxEditSource interface
56 SvxTextForwarder* GetTextForwarder() SAL_OVERRIDE;
57 SvxViewForwarder* GetViewForwarder() SAL_OVERRIDE;
59 SvxEditSource* Clone() const SAL_OVERRIDE;
61 // this method internally switches from empty to proxy mode,
62 // creating an SvxTextEditSource for the functionality.
63 SvxEditViewForwarder* GetEditViewForwarder( bool bCreate = false ) SAL_OVERRIDE;
65 void UpdateData() SAL_OVERRIDE;
66 SfxBroadcaster& GetBroadcaster() const SAL_OVERRIDE;
68 // from the SfxListener interface
69 void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
71 private:
72 void Switch2ProxyEditSource();
74 /** Pointer to edit source implementation. This is switched on
75 a GetEditViewForwarder( true ) call, to actually create a
76 SvxTextEditSource.
78 @dyn
80 SAL_WNODEPRECATED_DECLARATIONS_PUSH
81 std::auto_ptr< SvxEditSource > mpEditSource;
82 SAL_WNODEPRECATED_DECLARATIONS_POP
84 SdrObject& mrObj;
85 SdrView& mrView;
86 const Window& mrViewWindow;
88 bool mbEditSourceEmpty;
91 } // namespace accessibility
93 #endif
95 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */