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 $
10 * $Revision: 1.17.32.1 $
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 #include "address.hxx"
35 #include <svx/unoedsrc.hxx>
36 #include <svtools/lstner.hxx>
40 class ScEditEngineDefaulter
;
41 class SvxEditEngineForwarder
;
44 class ScHeaderFooterContentObj
;
46 class ScHeaderFooterTextData
;
47 class ScAccessibleTextData
;
51 class ScHeaderFooterChangedHint
: public SfxHint
57 ScHeaderFooterChangedHint(USHORT nP
);
58 ~ScHeaderFooterChangedHint();
60 USHORT
GetPart() const { return nPart
; }
64 // all ScSharedHeaderFooterEditSource objects for a single text share the same data
66 class ScSharedHeaderFooterEditSource
: public SvxEditSource
69 ScHeaderFooterTextData
* pTextData
;
72 ScHeaderFooterTextData
* GetTextData() const { return pTextData
; } // for ScHeaderFooterEditSource
75 ScSharedHeaderFooterEditSource( ScHeaderFooterTextData
* pData
);
76 virtual ~ScSharedHeaderFooterEditSource();
78 // GetEditEngine is needed because the forwarder doesn't have field functions
79 ScEditEngineDefaulter
* GetEditEngine();
81 virtual SvxEditSource
* Clone() const ;
82 virtual SvxTextForwarder
* GetTextForwarder();
84 virtual void UpdateData();
88 // ScHeaderFooterEditSource with local copy of ScHeaderFooterTextData is used by field objects
90 class ScHeaderFooterEditSource
: public ScSharedHeaderFooterEditSource
93 ScHeaderFooterEditSource( ScHeaderFooterContentObj
* pContent
, USHORT nP
);
94 ScHeaderFooterEditSource( ScHeaderFooterContentObj
& rContent
, USHORT nP
);
95 virtual ~ScHeaderFooterEditSource();
97 virtual SvxEditSource
* Clone() const;
101 // Data (incl. EditEngine) for cell EditSource is now shared in ScCellTextData
103 class ScSharedCellEditSource
: public SvxEditSource
106 ScCellTextData
* pCellTextData
;
109 ScCellTextData
* GetCellTextData() const { return pCellTextData
; } // for ScCellEditSource
112 ScSharedCellEditSource( ScCellTextData
* pData
);
113 virtual ~ScSharedCellEditSource();
115 // GetEditEngine is needed because the forwarder doesn't have field functions
116 ScEditEngineDefaulter
* GetEditEngine();
118 virtual SvxEditSource
* Clone() const;
119 virtual SvxTextForwarder
* GetTextForwarder();
121 virtual void UpdateData();
123 void SetDoUpdateData(sal_Bool bValue
);
124 sal_Bool
IsDirty() const;
127 // ScCellEditSource with local copy of ScCellTextData is used by ScCellFieldsObj, ScCellFieldObj
129 class ScCellEditSource
: public ScSharedCellEditSource
132 ScCellEditSource( ScDocShell
* pDocSh
, const ScAddress
& rP
);
133 virtual ~ScCellEditSource();
135 virtual SvxEditSource
* Clone() const;
139 class ScAnnotationEditSource
: public SvxEditSource
, public SfxListener
142 ScDocShell
* pDocShell
;
144 ScEditEngineDefaulter
* pEditEngine
;
145 SvxEditEngineForwarder
* pForwarder
;
148 SdrObject
* GetCaptionObj();
150 ScAnnotationEditSource(ScDocShell
* pDocSh
, const ScAddress
& rP
);
151 virtual ~ScAnnotationEditSource();
153 virtual SvxEditSource
* Clone() const ;
154 virtual SvxTextForwarder
* GetTextForwarder();
155 virtual void UpdateData();
157 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
);
161 // EditSource with a shared forwarder for all children of one text object
163 class ScSimpleEditSource
: public SvxEditSource
166 SvxTextForwarder
* pForwarder
;
169 ScSimpleEditSource( SvxTextForwarder
* pForw
);
170 virtual ~ScSimpleEditSource();
172 virtual SvxEditSource
* Clone() const ;
173 virtual SvxTextForwarder
* GetTextForwarder();
174 virtual void UpdateData();
178 class ScAccessibilityEditSource
: public SvxEditSource
181 ::std::auto_ptr
< ScAccessibleTextData
> mpAccessibleTextData
;
184 ScAccessibilityEditSource( ::std::auto_ptr
< ScAccessibleTextData
> pAccessibleCellTextData
);
185 virtual ~ScAccessibilityEditSource();
187 virtual SvxEditSource
* Clone() const;
188 virtual SvxTextForwarder
* GetTextForwarder();
189 virtual SvxViewForwarder
* GetViewForwarder();
190 virtual SvxEditViewForwarder
* GetEditViewForwarder( sal_Bool bCreate
= sal_False
);
191 virtual void UpdateData();
192 virtual SfxBroadcaster
& GetBroadcaster() const;