1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: editsrc.hxx,v $
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
35 #include "global.hxx" // ScRange, ScAddress
38 #ifndef _SVX_UNOEDSRC_HXX
39 #include <bf_svx/unoedsrc.hxx>
42 #ifndef _SFXLSTNER_HXX //autogen
43 #include <bf_svtools/lstner.hxx>
49 class ScEditEngineDefaulter
;
50 class SvxEditEngineForwarder
;
53 class ScHeaderFooterContentObj
;
55 class ScHeaderFooterTextData
;
56 class ScAccessibleTextData
;
59 class ScHeaderFooterChangedHint
: public SfxHint
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
77 ScHeaderFooterTextData
* pTextData
;
80 ScHeaderFooterTextData
* GetTextData() const { return pTextData
; } // for ScHeaderFooterEditSource
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
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
114 ScCellTextData
* pCellTextData
;
117 ScCellTextData
* GetCellTextData() const { return pCellTextData
; } // for ScCellEditSource
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
140 ScCellEditSource( ScDocShell
* pDocSh
, const ScAddress
& rP
);
141 virtual ~ScCellEditSource();
143 virtual SvxEditSource
* Clone() const;
147 class ScAnnotationEditSource
: public SvxEditSource
, public SfxListener
150 ScDocShell
* pDocShell
;
152 ScEditEngineDefaulter
* pEditEngine
;
153 SvxEditEngineForwarder
* pForwarder
;
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
173 SvxTextForwarder
* pForwarder
;
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
188 ::std::auto_ptr
< ScAccessibleTextData
> mpAccessibleTextData
;
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