LibreOffice Module sc (master)  1
AccessibleText.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_SOURCE_UI_INC_ACCESSIBLETEXT_HXX
21 #define INCLUDED_SC_SOURCE_UI_INC_ACCESSIBLETEXT_HXX
22 
23 #include <textuno.hxx>
24 #include <address.hxx>
25 #include "viewdata.hxx"
26 #include <editeng/svxenum.hxx>
27 #include <svl/SfxBroadcaster.hxx>
28 
29 #include <memory>
30 
31 class ScDocShell;
32 class ScViewForwarder;
36 class ScPreviewShell;
37 class EditTextObject;
38 class ScCsvViewForwarder;
39 class ScAccessibleCell;
40 
42 {
43 public:
45 
46  virtual ScAccessibleTextData* Clone() const = 0;
47 
48  virtual void Notify( SfxBroadcaster& /* rBC */, const SfxHint& /* rHint */ ) override {}
49 
50  virtual SvxTextForwarder* GetTextForwarder() = 0;
51  virtual SvxViewForwarder* GetViewForwarder() = 0;
52  virtual SvxEditViewForwarder* GetEditViewForwarder( bool bCreate ) = 0;
54 
55  virtual void UpdateData() = 0;
56  DECL_LINK( NotifyHdl, EENotify&, void );
57 
58 private:
60 
61 };
62 
64  public ScCellTextData
65 {
66 public:
68  const ScAddress& rP)
69  : ScCellTextData(pDocShellP, rP) {}
70  virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override { ScCellTextData::Notify(rBC, rHint); }
71 
72  virtual void UpdateData() override { ScCellTextData::UpdateData(); }
73 };
74 
75 // ScAccessibleCellTextData: shared data between sub objects of an accessible cell text object
76 
78 {
79 public:
81  const ScAddress& rP, ScSplitPos eSplitPos, ScAccessibleCell* pAccCell);
82  virtual ~ScAccessibleCellTextData() override;
83 
84  virtual ScAccessibleTextData* Clone() const override;
85 
86  virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
87 
88  virtual SvxTextForwarder* GetTextForwarder() override;
89  virtual SvxViewForwarder* GetViewForwarder() override;
90  virtual SvxEditViewForwarder* GetEditViewForwarder( bool bCreate ) override;
91 
92 private:
93  std::unique_ptr<ScViewForwarder> mpViewForwarder;
97 
99  static ScDocShell* GetDocShell(ScTabViewShell* pViewShell);
100 };
101 
103 {
104 public:
105  // Add a para to indicate whether the object is cloned
106  ScAccessibleEditObjectTextData(EditView* pEditView, OutputDevice* pWin, bool isClone = false);
107  virtual ~ScAccessibleEditObjectTextData() override;
108 
109  virtual ScAccessibleTextData* Clone() const override;
110 
111  virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
112 
113  virtual SvxTextForwarder* GetTextForwarder() override;
114  virtual SvxViewForwarder* GetViewForwarder() override;
115  virtual SvxEditViewForwarder* GetEditViewForwarder( bool bCreate ) override;
116 
117  virtual void UpdateData() override { }
118 
119  DECL_LINK( NotifyHdl, EENotify&, void );
120 protected:
121  std::unique_ptr<ScEditObjectViewForwarder> mpViewForwarder;
122  std::unique_ptr<ScEditViewForwarder> mpEditViewForwarder;
125  std::unique_ptr<SvxEditEngineForwarder> mpForwarder;
128 };
129 
131 {
132 public:
134  virtual ~ScAccessibleEditLineTextData() override;
135 
136  virtual ScAccessibleTextData* Clone() const override;
137 
138  virtual SvxTextForwarder* GetTextForwarder() override;
139  virtual SvxEditViewForwarder* GetEditViewForwarder( bool bCreate ) override;
140 
141  void Dispose();
142  void TextChanged();
143  void StartEdit();
144  void EndEdit();
145 private:
146  void ResetEditMode();
147 
149 };
150 
152 {
153 public:
155  const ScAddress& rP);
156  virtual ~ScAccessiblePreviewCellTextData() override;
157 
158  virtual ScAccessibleTextData* Clone() const override;
159 
160  virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
161 
162  virtual SvxTextForwarder* GetTextForwarder() override;
163  virtual SvxViewForwarder* GetViewForwarder() override;
164  virtual SvxEditViewForwarder* GetEditViewForwarder( bool /* bCreate */ ) override { return nullptr; }
165 
166 private:
167  std::unique_ptr<ScPreviewViewForwarder> mpViewForwarder;
169 
171  static ScDocShell* GetDocShell(ScPreviewShell* pViewShell);
172 };
173 
175 {
176 public:
178  const OUString& rText, const ScAddress& rP, bool bColHeader, bool bRowHeader);
179  virtual ~ScAccessiblePreviewHeaderCellTextData() override;
180 
181  virtual ScAccessibleTextData* Clone() const override;
182 
183  virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
184 
185  virtual SvxTextForwarder* GetTextForwarder() override;
186  virtual SvxViewForwarder* GetViewForwarder() override;
187  virtual SvxEditViewForwarder* GetEditViewForwarder( bool /* bCreate */ ) override { return nullptr; }
188 
189 private:
190  std::unique_ptr<ScPreviewViewForwarder> mpViewForwarder;
192  OUString maText;
195 
197  static ScDocShell* GetDocShell(ScPreviewShell* pViewShell);
198 };
199 
201 {
202 public:
204  const EditTextObject* pEditObj, SvxAdjust eAdjust);
205  virtual ~ScAccessibleHeaderTextData() override;
206 
207  virtual ScAccessibleTextData* Clone() const override;
208 
209  virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
210 
211  virtual SvxTextForwarder* GetTextForwarder() override;
212  virtual SvxViewForwarder* GetViewForwarder() override;
213  virtual SvxEditViewForwarder* GetEditViewForwarder( bool /* bCreate */ ) override { return nullptr; }
214 
215  virtual void UpdateData() override { }
216 private:
219  std::unique_ptr<ScEditEngineDefaulter> mpEditEngine;
220  std::unique_ptr<SvxEditEngineForwarder> mpForwarder;
225 };
226 
228 {
229 public:
231  const OUString& sText, const ScAddress& aCellPos, bool bMarkNote);
232  virtual ~ScAccessibleNoteTextData() override;
233 
234  virtual ScAccessibleTextData* Clone() const override;
235 
236  virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
237 
238  virtual SvxTextForwarder* GetTextForwarder() override;
239  virtual SvxViewForwarder* GetViewForwarder() override;
240  virtual SvxEditViewForwarder* GetEditViewForwarder( bool /* bCreate */ ) override { return nullptr; }
241 
242  virtual void UpdateData() override { }
243 private:
246  std::unique_ptr<ScEditEngineDefaulter> mpEditEngine;
247  std::unique_ptr<SvxEditEngineForwarder> mpForwarder;
249  OUString msText;
253 };
254 
256 {
257 private:
258  typedef ::std::unique_ptr< SvxTextForwarder > TextForwarderPtr;
259  typedef ::std::unique_ptr< ScCsvViewForwarder > ViewForwarderPtr;
260 
263  TextForwarderPtr mpTextForwarder;
264  ViewForwarderPtr mpViewForwarder;
265  OUString maCellText;
267 
268 public:
269  explicit ScAccessibleCsvTextData(
270  OutputDevice* pWindow,
271  EditEngine* pEditEngine,
272  const OUString& rCellText,
273  const Size& rCellSize );
274  virtual ~ScAccessibleCsvTextData() override;
275 
276  virtual ScAccessibleTextData* Clone() const override;
277 
278  virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
279 
280  virtual SvxTextForwarder* GetTextForwarder() override;
281  virtual SvxViewForwarder* GetViewForwarder() override;
282  virtual SvxEditViewForwarder* GetEditViewForwarder( bool bCreate ) override;
283 
284  virtual void UpdateData() override {}
285 };
286 
287 #endif
288 
289 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ScAccessibleCell * mpAccessibleCell
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
virtual ~ScAccessibleCellTextData() override
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
DECL_LINK(NotifyHdl, EENotify &, void)
std::unique_ptr< ScPreviewViewForwarder > mpViewForwarder
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
virtual ScAccessibleTextData * Clone() const override
virtual SvxTextForwarder * GetTextForwarder() override
virtual SvxEditViewForwarder * GetEditViewForwarder(bool bCreate) override
std::unique_ptr< SvxEditEngineForwarder > mpForwarder
virtual SvxEditViewForwarder * GetEditViewForwarder(bool) override
ScAccessiblePreviewCellTextData(ScPreviewShell *pViewShell, const ScAddress &rP)
std::unique_ptr< ScEditViewForwarder > mpEditViewForwarder
virtual SvxEditViewForwarder * GetEditViewForwarder(bool bCreate) override
virtual ~ScAccessibleNoteTextData() override
std::unique_ptr< ScEditEngineDefaulter > mpEditEngine
virtual ScAccessibleTextData * Clone() const override
virtual ScAccessibleTextData * Clone() const override
virtual SvxEditViewForwarder * GetEditViewForwarder(bool) override
std::unique_ptr< ScPreviewViewForwarder > mpViewForwarder
std::unique_ptr< ScViewForwarder > mpViewForwarder
virtual void UpdateData() override
ScPreviewShell * mpViewShell
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
virtual SvxEditViewForwarder * GetEditViewForwarder(bool bCreate) override
const EditTextObject * mpEditObj
virtual SvxViewForwarder * GetViewForwarder() override
SfxBroadcaster & GetBroadcaster() const
virtual SvxViewForwarder * GetViewForwarder() override
std::unique_ptr< SvxEditEngineForwarder > mpForwarder
ScAccessibleEditLineTextData(EditView *pEditView, OutputDevice *pWin)
std::unique_ptr< SvxEditEngineForwarder > mpForwarder
ScSplitPos
Definition: viewdata.hxx:45
virtual SvxTextForwarder * GetTextForwarder()=0
virtual ~ScAccessibleCsvTextData() override
virtual SvxEditViewForwarder * GetEditViewForwarder(bool) override
virtual SvxViewForwarder * GetViewForwarder()=0
virtual ScAccessibleTextData * Clone() const override
virtual SvxViewForwarder * GetViewForwarder() override
TextForwarderPtr mpTextForwarder
ScTabViewShell * mpViewShell
virtual ~ScAccessiblePreviewHeaderCellTextData() override
virtual SvxTextForwarder * GetTextForwarder() override
ScPreviewViewForwarder * mpViewForwarder
std::unique_ptr< ScEditEngineDefaulter > mpEditEngine
void UpdateData()
Definition: textuno.cxx:856
ScAccessibleCsvTextData(OutputDevice *pWindow, EditEngine *pEditEngine, const OUString &rCellText, const Size &rCellSize)
VclPtr< OutputDevice > mpWindow
virtual SvxViewForwarder * GetViewForwarder() override
virtual SvxTextForwarder * GetTextForwarder() override
SvxAdjust
virtual void UpdateData() override
virtual SvxViewForwarder * GetViewForwarder() override
virtual ScAccessibleTextData * Clone() const override
virtual SvxTextForwarder * GetTextForwarder() override
virtual SvxTextForwarder * GetTextForwarder() override
virtual SvxTextForwarder * GetTextForwarder() override
virtual ScAccessibleTextData * Clone() const override
ScPreviewViewForwarder * mpViewForwarder
virtual void UpdateData() override
This base class provides an implementation of the AccessibleCell service.
virtual ~ScAccessibleEditLineTextData() override
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
virtual ~ScAccessibleEditObjectTextData() override
virtual void Notify(SfxBroadcaster &, const SfxHint &) override
virtual SvxTextForwarder * GetTextForwarder() override
VclPtr< OutputDevice > mpWindow
virtual SvxEditViewForwarder * GetEditViewForwarder(bool bCreate)=0
virtual SvxViewForwarder * GetViewForwarder() override
::std::unique_ptr< ScCsvViewForwarder > ViewForwarderPtr
virtual ~ScAccessiblePreviewCellTextData() override
ScAccessibleEditObjectTextData(EditView *pEditView, OutputDevice *pWin, bool isClone=false)
virtual SvxEditViewForwarder * GetEditViewForwarder(bool) override
SfxBroadcaster maBroadcaster
DECL_LINK(NotifyHdl, EENotify &, void)
virtual void UpdateData()=0
virtual ScAccessibleTextData * Clone() const override
virtual SvxTextForwarder * GetTextForwarder() override
virtual SvxViewForwarder * GetViewForwarder() override
virtual ScAccessibleTextData * Clone() const =0
virtual ScAccessibleTextData * Clone() const override
virtual void UpdateData() override
ScAccessiblePreviewHeaderCellTextData(ScPreviewShell *pViewShell, const OUString &rText, const ScAddress &rP, bool bColHeader, bool bRowHeader)
ScAccessibleHeaderTextData(ScPreviewShell *pViewShell, const EditTextObject *pEditObj, SvxAdjust eAdjust)
ScAccessibleNoteTextData(ScPreviewShell *pViewShell, const OUString &sText, const ScAddress &aCellPos, bool bMarkNote)
std::unique_ptr< ScEditObjectViewForwarder > mpViewForwarder
virtual ~ScAccessibleHeaderTextData() override
ViewForwarderPtr mpViewForwarder
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
ScDocShell * GetDocShell() const
Definition: textuno.hxx:354
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: textuno.cxx:877
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
virtual SvxEditViewForwarder * GetEditViewForwarder(bool bCreate) override
ScAccessibleCellTextData(ScTabViewShell *pViewShell, const ScAddress &rP, ScSplitPos eSplitPos, ScAccessibleCell *pAccCell)
ScAccessibleCellBaseTextData(ScDocShell *pDocShellP, const ScAddress &rP)
::std::unique_ptr< SvxTextForwarder > TextForwarderPtr
virtual void UpdateData() override