Update ooo320-m1
[ooovba.git] / binfilter / inc / bf_sw / editsh.hxx
blob722db9e8e350a45eb6ee07068a8d5a94a6fb2188
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: editsh.hxx,v $
10 * $Revision: 1.10 $
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 ************************************************************************/
30 #ifndef _EDITSH_HXX
31 #define _EDITSH_HXX
33 #ifndef _STRING_HXX //autogen
34 #include <tools/string.hxx>
35 #endif
36 #ifndef _SVARRAY_HXX //autogen
37 #include <bf_svtools/svarray.hxx>
38 #endif
39 #ifndef _SV_FONT_HXX //autogen
40 #include <vcl/font.hxx>
41 #endif
42 #ifndef _SVXSWAFOPT_HXX
43 #include <bf_svx/swafopt.hxx>
44 #endif
45 #ifndef _CRSRSH_HXX
46 #include <crsrsh.hxx> // fuer Basisklasse
47 #endif
48 #ifndef _ITABENUM_HXX
49 #include <itabenum.hxx>
50 #endif
51 #ifndef _SWDBDATA_HXX
52 #include <swdbdata.hxx>
53 #endif
54 #ifndef _COM_SUN_STAR_LINGUISTIC2_XSPELLALTERNATIVES_HPP_
55 #include <com/sun/star/linguistic2/XSpellAlternatives.hpp>
56 #endif
57 namespace com { namespace sun { namespace star { namespace uno {
58 template < class > class Sequence;
59 }}}}
60 class PolyPolygon;
61 class DateTime;
62 class CommandExtTextInputData;
64 class Graphic; // fuer GetGraphic
65 class Font;
66 namespace binfilter {
67 class SvStringsDtor;
68 class SvInPlaceObjectRef;
69 class SvInPlaceObject;
70 class SvNumberFormatter;
71 class SfxPoolItem;
72 class SfxItemSet;
73 class BfGraphicObject; // fuer GetGraphicObj
76 class SwDoc;
77 class SvxLinkManager;
78 class SvxAutoCorrect;
80 class SwField; // fuer Felder
81 class SwFieldType;
82 class SwDDEFieldType;
83 class SwNewDBMgr;
85 struct SwDocStat;
86 class SfxDocumentInfo;
88 class SvStringsSort;
89 class SwAutoCompleteWord;
91 class SwFmtRefMark;
92 class SwFmtCol;
93 class SwNumRule; // Numerierung
94 class SwNodeNum; // Numerierung
95 class SwTxtFmtColl;
96 #ifdef USED
97 class SwGrfFmt;
98 class SwGrfFmtColl;
99 #endif
100 class SwGrfNode;
101 class SwFlyFrmFmt;
103 class SwFrmFmt; // fuer GetTxtNodeFmts()
104 class SwCharFmt;
105 class SwExtTextInput;
106 class SwTxtNode; // fuer IsNotMakeTxtNode
107 class SwRootFrm; // fuer CTOR
108 class SwFmtINetFmt; // InsertURL
110 class SwTable;
111 class SwTextBlocks; // fuer GlossaryRW
112 class SwBlockExceptList;
113 class SwFmtFtn;
114 class SpellCheck;
115 class SwSection;
116 class SwSectionFmt;
117 class SwTOXMarks;
118 class SwTOXBase;
119 class SwTOXType;
120 class SwTableAutoFmt;
121 class SwPageDesc;
122 class SchMemChart;
124 class SwTxtINetFmt;
125 class SwSeqFldList;
126 class SwGlblDocContent;
127 class SwGlblDocContents;
128 class SwRedline;
129 class SwRedlineData;
130 class SwFtnInfo;
131 class SwEndNoteInfo;
132 class SwLineNumberInfo;
133 class SwAttrSet;
134 class SwAuthEntry;
136 //STRIP008 namespace com { namespace sun { namespace star { namespace uno {
137 //STRIP008 template < class > class Sequence;
138 //STRIP008 }}}};
141 // Flags for GetScriptType - to define how handle weak - scripts (b.e.
142 // symbol characters):
143 // GETSCRIPT_WEAKTOAPPLANGSCRIPT:
144 // app language define the script type if only weak characters
145 // are selected and before the weak script no weak script if found
146 // (mostly the default for Get any attributes, etc)
147 // GETSCRIPT_WEAKTOAPPLANGSCRIPT:
148 // app language defines the script type if only weak characters
149 // are selected and before the weak script no weak script is found
150 // (mostly the default for Get any attributes, etc)
151 // GETSCRIPT_WEAKTOALL:
152 // all script flags are set.
153 // are selected and before the weak script no weak script if found
154 // (mostly the default for Get any attributes, etc)
155 #define GETSCRIPT_WEAKTOAPPLANGSCRIPT 0
156 #define GETSCRIPT_WEAKTOALL 1
159 #define GETSELTXT_PARABRK_TO_BLANK 0
160 #define GETSELTXT_PARABRK_KEEP 1
161 #define GETSELTXT_PARABRK_TO_ONLYCR 2
163 /****************************************************************
164 * zum Abfragen der INet-Attribute fuer den Navigator
165 ****************************************************************/
166 struct SwGetINetAttr
168 String sText;
169 const SwTxtINetFmt& rINetAttr;
171 SwGetINetAttr( const String& rTxt, const SwTxtINetFmt& rAttr )
172 : sText( rTxt ), rINetAttr( rAttr )
175 SV_DECL_PTRARR_DEL( SwGetINetAttrs, SwGetINetAttr*, 0, 5 )
177 /****************************************************************
178 * Typen der Inhaltsformen
179 ****************************************************************/
180 #define CNT_TXT 0x0001
181 #define CNT_GRF 0x0002
182 #define CNT_OLE 0x0010
183 /* Teste einen USHORT auf eine bestimmte Inhaltsform */
184 #define CNT_HasTxt(USH) ((USH)&CNT_TXT)
185 #define CNT_HasGrf(USH) ((USH)&CNT_GRF)
186 #define CNT_HasOLE(USH) ((USH)&CNT_OLE)
188 class SwEditShell: public SwCrsrShell
190 static SvxSwAutoFmtFlags* pAutoFmtFlags;
192 // fuer die privaten Methoden DelRange und die vom AutoCorrect
193 friend void _InitCore();
194 friend void _FinitCore();
195 // fuer die PamCorrAbs/-Rel Methoden
197 SfxPoolItem& _GetChrFmt( SfxPoolItem& ) const;
200 * liefert einen Pointer auf einen SwGrfNode; dieser wird von
201 * GetGraphic() und GetGraphicSize() verwendet.
206 public:
208 #ifdef USED
209 // GRF
210 USHORT GetGrfFmtCollCount() const;
211 SwGrfFmtColl& GetGrfFmtColl( USHORT nGrfFmtColl) const;
212 void DelGrfFmtColl(USHORT nFmt);
213 SwGrfFmtColl* GetCurGrfFmtColl() const;
214 void SetGrfFmtColl(SwGrfFmtColl*);
215 SwGrfFmtColl *MakeGrfFmtColl(const String &rFmtCollName,
216 SwGrfFmtColl *pDerivedFrom = 0);
217 #endif
219 // Gebe die "Auto-Collection" mit der Id zurueck. Existiert
220 // sie noch nicht, dann erzuege sie
221 // return das geforderte automatische Format - Basis-Klasse !
222 // returne die geforderte automatische Seiten-Vorlage
223 // returne die geforderte automatische NumRule
225 // erfrage ob die Absatz-/Zeichen-/Rahmen-/Seiten - Vorlage benutzt wird
227 // returne das geforderte automatische Format
229 // Felder
230 void Insert(SwField&);
233 //check whether DB fields point to an available data source and returns it
234 BOOL IsFieldDataSourceAvailable(String& rUsedDataSource) const;
237 // Repeat
238 // liefert die Id der letzten Repeatfaehigen Aktion zurueck
239 // fuellt ggf. VARARR mit RedoIds
241 // 0 letzte Aktion, sonst Aktionen bis zum Start der Klammerung nUndoId
242 // mit KillPaMs, ClearMark
243 // wiederholt
244 // wiederholt
245 #ifdef USED
246 // Aktionen klammern
247 #endif
248 // fuer alle Sichten auf dieses Dokument
249 void StartAllAction();
250 void EndAllAction();
252 //Damit Start-/EndActions aufgesetzt werden koennen.
253 void CalcLayout();
255 /* Anwenden der ViewOptions mit Start-/EndAction */
256 inline void ApplyViewOptions( const SwViewOption &rOpt );
259 // Is spelling active somewhere else?
260 // Is text conversion active somewhere else?
261 BOOL HasConvIter() const;
263 // special insert: Insert a new text node just before or after a section or
264 // table, if the cursor is positioned at the start/end of said
265 // section/table. The purpose of the method is to allow users to inert text
266 // at certain 'impossible' position, e.g. before a table at the document
267 // start or between to sections.
268 bool DoSpecialInsert();
269 bool CanSpecialInsert() const;
271 // Optimierung UI
273 inline const SvxLinkManager& GetLinkManager() const;
275 // Numberformatter vom Doc erfragen
276 const SvNumberFormatter* GetNumberFormatter() const
277 { return ((SwEditShell*)this)->GetNumberFormatter(); }
279 virtual ~SwEditShell();
281 private:
282 // fuer METWARE:
283 // es wird nicht kopiert und nicht zugewiesen
284 SwEditShell(const SwEditShell &);
285 const SwEditShell &operator=(const SwEditShell &);
288 inline void SwEditShell::ApplyViewOptions( const SwViewOption &rOpt )
290 SwCrsrShell::StartAction();
291 ViewShell::ApplyViewOptions( rOpt );
292 SwEditShell::EndAction();
295 inline const SvxLinkManager& SwEditShell::GetLinkManager() const
296 { return ((SwEditShell*)this)->GetLinkManager(); }
299 * Klasse fuer den automatisierten Aufruf von Start- und
300 * EndAction();
305 * Klasse fuer den automatisierten Aufruf von Start- und
306 * EndCrsrMove();
308 class SwMvKontext {
309 SwEditShell *pSh;
310 public:
311 SwMvKontext(SwEditShell *pShell );
312 ~SwMvKontext();
315 #define MV_KONTEXT(x) SwMvKontext _aMvKontext_(x)
319 } //namespace binfilter
320 #endif