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 class ScTextWnd;
41 
43 {
44 public:
46 
47  virtual ScAccessibleTextData* Clone() const = 0;
48 
49  virtual void Notify( SfxBroadcaster& /* rBC */, const SfxHint& /* rHint */ ) override {}
50 
51  virtual SvxTextForwarder* GetTextForwarder() = 0;
52  virtual SvxViewForwarder* GetViewForwarder() = 0;
53  virtual SvxEditViewForwarder* GetEditViewForwarder( bool bCreate ) = 0;
55 
56  virtual void UpdateData() = 0;
57  DECL_LINK( NotifyHdl, EENotify&, void );
58 
59 private:
61 
62 };
63 
65  public ScCellTextData
66 {
67 public:
69  const ScAddress& rP)
70  : ScCellTextData(pDocShellP, rP) {}
71  virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override { ScCellTextData::Notify(rBC, rHint); }
72 
73  virtual void UpdateData() override { ScCellTextData::UpdateData(); }
74 };
75 
76 // ScAccessibleCellTextData: shared data between sub objects of an accessible cell text object
77 
79 {
80 public:
82  const ScAddress& rP, ScSplitPos eSplitPos, ScAccessibleCell* pAccCell);
83  virtual ~ScAccessibleCellTextData() override;
84 
85  virtual ScAccessibleTextData* Clone() const override;
86 
87  virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
88 
89  virtual SvxTextForwarder* GetTextForwarder() override;
90  virtual SvxViewForwarder* GetViewForwarder() override;
91  virtual SvxEditViewForwarder* GetEditViewForwarder( bool bCreate ) override;
92 
93 private:
94  std::unique_ptr<ScViewForwarder> mpViewForwarder;
98 
100  static ScDocShell* GetDocShell(ScTabViewShell* pViewShell);
101 };
102 
104 {
105 public:
106  // Add a para to indicate whether the object is cloned
107  ScAccessibleEditObjectTextData(EditView* pEditView, OutputDevice* pWin, bool isClone = false);
108  virtual ~ScAccessibleEditObjectTextData() override;
109 
110  virtual ScAccessibleTextData* Clone() const override;
111 
112  virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
113 
114  virtual SvxTextForwarder* GetTextForwarder() override;
115  virtual SvxViewForwarder* GetViewForwarder() override;
116  virtual SvxEditViewForwarder* GetEditViewForwarder( bool bCreate ) override;
117 
118  virtual void UpdateData() override { }
119 
120  DECL_LINK( NotifyHdl, EENotify&, void );
121 protected:
122  std::unique_ptr<ScEditObjectViewForwarder> mpViewForwarder;
123  std::unique_ptr<ScEditViewForwarder> mpEditViewForwarder;
126  std::unique_ptr<SvxEditEngineForwarder> mpForwarder;
129 };
130 
132 {
133 public:
135  OutputDevice* pWin,
136  ScTextWnd* pTextWnd);
137  virtual ~ScAccessibleEditLineTextData() override;
138 
139  virtual ScAccessibleTextData* Clone() const override;
140 
141  virtual SvxTextForwarder* GetTextForwarder() override;
142  virtual SvxEditViewForwarder* GetEditViewForwarder( bool bCreate ) override;
143 
144  void Dispose();
145  void TextChanged();
146  void StartEdit();
147  void EndEdit();
148 private:
149  void ResetEditMode();
150 
153 };
154 
156 {
157 public:
159  const ScAddress& rP);
160  virtual ~ScAccessiblePreviewCellTextData() override;
161 
162  virtual ScAccessibleTextData* Clone() const override;
163 
164  virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
165 
166  virtual SvxTextForwarder* GetTextForwarder() override;
167  virtual SvxViewForwarder* GetViewForwarder() override;
168  virtual SvxEditViewForwarder* GetEditViewForwarder( bool /* bCreate */ ) override { return nullptr; }
169 
170 private:
171  std::unique_ptr<ScPreviewViewForwarder> mpViewForwarder;
173 
175  static ScDocShell* GetDocShell(ScPreviewShell* pViewShell);
176 };
177 
179 {
180 public:
182  const OUString& rText, const ScAddress& rP, bool bColHeader, bool bRowHeader);
183  virtual ~ScAccessiblePreviewHeaderCellTextData() override;
184 
185  virtual ScAccessibleTextData* Clone() const override;
186 
187  virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
188 
189  virtual SvxTextForwarder* GetTextForwarder() override;
190  virtual SvxViewForwarder* GetViewForwarder() override;
191  virtual SvxEditViewForwarder* GetEditViewForwarder( bool /* bCreate */ ) override { return nullptr; }
192 
193 private:
194  std::unique_ptr<ScPreviewViewForwarder> mpViewForwarder;
196  OUString maText;
199 
201  static ScDocShell* GetDocShell(ScPreviewShell* pViewShell);
202 };
203 
205 {
206 public:
208  const EditTextObject* pEditObj, SvxAdjust eAdjust);
209  virtual ~ScAccessibleHeaderTextData() override;
210 
211  virtual ScAccessibleTextData* Clone() const override;
212 
213  virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
214 
215  virtual SvxTextForwarder* GetTextForwarder() override;
216  virtual SvxViewForwarder* GetViewForwarder() override;
217  virtual SvxEditViewForwarder* GetEditViewForwarder( bool /* bCreate */ ) override { return nullptr; }
218 
219  virtual void UpdateData() override { }
220 private:
223  std::unique_ptr<ScEditEngineDefaulter> mpEditEngine;
224  std::unique_ptr<SvxEditEngineForwarder> mpForwarder;
229 };
230 
232 {
233 public:
235  const OUString& sText, const ScAddress& aCellPos, bool bMarkNote);
236  virtual ~ScAccessibleNoteTextData() override;
237 
238  virtual ScAccessibleTextData* Clone() const override;
239 
240  virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
241 
242  virtual SvxTextForwarder* GetTextForwarder() override;
243  virtual SvxViewForwarder* GetViewForwarder() override;
244  virtual SvxEditViewForwarder* GetEditViewForwarder( bool /* bCreate */ ) override { return nullptr; }
245 
246  virtual void UpdateData() override { }
247 private:
250  std::unique_ptr<ScEditEngineDefaulter> mpEditEngine;
251  std::unique_ptr<SvxEditEngineForwarder> mpForwarder;
253  OUString msText;
257 };
258 
260 {
261 private:
262  typedef ::std::unique_ptr< SvxTextForwarder > TextForwarderPtr;
263  typedef ::std::unique_ptr< ScCsvViewForwarder > ViewForwarderPtr;
264 
267  TextForwarderPtr mpTextForwarder;
268  ViewForwarderPtr mpViewForwarder;
269  OUString maCellText;
271 
272 public:
273  explicit ScAccessibleCsvTextData(
274  OutputDevice* pWindow,
275  EditEngine* pEditEngine,
276  const OUString& rCellText,
277  const Size& rCellSize );
278  virtual ~ScAccessibleCsvTextData() override;
279 
280  virtual ScAccessibleTextData* Clone() const override;
281 
282  virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
283 
284  virtual SvxTextForwarder* GetTextForwarder() override;
285  virtual SvxViewForwarder* GetViewForwarder() override;
286  virtual SvxEditViewForwarder* GetEditViewForwarder( bool bCreate ) override;
287 
288  virtual void UpdateData() override {}
289 };
290 
291 #endif
292 
293 /* 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
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:855
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:876
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
ScAccessibleEditLineTextData(EditView *pEditView, OutputDevice *pWin, ScTextWnd *pTextWnd)
virtual void UpdateData() override