Update ooo320-m1
[ooovba.git] / binfilter / inc / bf_sc / editsrc.hxx
blob13d3593ea7a849ca0a41aa54ef9acd1718f54ea6
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: editsrc.hxx,v $
10 * $Revision: 1.6 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SC_EDITSRC_HXX
32 #define SC_EDITSRC_HXX
34 #ifndef SC_SCGLOB_HXX
35 #include "global.hxx" // ScRange, ScAddress
36 #endif
38 #ifndef _SVX_UNOEDSRC_HXX
39 #include <bf_svx/unoedsrc.hxx>
40 #endif
42 #ifndef _SFXLSTNER_HXX //autogen
43 #include <bf_svtools/lstner.hxx>
44 #endif
46 #include <memory>
47 namespace binfilter {
49 class ScEditEngineDefaulter;
50 class SvxEditEngineForwarder;
52 class ScDocShell;
53 class ScHeaderFooterContentObj;
54 class ScCellTextData;
55 class ScHeaderFooterTextData;
56 class ScAccessibleTextData;
59 class ScHeaderFooterChangedHint : public SfxHint
61 USHORT nPart;
63 public:
64 TYPEINFO();
65 ScHeaderFooterChangedHint(USHORT nP);
66 ~ScHeaderFooterChangedHint();
68 USHORT GetPart() const { return nPart; }
72 // all ScSharedHeaderFooterEditSource objects for a single text share the same data
74 class ScSharedHeaderFooterEditSource : public SvxEditSource
76 private:
77 ScHeaderFooterTextData* pTextData;
79 protected:
80 ScHeaderFooterTextData* GetTextData() const { return pTextData; } // for ScHeaderFooterEditSource
82 public:
83 ScSharedHeaderFooterEditSource( ScHeaderFooterTextData* pData );
84 virtual ~ScSharedHeaderFooterEditSource();
86 // GetEditEngine is needed because the forwarder doesn't have field functions
87 ScEditEngineDefaulter* GetEditEngine();
89 virtual SvxEditSource* Clone() const ;
90 virtual SvxTextForwarder* GetTextForwarder();
92 virtual void UpdateData();
96 // ScHeaderFooterEditSource with local copy of ScHeaderFooterTextData is used by field objects
98 class ScHeaderFooterEditSource : public ScSharedHeaderFooterEditSource
100 public:
101 ScHeaderFooterEditSource( ScHeaderFooterContentObj* pContent, USHORT nP );
102 ScHeaderFooterEditSource( ScHeaderFooterContentObj& rContent, USHORT nP );
103 virtual ~ScHeaderFooterEditSource();
105 virtual SvxEditSource* Clone() const;
109 // Data (incl. EditEngine) for cell EditSource is now shared in ScCellTextData
111 class ScSharedCellEditSource : public SvxEditSource
113 private:
114 ScCellTextData* pCellTextData;
116 protected:
117 ScCellTextData* GetCellTextData() const { return pCellTextData; } // for ScCellEditSource
119 public:
120 ScSharedCellEditSource( ScCellTextData* pData );
121 virtual ~ScSharedCellEditSource();
123 // GetEditEngine is needed because the forwarder doesn't have field functions
124 ScEditEngineDefaulter* GetEditEngine();
126 virtual SvxEditSource* Clone() const;
127 virtual SvxTextForwarder* GetTextForwarder();
129 virtual void UpdateData();
131 void SetDoUpdateData(sal_Bool bValue);
132 sal_Bool IsDirty() const;
135 // ScCellEditSource with local copy of ScCellTextData is used by ScCellFieldsObj, ScCellFieldObj
137 class ScCellEditSource : public ScSharedCellEditSource
139 public:
140 ScCellEditSource( ScDocShell* pDocSh, const ScAddress& rP );
141 virtual ~ScCellEditSource();
143 virtual SvxEditSource* Clone() const;
147 class ScAnnotationEditSource : public SvxEditSource, public SfxListener
149 private:
150 ScDocShell* pDocShell;
151 ScAddress aCellPos;
152 ScEditEngineDefaulter* pEditEngine;
153 SvxEditEngineForwarder* pForwarder;
154 BOOL bDataValid;
156 public:
157 ScAnnotationEditSource(ScDocShell* pDocSh, const ScAddress& rP);
158 virtual ~ScAnnotationEditSource();
160 virtual SvxEditSource* Clone() const ;
161 virtual SvxTextForwarder* GetTextForwarder();
162 virtual void UpdateData();
164 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
168 // EditSource with a shared forwarder for all children of one text object
170 class ScSimpleEditSource : public SvxEditSource
172 private:
173 SvxTextForwarder* pForwarder;
175 public:
176 ScSimpleEditSource( SvxTextForwarder* pForw );
177 virtual ~ScSimpleEditSource();
179 virtual SvxEditSource* Clone() const ;
180 virtual SvxTextForwarder* GetTextForwarder();
181 virtual void UpdateData();
185 class ScAccessibilityEditSource : public SvxEditSource
187 private:
188 ::std::auto_ptr < ScAccessibleTextData > mpAccessibleTextData;
190 public:
191 ScAccessibilityEditSource( ::std::auto_ptr < ScAccessibleTextData > pAccessibleCellTextData );
192 virtual ~ScAccessibilityEditSource();
194 virtual SvxEditSource* Clone() const;
195 virtual SvxTextForwarder* GetTextForwarder();
196 virtual SvxViewForwarder* GetViewForwarder();
197 virtual SvxEditViewForwarder* GetEditViewForwarder( sal_Bool bCreate = sal_False );
198 virtual void UpdateData();
199 virtual SfxBroadcaster& GetBroadcaster() const;
202 } //namespace binfilter
203 #endif