sync master with lastest vba changes
[ooovba.git] / sc / inc / editsrc.hxx
blob06ba27cd1c92f3c9a0abee1012a81eb0cbf82fc2
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.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>
38 #include <memory>
40 class ScEditEngineDefaulter;
41 class SvxEditEngineForwarder;
43 class ScDocShell;
44 class ScHeaderFooterContentObj;
45 class ScCellTextData;
46 class ScHeaderFooterTextData;
47 class ScAccessibleTextData;
48 class SdrObject;
51 class ScHeaderFooterChangedHint : public SfxHint
53 USHORT nPart;
55 public:
56 TYPEINFO();
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
68 private:
69 ScHeaderFooterTextData* pTextData;
71 protected:
72 ScHeaderFooterTextData* GetTextData() const { return pTextData; } // for ScHeaderFooterEditSource
74 public:
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
92 public:
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
105 private:
106 ScCellTextData* pCellTextData;
108 protected:
109 ScCellTextData* GetCellTextData() const { return pCellTextData; } // for ScCellEditSource
111 public:
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
131 public:
132 ScCellEditSource( ScDocShell* pDocSh, const ScAddress& rP );
133 virtual ~ScCellEditSource();
135 virtual SvxEditSource* Clone() const;
139 class ScAnnotationEditSource : public SvxEditSource, public SfxListener
141 private:
142 ScDocShell* pDocShell;
143 ScAddress aCellPos;
144 ScEditEngineDefaulter* pEditEngine;
145 SvxEditEngineForwarder* pForwarder;
146 BOOL bDataValid;
148 SdrObject* GetCaptionObj();
149 public:
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
165 private:
166 SvxTextForwarder* pForwarder;
168 public:
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
180 private:
181 ::std::auto_ptr < ScAccessibleTextData > mpAccessibleTextData;
183 public:
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;
195 #endif