Update ooo320-m1
[ooovba.git] / sw / source / filter / inc / fltshell.hxx
blob463a4305c4cf0cb2394b693c6cc36fb59f11fea0
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: fltshell.hxx,v $
10 * $Revision: 1.19 $
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 _FLTSHELL_HXX
31 #define _FLTSHELL_HXX
33 #include <deque>
35 #include <com/sun/star/text/HoriOrientation.hpp>
36 #include <com/sun/star/text/VertOrientation.hpp>
37 #include <com/sun/star/text/RelOrientation.hpp>
38 #include <hintids.hxx>
39 #ifndef _KEYCOD_HXX //autogen
40 #include <vcl/keycod.hxx>
41 #endif
42 #include <tools/datetime.hxx>
43 #include <svx/brkitem.hxx>
44 #include <poolfmt.hxx>
45 #include <fmtornt.hxx>
46 #include <ndindex.hxx>
47 #include <IDocumentRedlineAccess.hxx>
49 class SwTOXBase;
50 class SwFltShell;
51 class SwField;
52 class SwFieldType;
53 class Graphic;
54 class SwTableBox;
55 class SwDoc;
56 class SwPaM;
58 using namespace com::sun::star;
60 inline void SwFltClearFlag(ULONG& rFieldFlags, int no)
61 { rFieldFlags &= ~(1L << no); }
63 inline void SwFltSetFlag(ULONG& rFieldFlags, int no)
64 { rFieldFlags |= 1L << no; }
66 inline BOOL SwFltGetFlag(ULONG nFieldFlags, int no)
67 { return (nFieldFlags & (1L << no)) != 0; }
69 // Stack-Eintrag fuer die Attribute Es werden immer Pointer auf neue Attribute uebergeben.
70 class SwFltStackEntry
72 public:
73 SwNodeIndex nMkNode;
74 SwNodeIndex nPtNode;
75 SfxPoolItem * pAttr;// Format Attribute
76 long nHandle; // fuer verschachtelte Attrs, z.B. Bookmarks
77 xub_StrLen nMkCntnt;// Nachbildung von Mark()
78 xub_StrLen nPtCntnt;// Nachbildung von GetPoint()
80 BOOL bOld; // to mark Attributes *before* skipping field results
81 BOOL bLocked;
82 BOOL bCopied;
83 BOOL bConsumedByField;
85 SW_DLLPUBLIC SwFltStackEntry(const SwPosition & rStartPos, SfxPoolItem* pHt );
86 SW_DLLPUBLIC SwFltStackEntry(const SwFltStackEntry& rEntry);
87 SW_DLLPUBLIC ~SwFltStackEntry();
89 void SetStartPos(const SwPosition & rStartPos);
90 SW_DLLPUBLIC void SetEndPos( const SwPosition & rEndPos);
91 SW_DLLPUBLIC BOOL MakeRegion(SwDoc* pDoc, SwPaM& rRegion, BOOL bCheck );
94 class SW_DLLPUBLIC SwFltControlStack
96 typedef std::deque<SwFltStackEntry*> Entries;
97 typedef Entries::iterator myEIter;
98 Entries maEntries;
99 friend class SwFltShell;
101 ULONG nFieldFlags;
102 KeyCode aEmptyKeyCode; // fuer Bookmarks
104 protected:
105 SwDoc* pDoc;
106 BOOL bIsEndStack;
108 void MoveAttrs( const SwPosition& rPos );
109 virtual void SetAttrInDoc(const SwPosition& rTmpPos, SwFltStackEntry* pEntry);
111 public:
112 enum Flags
114 HYPO,
115 TAGS_DO_ID,
116 TAGS_VISIBLE,
117 BOOK_TO_VAR_REF,
118 BOOK_AND_REF,
119 TAGS_IN_TEXT,
120 ALLOW_FLD_CR,
121 NO_FLD_CR,
122 DONT_HARD_PROTECT
125 SwFltControlStack(SwDoc* pDo, ULONG nFieldFl);
126 virtual ~SwFltControlStack();
128 BOOL IsFlagSet(Flags no) const { return ::SwFltGetFlag(nFieldFlags, no);}
130 void NewAttr(const SwPosition& rPos, const SfxPoolItem & rAttr );
132 virtual void SetAttr(const SwPosition& rPos, USHORT nAttrId=0, BOOL bTstEnde=TRUE, long nHand = LONG_MAX, BOOL consumedByField=FALSE);
134 void StealAttr(const SwPosition* pPos, USHORT nAttrId = 0);
135 void MarkAllAttrsOld();
136 void KillUnlockedAttrs(const SwPosition& pPos);
137 SfxPoolItem* GetFmtStackAttr(USHORT nWhich, USHORT * pPos = 0);
138 const SfxPoolItem* GetFmtAttr(const SwPosition& rPos, USHORT nWhich);
139 void Delete(const SwPaM &rPam);
141 Entries::size_type Count() { return maEntries.size(); }
142 SwFltStackEntry* operator[](Entries::size_type nIndex)
143 { return maEntries[nIndex]; }
144 void DeleteAndDestroy(Entries::size_type nCnt);
147 class SwFltAnchorClient;
149 class SW_DLLPUBLIC SwFltAnchor : public SfxPoolItem
151 SwFrmFmt* pFrmFmt;
152 SwFltAnchorClient * pClient;
154 public:
155 SwFltAnchor(SwFrmFmt* pFlyFmt);
156 SwFltAnchor(const SwFltAnchor&);
157 virtual ~SwFltAnchor();
159 // "pure virtual Methoden" vom SfxPoolItem
160 virtual int operator==(const SfxPoolItem&) const;
161 virtual SfxPoolItem* Clone(SfxItemPool* = 0) const;
162 void SetFrmFmt(SwFrmFmt * _pFrmFmt);
163 const SwFrmFmt* GetFrmFmt() const;
164 SwFrmFmt* GetFrmFmt();
167 class SwFltAnchorClient : public SwClient
169 SwFltAnchor * m_pFltAnchor;
171 public:
172 SwFltAnchorClient(SwFltAnchor * pFltAnchor);
174 virtual void Modify (SfxPoolItem *pOld, SfxPoolItem *pNew);
178 class SW_DLLPUBLIC SwFltRedline : public SfxPoolItem
180 public:
181 DateTime aStamp;
182 DateTime aStampPrev;
183 RedlineType_t eType;
184 RedlineType_t eTypePrev;
185 USHORT nAutorNo;
186 USHORT nAutorNoPrev;
188 SwFltRedline(RedlineType_t eType_,
189 USHORT nAutorNo_,
190 const DateTime& rStamp_,
191 RedlineType_t eTypePrev_ = nsRedlineType_t::REDLINE_INSERT,
192 USHORT nAutorNoPrev_ = USHRT_MAX,
193 const DateTime* pStampPrev_ = 0)
194 : SfxPoolItem(RES_FLTR_REDLINE), aStamp(rStamp_), eType(eType_),
195 eTypePrev(eTypePrev_), nAutorNo(nAutorNo_), nAutorNoPrev(nAutorNoPrev_)
197 if( pStampPrev_ )
198 aStampPrev = *pStampPrev_;
201 SwFltRedline(const SwFltRedline& rCpy):
202 SfxPoolItem(RES_FLTR_REDLINE),
203 aStamp( rCpy.aStamp ),
204 aStampPrev( rCpy.aStampPrev ),
205 eType( rCpy.eType ),
206 eTypePrev( rCpy.eTypePrev ),
207 nAutorNo( rCpy.nAutorNo ),
208 nAutorNoPrev( rCpy.nAutorNoPrev )
210 // "pure virtual Methoden" vom SfxPoolItem
211 virtual int operator==(const SfxPoolItem& rItem) const;
212 virtual SfxPoolItem* Clone(SfxItemPool* = 0) const;
215 class SW_DLLPUBLIC SwFltBookmark : public SfxPoolItem
217 friend class SwFltShell; // darf aName und aVal uebersetzen
218 long nHandle;
219 String aName;
220 String aVal;
221 BOOL bOnlyRef; // "FRAGE"-Feld, Ref/Seitenrf oder nichts
222 BOOL bRef;
223 BOOL bPgRef;
224 public:
225 SwFltBookmark( const String& rNa, const String& rVa,
226 long nHand, BOOL bOnlyR );
227 SwFltBookmark( const SwFltBookmark& );
228 // "pure virtual Methoden" vom SfxPoolItem
229 virtual int operator==(const SfxPoolItem&) const;
230 virtual SfxPoolItem* Clone(SfxItemPool* = 0) const;
231 const String& GetName() const { return aName; }
232 const String& GetValSys() const { return aVal; }
233 BOOL IsOnlyRef() const { return bOnlyRef; }
234 BOOL IsRef() const { return bRef; }
235 void SetRef(BOOL b = TRUE) { bRef = b; }
236 BOOL IsPgRef() const { return bPgRef; }
237 void SetPgRef(BOOL b = TRUE) { bPgRef = b; }
238 long GetHandle() const { return nHandle; }
241 class SW_DLLPUBLIC SwFltTOX : public SfxPoolItem
243 SwTOXBase* pTOXBase;
244 USHORT nCols;
245 BOOL bHadBreakItem; // there was a break item BEFORE insertion of the TOX
246 BOOL bHadPageDescItem; // ...
247 public:
248 SwFltTOX(SwTOXBase* pBase, USHORT _nCols = 0);
249 SwFltTOX(const SwFltTOX&);
250 // "pure virtual Methoden" vom SfxPoolItem
251 virtual int operator==(const SfxPoolItem&) const;
252 virtual SfxPoolItem* Clone(SfxItemPool* = 0) const;
253 SwTOXBase* GetBase() { return pTOXBase; }
254 USHORT GetCols() const { return nCols; }
255 void SetHadBreakItem( BOOL bVal ) { bHadBreakItem = bVal; }
256 void SetHadPageDescItem( BOOL bVal ) { bHadPageDescItem = bVal; }
257 BOOL HadBreakItem() const { return bHadBreakItem; }
258 BOOL HadPageDescItem() const { return bHadPageDescItem; }
261 class SwFltSection : public SfxPoolItem
263 SwSection* pSection;
264 public:
265 SwFltSection( SwSection* pSect );
266 SwFltSection( const SwFltSection& );
267 // "pure virtual Methoden" vom SfxPoolItem
268 virtual int operator==(const SfxPoolItem&) const;
269 virtual SfxPoolItem* Clone(SfxItemPool* = 0) const;
270 SwSection* GetSection() { return pSection; }
272 // Der WWEndStack verhaelt sich wie der WWControlStck, nur dass die Attribute
273 // auf ihm bis ans Ende des Dokuments gehortet werden, falls auf sie noch
274 // zugegriffen werden muss (z.B. Book/RefMarks, Index u.s.w.)
275 class SwFltEndStack : public SwFltControlStack
277 public:
278 SwFltEndStack(SwDoc* pDo, ULONG nFieldFl)
279 :SwFltControlStack(pDo, nFieldFl)
281 bIsEndStack = TRUE;
285 ///////////////////////////////////////////////////////////////////////////////////////////
287 // hier beginnen die fuer ww1-filter neu erstellten klassen. diese
288 // sollen eine simple oberflaeche fuer die komplexen strukturen des
289 // writers speziell fuer filter sein. soll etwas in den writer gegeben
290 // werden, soll ein << reichen. hierfuer sind neue typen erzeugt
291 // worden. ausserdem soll moeglich sein das objekt nach vielen
292 // zustaenden der momentanen formatierung zu fragen, sodasz diese der
293 // filter nicht selbst verwalten musz.
295 // den anfang macht eine vorlagen-oberklasse, die einfachen umgang mit
296 // formatvorlagen ermoeglicht:
299 class SwFltOutBase
301 SwDoc& rDoc;
302 protected:
303 RndStdIds eFlyAnchor;
304 BOOL bFlyAbsPos;
306 SwDoc& GetDoc() { return rDoc; }
307 SfxItemSet* NewFlyDefaults();
308 SwFltOutBase(SwDoc& rDocu);
309 virtual ~SwFltOutBase();
310 public:
311 virtual SwFltOutBase& operator << (const SfxPoolItem& rItem) = 0;
313 virtual const SfxPoolItem& GetAttr(USHORT nWhich) = 0;
314 virtual const SfxPoolItem& GetNodeOrStyAttr(USHORT nWhich) = 0;
316 virtual const SfxPoolItem& GetCellAttr(USHORT nWhich);
317 virtual BOOL BeginTable();
318 virtual void NextTableCell();
319 virtual void NextTableRow();
320 virtual void SetTableWidth(SwTwips nW);
321 virtual void SetTableOrient(sal_Int16 eOri);
322 virtual void SetCellWidth(SwTwips nWidth, USHORT nCell);
323 virtual void SetCellHeight(SwTwips nH);
324 virtual void SetCellBorder(const SvxBoxItem& rFmtBox, USHORT nCell);
325 virtual void SetCellSpace(USHORT nSp);
326 virtual void DeleteCell(USHORT nCell);
327 virtual void EndTable();
329 virtual BOOL IsInFly() = 0;
330 virtual void SetFlyFrmAttr(const SfxPoolItem& rAttr) = 0;
331 virtual const SfxPoolItem& GetFlyFrmAttr(USHORT nWhich) = 0;
332 virtual BOOL BeginFly( RndStdIds eAnchor, BOOL bAbsolutePos,
333 const SfxItemSet* pMoreAttrs = 0 );
334 virtual void SetFlyAnchor( RndStdIds eAnchor );
335 virtual void EndFly();
338 class SwFltOutDoc : public SwFltOutBase
340 SwFltControlStack& rStack;
341 SwFltEndStack& rEndStack;
342 SwPaM* pPaM;
343 SwFrmFmt* pFly;
344 // table items:
345 const SwTable* pTable;
346 SwPosition* pTabSavedPos; // set when in table
347 SwPosition* pFlySavedPos; // set when in fly
348 SwTwips nTableWidth;
349 USHORT usTableX;
350 USHORT usTableY;
351 BOOL bReadNoTbl; // Keine Tabellen
353 SwTableBox* GetBox(USHORT ny, USHORT nx = USHRT_MAX);
354 BOOL SeekCell( short nRow, short nCol, BOOL bPam );
355 void SplitTable();
356 public:
357 SwFltOutDoc(SwDoc& rDocu, SwPaM* pP, SwFltControlStack& rStk,
358 SwFltEndStack& rEStk)
359 : SwFltOutBase(rDocu), rStack(rStk), rEndStack(rEStk), pPaM(pP),
360 pFly(0), pTable(0), pTabSavedPos(0), pFlySavedPos(0),
361 nTableWidth(0), bReadNoTbl(FALSE)
364 void SetReadNoTable() { bReadNoTbl = TRUE; }
365 BOOL IsTableWidthSet() const { return 0 != nTableWidth; }
367 virtual SwFltOutBase& operator << (const SfxPoolItem& rItem);
369 virtual const SfxPoolItem& GetAttr(USHORT nWhich);
370 virtual const SfxPoolItem& GetNodeOrStyAttr(USHORT nWhich);
372 BOOL IsInTable();
373 virtual const SfxPoolItem& GetCellAttr(USHORT nWhich);
374 virtual BOOL BeginTable();
375 virtual void NextTableCell();
376 virtual void NextTableRow();
377 virtual void SetTableWidth(SwTwips nW);
378 virtual void SetTableOrient(sal_Int16 eOri);
379 virtual void SetCellWidth(SwTwips nWidth, USHORT nCell);
380 virtual void SetCellHeight(SwTwips nH);
381 virtual void SetCellBorder(const SvxBoxItem& rFmtBox, USHORT nCell);
382 virtual void SetCellSpace(USHORT nSp);
383 virtual void DeleteCell(USHORT nCell);
384 virtual void EndTable();
386 SwFrmFmt* MakeFly( RndStdIds eAnchor, SfxItemSet* pSet );
387 virtual BOOL IsInFly();
388 virtual void SetFlyFrmAttr(const SfxPoolItem& rAttr);
389 virtual const SfxPoolItem& GetFlyFrmAttr(USHORT nWhich);
390 virtual BOOL BeginFly( RndStdIds eAnchor, BOOL bAbsolutePos,
391 const SfxItemSet* pMoreAttrs = 0 );
392 virtual void EndFly();
395 class SwFltFormatCollection : public SwFltOutBase
397 SwTxtFmtColl* pColl;
398 SfxItemSet* pFlyAttrs; // Simulation der Flys in Styles
399 BOOL bHasFly;
400 public:
401 SwFltFormatCollection(SwDoc&, RES_POOL_COLLFMT_TYPE nType);
402 SwFltFormatCollection(SwDoc&, const String& rName );
403 ~SwFltFormatCollection() { if( pFlyAttrs ) delete pFlyAttrs; }
405 void Reset()
407 // --> OD 2007-01-25 #i73790# - method renamed
408 pColl->ResetAllFmtAttr();
409 // <--
410 pColl->SetAuto(FALSE); // nach Empfehlung JP
412 void Derived(SwTxtFmtColl* pBase)
413 { pColl->SetDerivedFrom(pBase); }
415 // SwTxtFmtColl* Search(String, CharSet eSrc);
416 SwTxtFmtColl* GetColl() { return pColl; }
417 void SetHasFly() { bHasFly = TRUE; }
418 SfxItemSet* GetpFlyAttrs() { return pFlyAttrs; }
420 virtual SwFltOutBase& operator << (const SfxPoolItem& rItem);
421 virtual const SfxPoolItem& GetAttr(USHORT nWhich);
422 virtual const SfxPoolItem& GetNodeOrStyAttr(USHORT nWhich);
424 virtual BOOL IsInFly();
425 virtual void SetFlyFrmAttr(const SfxPoolItem& rAttr);
426 virtual const SfxPoolItem& GetFlyFrmAttr(USHORT nWhich);
427 virtual BOOL BeginFly( RndStdIds eAnchor, BOOL bAbsolutePos,
428 const SfxItemSet* pMoreAttrs = 0 );
429 BOOL BeginStyleFly( SwFltOutDoc* pOutDoc );
430 virtual void EndFly();
434 // dies nun ist die zauberhafteklasse: intention: alle eins nach dem
435 // andern hinein'pipe'n. wird eine besondere struktur eingelesen, wird
436 // eine klammer geoeffnet (BeginXxx) und nach beendigung geschlossen
437 // (EndXxx), wobei Xxx zB fuer Fusznoten, Kopf/Fuszzeilen oder
438 // Tabellen steht. Styles funktionieren auch so, haben aber den
439 // unterschied, keine buchstaben zu akzeptieren.
440 // beginnt ein neuer absatz oder aehnliches, wird NextXxx genutzt.
441 // hier ist moeglich, Tab, Zeilenumbruch, Absatzende, Seitenumbruch
442 // und Sektionsende einzufuegen.
444 class SwFltShell
446 SwFltOutDoc* pOutDoc;
447 SwFltFormatCollection* pColls[256];
448 SwFltOutBase* pOut;
450 // SwFltFormatCollection* pFormat; // set when in style-mode
451 SwPageDesc* pCurrentPageDesc;
452 SwPosition* pSavedPos; // set, when in footnote or header/footer -mode
453 #ifdef None
454 #undef None
455 #endif
456 enum SubModes {
457 None,
458 Header,
459 Footer,
460 Footnote,
461 Table,
462 Fly,
463 Style,
465 } eSubMode;
467 // Fly items:
468 USHORT nAktStyle; // zur Indizierung pStyleFlyTable
470 SwFltControlStack aStack;
471 SwFltEndStack aEndStack;
472 SwPaM* pPaM;
474 String sBaseURL;
475 USHORT nPageDescOffset; // fuers update der pagedescs
476 CharSet eSrcCharSet; // charset der quelle
477 friend class SwFltControlStack;
478 BOOL bNewDoc;
479 BOOL bStdPD;
480 BOOL bProtect;
482 public:
483 SwFltShell(SwDoc* , SwPaM& , const String& rBaseURL, BOOL bNew, ULONG = 0);
484 ~SwFltShell();
486 SwDoc& GetDoc() { return *aStack.pDoc; }
488 CharSet SetCharSet(CharSet eNew) { CharSet eOld = eSrcCharSet;
489 eSrcCharSet = eNew;
490 return eOld;
492 void SetUseStdPageDesc() { bStdPD = TRUE; }
493 void SetProtect() { bProtect = TRUE; }
494 SwPageDesc* MakePageDesc(SwPageDesc* pFirstPageDesc = NULL);
495 SwPageDesc& GetPageDesc() { return *pCurrentPageDesc; }
496 void NextTab() { (*this) << BYTE(0x09); }
497 void NextLine() { (*this) << BYTE(0x0a); }
498 void NextParagraph();
499 void NextPage();
500 void NextSection() { pCurrentPageDesc = MakePageDesc(); }
502 SwFltShell& AddGraphic( const String& rPicName );
503 SwFltShell& AddError( const sal_Char* pErr );
504 SwFltShell& EndItem( USHORT nId );
505 SwFltShell& SetStyle( USHORT nStyle );
507 SwFltShell& operator << ( Graphic& );
508 SwFltShell& operator << ( SwFltBookmark& aBook );
509 void SetBookEnd(long nHandle);
510 SwFltShell& operator << ( const String& ); // Vorsicht: CHARSET_ANSI
511 SwFltShell& operator << ( const sal_Unicode );
512 SwFltShell& operator << ( const SwField& );
513 SwFltShell& operator << ( const SfxPoolItem& rItem )
514 { *pOut << rItem; return *this; }
516 // SwFltShell& operator >> (SfxPoolItem&);
517 // methode zum beenden einer sub-sektion, zB Fusznote etc
518 void End() { eSubMode = None; }
519 // methoden zur verwaltung von Header/Footer
520 void BeginHeader(SwPageDesc* =NULL);
521 void BeginFooter(SwPageDesc* =NULL);
522 void EndHeaderFooter();
523 // methoden zur verwaltung von FootNotes
524 void BeginFootnote();
525 void EndFootnote();
526 // methoden zur verwaltung von Tabellen
527 BOOL IsInTable() {
528 return ( pOut == pOutDoc ) ? pOutDoc->IsInTable() : 0; }
529 const SfxPoolItem& GetCellAttr(USHORT nWhich) {
530 return pOut->GetCellAttr(nWhich); }
531 BOOL BeginTable() {
532 BOOL b = pOut->BeginTable();
533 if(b) eSubMode = Table;
534 return b; }
535 void NextTableCell() {
536 pOut->NextTableCell(); }
537 void NextTableRow() {
538 pOut->NextTableRow(); }
539 void SetTableWidth(SwTwips nW) {
540 pOut->SetTableWidth(nW); }
541 BOOL IsTableWidthSet() {
542 return pOutDoc->IsTableWidthSet(); }
543 void SetTableOrient(sal_Int16 eOri) {
544 pOut->SetTableOrient(eOri); }
545 void SetCellWidth(SwTwips nWidth, USHORT nCell = USHRT_MAX ) {
546 pOut->SetCellWidth(nWidth, nCell); }
547 void SetCellHeight(SwTwips nH) {
548 pOut->SetCellHeight(nH); }
549 void SetCellBorder(const SvxBoxItem& rFmtBox, USHORT nCell = USHRT_MAX ){
550 pOut->SetCellBorder(rFmtBox, nCell); }
551 void SetCellSpace(USHORT nSp) {
552 pOut->SetCellSpace(nSp); }
553 void DeleteCell(USHORT nCell = USHRT_MAX) {
554 pOut->DeleteCell(nCell); }
555 void EndTable() {
556 pOut->EndTable(); }
557 // methoden zur verwaltung von Flys
558 BOOL IsInFly() { return pOut->IsInFly(); }
559 BOOL BeginFly( RndStdIds eAnchor = FLY_AT_CNTNT, BOOL bAbsolutePos = FALSE );
560 void SetFlyAnchor( RndStdIds eAnchor )
561 { pOut->SetFlyAnchor( eAnchor ); }
562 void SetFlyXPos( short nXPos, sal_Int16 eHRel = com::sun::star::text::RelOrientation::FRAME,
563 sal_Int16 eHAlign = com::sun::star::text::HoriOrientation::NONE );
564 void SetFlyYPos( short nYPos, sal_Int16 eVRel = com::sun::star::text::RelOrientation::FRAME,
565 sal_Int16 eVAlign = com::sun::star::text::VertOrientation::NONE );
566 void SetFlyFrmAttr(const SfxPoolItem& rAttr){
567 pOut->SetFlyFrmAttr( rAttr ); }
568 void EndFly();
569 // methoden zur verwaltung von styles:
570 void BeginStyle(USHORT nUserCode, RES_POOL_COLLFMT_TYPE aType)
572 ASSERT(nUserCode<sizeof(pColls)/sizeof(*pColls), "code out of bounds");
573 ASSERT(pColls[nUserCode] == NULL, "user codes dublicate");
574 if (eSubMode == Style)
575 EndStyle();
576 pOut = pColls[nUserCode] = new SwFltFormatCollection(GetDoc(), aType);
577 nAktStyle = nUserCode;
578 eSubMode = Style;
580 void BeginStyle( USHORT nUserCode, const String& rName )
582 ASSERT(nUserCode<sizeof(pColls)/sizeof(*pColls), "code out of bounds");
583 ASSERT(pColls[nUserCode] == NULL, "user codes dublicate");
584 if (eSubMode == Style)
585 EndStyle();
586 pOut = pColls[nUserCode] = new SwFltFormatCollection(GetDoc(), rName );
587 nAktStyle = nUserCode;
588 eSubMode = Style;
590 BOOL IsStyleImported(USHORT nUserCode)
591 { return pColls[nUserCode] != 0; }
592 void BaseStyle(USHORT nBased)
594 ASSERT(eSubMode == Style, "wrong state for style");
595 ASSERT(pColls[nBased], "Style based on noexistent style" );
596 if( eSubMode == Style && pColls[nBased]->GetColl() )
597 ((SwFltFormatCollection*)pOut)->Derived(pColls[nBased]->GetColl());
599 void NextStyle(USHORT nWhich, USHORT nNext);
601 void EndStyle()
603 // ASSERT(eSubMode == Style, "wrong state for style");
604 nAktStyle = 0;
605 pOut = pOutDoc;
606 eSubMode = None;
609 BOOL IsFlagSet(SwFltControlStack::Flags no) const
610 { return aStack.IsFlagSet(no); }
611 void ConvertUStr( String& rInOut );
612 String QuoteStr( const String& rIn );
614 // folgende status kann die shell verwalten:
615 const SfxPoolItem& GetNodeOrStyAttr(USHORT nWhich);
616 const SfxPoolItem& GetAttr(USHORT nWhich);
617 const SfxPoolItem& GetFlyFrmAttr(USHORT nWhich);
618 SwFieldType* GetSysFldType(USHORT eWhich);
619 BOOL GetWeightBold();
620 BOOL GetPostureItalic();
621 BOOL GetCrossedOut();
622 BOOL GetContour();
623 BOOL GetCaseKapitaelchen();
624 BOOL GetCaseVersalien();
626 const String& GetBaseURL() const { return sBaseURL; }
629 SW_DLLPUBLIC void UpdatePageDescs(SwDoc &rDoc, sal_uInt16 nInPageDescOffset);
631 #endif
633 /* vi:set tabstop=4 shiftwidth=4 expandtab: */