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 #ifndef INCLUDED_SC_INC_EDITSRC_HXX
21 #define INCLUDED_SC_INC_EDITSRC_HXX
22 
23 #include "address.hxx"
24 #include <editeng/unoedsrc.hxx>
25 #include <svl/lstner.hxx>
26 
27 #include <memory>
28 
31 
32 class ScDocShell;
33 class ScCellTextData;
36 class SdrObject;
37 
39 {
40 public:
41  virtual ScEditEngineDefaulter* GetEditEngine() = 0;
42 };
43 
51 {
52 private:
54 
55 public:
57  virtual ~ScHeaderFooterEditSource() override;
58 
59  // GetEditEngine is needed because the forwarder doesn't have field functions
60  virtual ScEditEngineDefaulter* GetEditEngine() override;
61 
62  virtual std::unique_ptr<SvxEditSource> Clone() const override;
63  virtual SvxTextForwarder* GetTextForwarder() override;
64  virtual void UpdateData() override;
65 };
66 
74 class ScCellEditSource final : public ScEditSource
75 {
76 private:
77  std::unique_ptr<ScCellTextData> pCellTextData;
78 
79 public:
80  ScCellEditSource(ScDocShell* pDocSh, const ScAddress& rP);
81  virtual ~ScCellEditSource() override;
82 
83  // GetEditEngine is needed because the forwarder doesn't have field functions
84  virtual ScEditEngineDefaulter* GetEditEngine() override;
85 
86  virtual std::unique_ptr<SvxEditSource> Clone() const override;
87  virtual SvxTextForwarder* GetTextForwarder() override;
88 
89  virtual void UpdateData() override;
90 
91  void SetDoUpdateData(bool bValue);
92  bool IsDirty() const;
93 };
94 
95 class ScAnnotationEditSource final : public SvxEditSource, public SfxListener
96 {
97 private:
100  std::unique_ptr<ScEditEngineDefaulter> pEditEngine;
101  std::unique_ptr<SvxEditEngineForwarder> pForwarder;
103 
105 public:
106  ScAnnotationEditSource(ScDocShell* pDocSh, const ScAddress& rP);
107  virtual ~ScAnnotationEditSource() override;
108 
109  virtual std::unique_ptr<SvxEditSource> Clone() const override ;
110  virtual SvxTextForwarder* GetTextForwarder() override;
111  virtual void UpdateData() override;
112 
113  virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
114 };
115 
116 // EditSource with a shared forwarder for all children of one text object
117 
118 class ScSimpleEditSource final : public SvxEditSource
119 {
120 private:
122 
123 public:
125  virtual ~ScSimpleEditSource() override;
126 
127  virtual std::unique_ptr<SvxEditSource> Clone() const override ;
128  virtual SvxTextForwarder* GetTextForwarder() override;
129  virtual void UpdateData() override;
130 
131 };
132 
134 {
135 private:
136  ::std::unique_ptr < ScAccessibleTextData > mpAccessibleTextData;
137 
138 public:
139  ScAccessibilityEditSource( ::std::unique_ptr < ScAccessibleTextData > && pAccessibleCellTextData );
140  virtual ~ScAccessibilityEditSource() override;
141 
142  virtual std::unique_ptr<SvxEditSource> Clone() const override;
143  virtual SvxTextForwarder* GetTextForwarder() override;
144  virtual SvxViewForwarder* GetViewForwarder() override;
145  virtual SvxEditViewForwarder* GetEditViewForwarder( bool bCreate = false ) override;
146  virtual void UpdateData() override;
147  virtual SfxBroadcaster& GetBroadcaster() const override;
148 };
149 
150 #endif
151 
152 /* 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:74
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:100
std::unique_ptr< SvxEditEngineForwarder > pForwarder
Definition: editsrc.hxx:101
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:53
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:98
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:121
virtual std::unique_ptr< SvxEditSource > Clone() const override
Definition: editsrc.cxx:218
std::unique_ptr< ScCellTextData > pCellTextData
Definition: editsrc.hxx:77
ScHeaderFooterTextObj keeps the authoritative copy of ScHeaderFooterTextData that this class holds re...
Definition: editsrc.hxx:50
::std::unique_ptr< ScAccessibleTextData > mpAccessibleTextData
Definition: editsrc.hxx:136
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