LibreOffice Module sc (master)  1
editsrc.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 #pragma once
21 
22 #include "address.hxx"
23 #include <editeng/unoedsrc.hxx>
24 #include <svl/lstner.hxx>
25 
26 #include <memory>
27 
30 
31 class ScDocShell;
32 class ScCellTextData;
35 class SdrObject;
36 
38 {
39 public:
40  virtual ScEditEngineDefaulter* GetEditEngine() = 0;
41 };
42 
50 {
51 private:
53 
54 public:
56  virtual ~ScHeaderFooterEditSource() override;
57 
58  // GetEditEngine is needed because the forwarder doesn't have field functions
59  virtual ScEditEngineDefaulter* GetEditEngine() override;
60 
61  virtual std::unique_ptr<SvxEditSource> Clone() const override;
62  virtual SvxTextForwarder* GetTextForwarder() override;
63  virtual void UpdateData() override;
64 };
65 
73 class ScCellEditSource final : public ScEditSource
74 {
75 private:
76  std::unique_ptr<ScCellTextData> pCellTextData;
77 
78 public:
79  ScCellEditSource(ScDocShell* pDocSh, const ScAddress& rP);
80  virtual ~ScCellEditSource() override;
81 
82  // GetEditEngine is needed because the forwarder doesn't have field functions
83  virtual ScEditEngineDefaulter* GetEditEngine() override;
84 
85  virtual std::unique_ptr<SvxEditSource> Clone() const override;
86  virtual SvxTextForwarder* GetTextForwarder() override;
87 
88  virtual void UpdateData() override;
89 
90  void SetDoUpdateData(bool bValue);
91  bool IsDirty() const;
92 };
93 
94 class ScAnnotationEditSource final : public SvxEditSource, public SfxListener
95 {
96 private:
99  std::unique_ptr<ScEditEngineDefaulter> pEditEngine;
100  std::unique_ptr<SvxEditEngineForwarder> pForwarder;
102 
104 public:
105  ScAnnotationEditSource(ScDocShell* pDocSh, const ScAddress& rP);
106  virtual ~ScAnnotationEditSource() override;
107 
108  virtual std::unique_ptr<SvxEditSource> Clone() const override ;
109  virtual SvxTextForwarder* GetTextForwarder() override;
110  virtual void UpdateData() override;
111 
112  virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
113 };
114 
115 // EditSource with a shared forwarder for all children of one text object
116 
117 class ScSimpleEditSource final : public SvxEditSource
118 {
119 private:
121 
122 public:
124  virtual ~ScSimpleEditSource() override;
125 
126  virtual std::unique_ptr<SvxEditSource> Clone() const override ;
127  virtual SvxTextForwarder* GetTextForwarder() override;
128  virtual void UpdateData() override;
129 
130 };
131 
133 {
134 private:
135  ::std::unique_ptr < ScAccessibleTextData > mpAccessibleTextData;
136 
137 public:
138  ScAccessibilityEditSource( ::std::unique_ptr < ScAccessibleTextData > && pAccessibleCellTextData );
139  virtual ~ScAccessibilityEditSource() override;
140 
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;
147 };
148 
149 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ScSimpleEditSource(SvxTextForwarder *pForw)
Definition: editsrc.cxx:206
virtual SvxTextForwarder * GetTextForwarder() override
Definition: editsrc.cxx:133
Data (incl.
Definition: editsrc.hxx:73
virtual ScEditEngineDefaulter * GetEditEngine() override
Definition: editsrc.cxx:97
virtual void UpdateData() override
Definition: editsrc.cxx:60
SdrObject * GetCaptionObj()
Definition: editsrc.cxx:127
ScAccessibilityEditSource(::std::unique_ptr< ScAccessibleTextData > &&pAccessibleCellTextData)
Definition: editsrc.cxx:233
virtual SvxEditViewForwarder * GetEditViewForwarder(bool bCreate=false) override
Definition: editsrc.cxx:257
std::unique_ptr< ScEditEngineDefaulter > pEditEngine
Definition: editsrc.hxx:99
std::unique_ptr< SvxEditEngineForwarder > pForwarder
Definition: editsrc.hxx:100
virtual SvxTextForwarder * GetTextForwarder() override
Definition: editsrc.cxx:55
virtual std::unique_ptr< SvxEditSource > Clone() const override
Definition: editsrc.cxx:72
virtual ~ScAccessibilityEditSource() override
Definition: editsrc.cxx:238
virtual ~ScHeaderFooterEditSource() override
Definition: editsrc.cxx:43
virtual SvxTextForwarder * GetTextForwarder() override
Definition: editsrc.cxx:247
ScHeaderFooterTextData & mrTextData
Definition: editsrc.hxx:52
virtual void UpdateData() override
Definition: editsrc.cxx:82
virtual SfxBroadcaster & GetBroadcaster() const override
Definition: editsrc.cxx:267
bool IsDirty() const
Definition: editsrc.cxx:92
virtual SvxTextForwarder * GetTextForwarder() override
Definition: editsrc.cxx:77
virtual ~ScCellEditSource() override
Definition: editsrc.cxx:68
ScHeaderFooterEditSource(ScHeaderFooterTextData &rData)
Definition: editsrc.cxx:40
ScDocShell * pDocShell
Definition: editsrc.hxx:97
virtual std::unique_ptr< SvxEditSource > Clone() const override
Definition: editsrc.cxx:242
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: editsrc.cxx:185
SvxTextForwarder * pForwarder
Definition: editsrc.hxx:120
virtual std::unique_ptr< SvxEditSource > Clone() const override
Definition: editsrc.cxx:218
std::unique_ptr< ScCellTextData > pCellTextData
Definition: editsrc.hxx:76
ScHeaderFooterTextObj keeps the authoritative copy of ScHeaderFooterTextData that this class holds re...
Definition: editsrc.hxx:49
::std::unique_ptr< ScAccessibleTextData > mpAccessibleTextData
Definition: editsrc.hxx:135
virtual void UpdateData() override
Definition: editsrc.cxx:262
virtual std::unique_ptr< SvxEditSource > Clone() const override
Definition: editsrc.cxx:122
virtual ~ScAnnotationEditSource() override
Definition: editsrc.cxx:111
virtual std::unique_ptr< SvxEditSource > Clone() const override
Definition: editsrc.cxx:50
virtual ScEditEngineDefaulter * GetEditEngine()=0
ScAnnotationEditSource(ScDocShell *pDocSh, const ScAddress &rP)
Definition: editsrc.cxx:102
ScCellEditSource(ScDocShell *pDocSh, const ScAddress &rP)
Definition: editsrc.cxx:65
virtual SvxTextForwarder * GetTextForwarder() override
Definition: editsrc.cxx:223
void SetDoUpdateData(bool bValue)
Definition: editsrc.cxx:87
virtual void UpdateData() override
Definition: editsrc.cxx:228
virtual ScEditEngineDefaulter * GetEditEngine() override
Definition: editsrc.cxx:45
virtual SvxViewForwarder * GetViewForwarder() override
Definition: editsrc.cxx:252
virtual void UpdateData() override
Definition: editsrc.cxx:163
virtual ~ScSimpleEditSource() override
Definition: editsrc.cxx:214