tdf#124953: Use rangelist's combined range top-left address...
[LibreOffice.git] / include / svx / unoshtxt.hxx
blob9acd57f6172c715dda72353008775708dea9bdd5
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_UNOSHTXT_HXX
21 #define INCLUDED_SVX_UNOSHTXT_HXX
23 #include <memory>
24 #include <editeng/unoedsrc.hxx>
25 #include <svx/svxdllapi.h>
27 namespace com { namespace sun { namespace star {
28 namespace uno {
29 class XInterface;
31 namespace accessibility {
32 struct TextSegment;
34 } } }
36 class SvxTextForwarder;
37 class SdrObject;
38 class SdrModel;
39 class SdrView;
40 namespace vcl { class Window; }
41 class SvxTextEditSourceImpl;
42 class SdrText;
44 class SVX_DLLPUBLIC SvxTextEditSource : public SvxEditSource, public SvxViewForwarder
46 public:
47 SvxTextEditSource( SdrObject* pObj, SdrText* pText );
49 /** Since the views don't broadcast their dying, make sure that
50 this object gets destroyed if the view becomes invalid
52 The window is necessary, since our views can display on multiple windows
54 SvxTextEditSource( SdrObject& rObj, SdrText* pText, SdrView& rView, const vcl::Window& rViewWindow );
55 SvxTextEditSource(const SvxTextEditSource&) = delete;
56 SvxTextEditSource& operator=(const SvxTextEditSource&) = delete;
57 virtual ~SvxTextEditSource() override;
59 virtual std::unique_ptr<SvxEditSource> Clone() const override;
60 virtual SvxTextForwarder* GetTextForwarder() override;
61 virtual SvxViewForwarder* GetViewForwarder() override;
62 virtual SvxEditViewForwarder* GetEditViewForwarder( bool bCreate = false ) override;
63 virtual void UpdateData() override;
65 virtual void addRange( SvxUnoTextRangeBase* pNewRange ) override;
66 virtual void removeRange( SvxUnoTextRangeBase* pOldRange ) override;
67 virtual const SvxUnoTextRangeBaseVec& getRanges() const override;
69 virtual SfxBroadcaster& GetBroadcaster() const override;
71 void lock();
72 void unlock();
74 // the SvxViewForwarder interface
75 virtual bool IsValid() const override;
76 virtual Point LogicToPixel( const Point&, const MapMode& ) const override;
77 virtual Point PixelToLogic( const Point&, const MapMode& ) const override;
79 void UpdateOutliner();
81 private:
82 SVX_DLLPRIVATE SvxTextEditSource( SvxTextEditSourceImpl* pImpl );
84 rtl::Reference<SvxTextEditSourceImpl> mpImpl;
87 #endif
89 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */