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#pragma once
21
22#include <textuno.hxx>
23#include <address.hxx>
24#include "viewdata.hxx"
25#include <editeng/svxenum.hxx>
27
28#include <memory>
29
30class ScDocShell;
31class ScViewForwarder;
35class ScPreviewShell;
36class EditTextObject;
39class ScTextWnd;
40
42{
43public:
45
46 virtual ScAccessibleTextData* Clone() const = 0;
47
48 virtual void Notify( SfxBroadcaster& /* rBC */, const SfxHint& /* rHint */ ) override {}
49
52 virtual SvxEditViewForwarder* GetEditViewForwarder( bool bCreate ) = 0;
54
55 virtual void UpdateData() = 0;
56 DECL_LINK( NotifyHdl, EENotify&, void );
57
58private:
60
61};
62
64 public ScCellTextData
65{
66public:
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{
79public:
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
92private:
93 std::unique_ptr<ScViewForwarder> mpViewForwarder;
97
99 static ScDocShell* GetDocShell(ScTabViewShell* pViewShell);
100};
101
103{
104public:
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 );
120protected:
121 std::unique_ptr<ScEditObjectViewForwarder> mpViewForwarder;
122 std::unique_ptr<ScEditViewForwarder> mpEditViewForwarder;
125 std::unique_ptr<SvxEditEngineForwarder> mpForwarder;
128};
129
131{
132public:
134 OutputDevice* pWin,
135 ScTextWnd* pTextWnd);
136 virtual ~ScAccessibleEditLineTextData() override;
137
138 virtual ScAccessibleTextData* Clone() const override;
139
140 virtual SvxTextForwarder* GetTextForwarder() override;
141 virtual SvxEditViewForwarder* GetEditViewForwarder( bool bCreate ) override;
142
143 void Dispose();
144 void TextChanged();
145 void StartEdit();
146 void EndEdit();
147private:
148 void ResetEditMode();
149
152};
153
155{
156public:
158 const ScAddress& rP);
159 virtual ~ScAccessiblePreviewCellTextData() override;
160
161 virtual ScAccessibleTextData* Clone() const override;
162
163 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
164
165 virtual SvxTextForwarder* GetTextForwarder() override;
166 virtual SvxViewForwarder* GetViewForwarder() override;
167 virtual SvxEditViewForwarder* GetEditViewForwarder( bool /* bCreate */ ) override { return nullptr; }
168
169private:
170 std::unique_ptr<ScPreviewViewForwarder> mpViewForwarder;
172
174 static ScDocShell* GetDocShell(ScPreviewShell* pViewShell);
175};
176
178{
179public:
181 OUString aText, const ScAddress& rP, bool bColHeader, bool bRowHeader);
183
184 virtual ScAccessibleTextData* Clone() const override;
185
186 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
187
188 virtual SvxTextForwarder* GetTextForwarder() override;
189 virtual SvxViewForwarder* GetViewForwarder() override;
190 virtual SvxEditViewForwarder* GetEditViewForwarder( bool /* bCreate */ ) override { return nullptr; }
191
192private:
193 std::unique_ptr<ScPreviewViewForwarder> mpViewForwarder;
195 OUString maText;
198
200 static ScDocShell* GetDocShell(ScPreviewShell* pViewShell);
201};
202
204{
205public:
207 const EditTextObject* pEditObj, SvxAdjust eAdjust);
208 virtual ~ScAccessibleHeaderTextData() override;
209
210 virtual ScAccessibleTextData* Clone() const override;
211
212 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
213
214 virtual SvxTextForwarder* GetTextForwarder() override;
215 virtual SvxViewForwarder* GetViewForwarder() override;
216 virtual SvxEditViewForwarder* GetEditViewForwarder( bool /* bCreate */ ) override { return nullptr; }
217
218 virtual void UpdateData() override { }
219private:
220 std::unique_ptr<ScPreviewViewForwarder> mxViewForwarder;
222 std::unique_ptr<ScEditEngineDefaulter> mpEditEngine;
223 std::unique_ptr<SvxEditEngineForwarder> mpForwarder;
228};
229
231{
232public:
234 OUString sText, const ScAddress& aCellPos, bool bMarkNote);
235 virtual ~ScAccessibleNoteTextData() override;
236
237 virtual ScAccessibleTextData* Clone() const override;
238
239 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
240
241 virtual SvxTextForwarder* GetTextForwarder() override;
242 virtual SvxViewForwarder* GetViewForwarder() override;
243 virtual SvxEditViewForwarder* GetEditViewForwarder( bool /* bCreate */ ) override { return nullptr; }
244
245 virtual void UpdateData() override { }
246private:
247 std::unique_ptr<ScPreviewViewForwarder> mxViewForwarder;
249 std::unique_ptr<ScEditEngineDefaulter> mpEditEngine;
250 std::unique_ptr<SvxEditEngineForwarder> mpForwarder;
252 OUString msText;
256};
257
259{
260private:
261 typedef ::std::unique_ptr< SvxTextForwarder > TextForwarderPtr;
262 typedef ::std::unique_ptr< ScCsvViewForwarder > ViewForwarderPtr;
263
268 OUString maCellText;
270
271public:
273 OutputDevice* pWindow,
274 EditEngine* pEditEngine,
275 OUString aCellText,
276 const Size& rCellSize );
277 virtual ~ScAccessibleCsvTextData() override;
278
279 virtual ScAccessibleTextData* Clone() const override;
280
281 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
282
283 virtual SvxTextForwarder* GetTextForwarder() override;
284 virtual SvxViewForwarder* GetViewForwarder() override;
285 virtual SvxEditViewForwarder* GetEditViewForwarder( bool bCreate ) override;
286
287 virtual void UpdateData() override {}
288};
289
290/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void UpdateData() override
ScAccessibleCellBaseTextData(ScDocShell *pDocShellP, const ScAddress &rP)
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
virtual ~ScAccessibleCellTextData() override
virtual SvxEditViewForwarder * GetEditViewForwarder(bool bCreate) override
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
virtual SvxTextForwarder * GetTextForwarder() override
std::unique_ptr< ScViewForwarder > mpViewForwarder
virtual SvxViewForwarder * GetViewForwarder() override
ScTabViewShell * mpViewShell
virtual ScAccessibleTextData * Clone() const override
ScAccessibleCell * mpAccessibleCell
ScAccessibleCellTextData(ScTabViewShell *pViewShell, const ScAddress &rP, ScSplitPos eSplitPos, ScAccessibleCell *pAccCell)
@descr This base class provides an implementation of the AccessibleCell service.
virtual void UpdateData() override
::std::unique_ptr< SvxTextForwarder > TextForwarderPtr
virtual SvxViewForwarder * GetViewForwarder() override
virtual SvxTextForwarder * GetTextForwarder() override
ScAccessibleCsvTextData(OutputDevice *pWindow, EditEngine *pEditEngine, OUString aCellText, const Size &rCellSize)
::std::unique_ptr< ScCsvViewForwarder > ViewForwarderPtr
TextForwarderPtr mpTextForwarder
virtual ScAccessibleTextData * Clone() const override
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
virtual SvxEditViewForwarder * GetEditViewForwarder(bool bCreate) override
VclPtr< OutputDevice > mpWindow
ViewForwarderPtr mpViewForwarder
virtual ~ScAccessibleCsvTextData() override
virtual ~ScAccessibleEditLineTextData() override
virtual SvxTextForwarder * GetTextForwarder() override
ScAccessibleEditLineTextData(EditView *pEditView, OutputDevice *pWin, ScTextWnd *pTextWnd)
virtual ScAccessibleTextData * Clone() const override
virtual SvxEditViewForwarder * GetEditViewForwarder(bool bCreate) override
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
VclPtr< OutputDevice > mpWindow
virtual SvxTextForwarder * GetTextForwarder() override
virtual SvxEditViewForwarder * GetEditViewForwarder(bool bCreate) override
virtual void UpdateData() override
std::unique_ptr< ScEditViewForwarder > mpEditViewForwarder
ScAccessibleEditObjectTextData(EditView *pEditView, OutputDevice *pWin, bool isClone=false)
virtual ~ScAccessibleEditObjectTextData() override
DECL_LINK(NotifyHdl, EENotify &, void)
std::unique_ptr< SvxEditEngineForwarder > mpForwarder
virtual ScAccessibleTextData * Clone() const override
virtual SvxViewForwarder * GetViewForwarder() override
std::unique_ptr< ScEditObjectViewForwarder > mpViewForwarder
std::unique_ptr< ScPreviewViewForwarder > mxViewForwarder
ScAccessibleHeaderTextData(ScPreviewShell *pViewShell, const EditTextObject *pEditObj, SvxAdjust eAdjust)
std::unique_ptr< ScEditEngineDefaulter > mpEditEngine
virtual SvxViewForwarder * GetViewForwarder() override
virtual SvxTextForwarder * GetTextForwarder() override
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
virtual void UpdateData() override
virtual ScAccessibleTextData * Clone() const override
virtual ~ScAccessibleHeaderTextData() override
virtual SvxEditViewForwarder * GetEditViewForwarder(bool) override
const EditTextObject * mpEditObj
std::unique_ptr< SvxEditEngineForwarder > mpForwarder
ScAccessibleNoteTextData(ScPreviewShell *pViewShell, OUString sText, const ScAddress &aCellPos, bool bMarkNote)
virtual SvxViewForwarder * GetViewForwarder() override
virtual SvxEditViewForwarder * GetEditViewForwarder(bool) override
std::unique_ptr< ScPreviewViewForwarder > mxViewForwarder
virtual ~ScAccessibleNoteTextData() override
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
virtual ScAccessibleTextData * Clone() const override
virtual void UpdateData() override
virtual SvxTextForwarder * GetTextForwarder() override
ScPreviewShell * mpViewShell
std::unique_ptr< SvxEditEngineForwarder > mpForwarder
std::unique_ptr< ScEditEngineDefaulter > mpEditEngine
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
virtual SvxTextForwarder * GetTextForwarder() override
ScAccessiblePreviewCellTextData(ScPreviewShell *pViewShell, const ScAddress &rP)
std::unique_ptr< ScPreviewViewForwarder > mpViewForwarder
virtual SvxEditViewForwarder * GetEditViewForwarder(bool) override
virtual ~ScAccessiblePreviewCellTextData() override
virtual ScAccessibleTextData * Clone() const override
virtual SvxViewForwarder * GetViewForwarder() override
ScAccessiblePreviewHeaderCellTextData(ScPreviewShell *pViewShell, OUString aText, const ScAddress &rP, bool bColHeader, bool bRowHeader)
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
virtual SvxTextForwarder * GetTextForwarder() override
virtual ~ScAccessiblePreviewHeaderCellTextData() override
virtual SvxViewForwarder * GetViewForwarder() override
virtual SvxEditViewForwarder * GetEditViewForwarder(bool) override
virtual ScAccessibleTextData * Clone() const override
std::unique_ptr< ScPreviewViewForwarder > mpViewForwarder
virtual ScAccessibleTextData * Clone() const =0
virtual SvxTextForwarder * GetTextForwarder()=0
SfxBroadcaster & GetBroadcaster() const
virtual void Notify(SfxBroadcaster &, const SfxHint &) override
SfxBroadcaster maBroadcaster
virtual SvxViewForwarder * GetViewForwarder()=0
virtual void UpdateData()=0
virtual SvxEditViewForwarder * GetEditViewForwarder(bool bCreate)=0
DECL_LINK(NotifyHdl, EENotify &, void)
ScDocShell * GetDocShell() const
Definition: textuno.hxx:346
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: textuno.cxx:842
void UpdateData()
Definition: textuno.cxx:821
SvxAdjust
ScSplitPos
Definition: viewdata.hxx:44