1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
22 #include "address.hxx"
23 #include <editeng/unoedsrc.hxx>
24 #include <svl/lstner.hxx>
28 class ScEditEngineDefaulter
;
29 class SvxEditEngineForwarder
;
33 class ScHeaderFooterTextData
;
34 class ScAccessibleTextData
;
37 class ScEditSource
: public SvxEditSource
40 virtual ScEditEngineDefaulter
* GetEditEngine() = 0;
44 * ScHeaderFooterTextObj keeps the authoritative copy of
45 * ScHeaderFooterTextData that this class holds reference to. It's a
46 * reference instead of a copy to avoid broadcasting changes to the
49 class ScHeaderFooterEditSource final
: public ScEditSource
52 ScHeaderFooterTextData
& mrTextData
;
55 ScHeaderFooterEditSource(ScHeaderFooterTextData
& rData
);
56 virtual ~ScHeaderFooterEditSource() override
;
58 // GetEditEngine is needed because the forwarder doesn't have field functions
59 virtual ScEditEngineDefaulter
* GetEditEngine() override
;
61 virtual std::unique_ptr
<SvxEditSource
> Clone() const override
;
62 virtual SvxTextForwarder
* GetTextForwarder() override
;
63 virtual void UpdateData() override
;
67 * Data (incl. EditEngine) for cell EditSource is now shared in
70 * ScCellEditSource with local copy of ScCellTextData is used by
71 * ScCellFieldsObj, ScCellFieldObj.
73 class ScCellEditSource final
: public ScEditSource
76 std::unique_ptr
<ScCellTextData
> pCellTextData
;
79 ScCellEditSource(ScDocShell
* pDocSh
, const ScAddress
& rP
);
80 virtual ~ScCellEditSource() override
;
82 // GetEditEngine is needed because the forwarder doesn't have field functions
83 virtual ScEditEngineDefaulter
* GetEditEngine() override
;
85 virtual std::unique_ptr
<SvxEditSource
> Clone() const override
;
86 virtual SvxTextForwarder
* GetTextForwarder() override
;
88 virtual void UpdateData() override
;
90 void SetDoUpdateData(bool bValue
);
94 class ScAnnotationEditSource final
: public SvxEditSource
, public SfxListener
97 ScDocShell
* pDocShell
;
99 std::unique_ptr
<ScEditEngineDefaulter
> pEditEngine
;
100 std::unique_ptr
<SvxEditEngineForwarder
> pForwarder
;
103 SdrObject
* GetCaptionObj();
105 ScAnnotationEditSource(ScDocShell
* pDocSh
, const ScAddress
& rP
);
106 virtual ~ScAnnotationEditSource() override
;
108 virtual std::unique_ptr
<SvxEditSource
> Clone() const override
;
109 virtual SvxTextForwarder
* GetTextForwarder() override
;
110 virtual void UpdateData() override
;
112 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
) override
;
115 // EditSource with a shared forwarder for all children of one text object
117 class ScSimpleEditSource final
: public SvxEditSource
120 SvxTextForwarder
* pForwarder
;
123 ScSimpleEditSource( SvxTextForwarder
* pForw
);
124 virtual ~ScSimpleEditSource() override
;
126 virtual std::unique_ptr
<SvxEditSource
> Clone() const override
;
127 virtual SvxTextForwarder
* GetTextForwarder() override
;
128 virtual void UpdateData() override
;
132 class ScAccessibilityEditSource final
: public SvxEditSource
135 ::std::unique_ptr
< ScAccessibleTextData
> mpAccessibleTextData
;
138 ScAccessibilityEditSource( ::std::unique_ptr
< ScAccessibleTextData
> && pAccessibleCellTextData
);
139 virtual ~ScAccessibilityEditSource() override
;
141 virtual std::unique_ptr
<SvxEditSource
> Clone() const override
;
142 virtual SvxTextForwarder
* GetTextForwarder() override
;
143 virtual SvxViewForwarder
* GetViewForwarder() override
;
144 virtual SvxEditViewForwarder
* GetEditViewForwarder( bool bCreate
= false ) override
;
145 virtual void UpdateData() override
;
146 virtual SfxBroadcaster
& GetBroadcaster() const override
;
149 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */