Update ooo320-m1
[ooovba.git] / binfilter / inc / bf_sw / docstyle.hxx
blobd2a9293f9d9fd2e4977bc9d3e4a8aeb80c85e9cd
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: docstyle.hxx,v $
10 * $Revision: 1.6 $
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 _DOCSTYLE_HXX
31 #define _DOCSTYLE_HXX
33 #ifndef _SVSTDARR_HXX
34 #define _SVSTDARR_STRINGSDTOR
35 #include <bf_svtools/svstdarr.hxx>
36 #endif
38 #ifndef _SFXSTYLE_HXX //autogen
39 #include <bf_svtools/style.hxx>
40 #endif
42 #ifndef _SFXITEMSET_HXX //autogen
43 #include <bf_svtools/itemset.hxx>
44 #endif
45 namespace binfilter {
47 class SwDoc;
48 class SwDocStyleSheetPool;
49 class SwPageDesc;
50 class SwCharFmt;
51 class SwTxtFmtColl;
52 class SwFrmFmt;
53 class SwNumRule;
55 /*--------------------------------------------------------------------
56 Beschreibung: Lokale Hilfsklasse
57 --------------------------------------------------------------------*/
58 class SwPoolFmtList : public SvStringsDtor
60 public:
61 SwPoolFmtList() {}
62 void Append( char cChar, const String& rStr );
63 void Erase();
67 /*--------------------------------------------------------------------
68 Beschreibung: temp. StyleSheet
69 --------------------------------------------------------------------*/
70 class SwDocStyleSheet : public SfxStyleSheetBase
72 friend class SwDocStyleSheetPool;
73 friend class SwStyleSheetIterator;
75 SwCharFmt* pCharFmt;
76 SwTxtFmtColl* pColl;
77 SwFrmFmt* pFrmFmt;
78 const SwPageDesc* pDesc;
79 const SwNumRule* pNumRule;
81 SwDoc& rDoc;
82 SfxItemSet aCoreSet;
84 BOOL bPhysical;
87 // leere Huelse zum richtigen StyleSheet (Core) machen
88 void Create();
90 // den StyleSheet mit Daten fuellen
91 enum FillStyleType {
92 FillOnlyName,
93 FillAllInfo,
94 FillPhysical
96 BOOL FillStyleSheet( FillStyleType eFType );
99 public:
100 SwDocStyleSheet( SwDoc& rDoc,
101 const String& rName,
102 SwDocStyleSheetPool& rPool,
103 SfxStyleFamily eFam,
104 USHORT nMask);
106 SwDocStyleSheet( const SwDocStyleSheet& );
107 virtual ~SwDocStyleSheet();
109 void Reset();
111 void SetMask(USHORT nMsk) { nMask = nMsk; }
112 void SetFamily(SfxStyleFamily eFam) { nFamily = eFam; }
114 BOOL IsPhysical() const { return bPhysical; }
115 void SetPhysical(BOOL bPhys);
117 void SetItemSet(const SfxItemSet& rSet);
119 virtual SfxItemSet& GetItemSet();
120 virtual const String& GetParent() const;
121 virtual const String& GetFollow() const;
124 // Vorbelegen der member ohne physikalischen Zugriff
125 // wird vom StyleSheetPool benutzt
127 void PresetName(const String& rName) { aName = rName; }
128 void PresetNameAndFamily(const String& rName);
129 void PresetParent(const String& rName){ aParent = rName; }
130 void PresetFollow(const String& rName){ aFollow = rName; }
132 virtual BOOL SetParent( const String& rStr);
133 virtual BOOL SetFollow( const String& rStr);
136 SwCharFmt* GetCharFmt();
137 SwTxtFmtColl* GetCollection();
138 SwFrmFmt* GetFrmFmt();
139 const SwPageDesc* GetPageDesc();
140 const SwNumRule* GetNumRule();
141 void SetNumRule(const SwNumRule& rRule);
145 /*--------------------------------------------------------------------
146 Beschreibung: Iterator fuer den Pool
147 --------------------------------------------------------------------*/
149 class SwStyleSheetIterator : public SfxStyleSheetIterator, public SfxListener
151 SwDocStyleSheet aIterSheet;
152 SwDocStyleSheet aStyleSheet;
153 SwPoolFmtList aLst;
154 USHORT nLastPos;
155 BOOL bFirstCalled;
157 void AppendStyleList(const SvStringsDtor& rLst,
158 BOOL bUsed,
159 USHORT nSection,
160 char cType);
162 public:
163 SwStyleSheetIterator( SwDocStyleSheetPool* pBase,
164 SfxStyleFamily eFam, USHORT n=0xFFFF );
165 virtual ~SwStyleSheetIterator();
167 virtual SfxStyleSheetBase* First();
168 virtual SfxStyleSheetBase* Next();
170 virtual void Notify( SfxBroadcaster&, const SfxHint& );
173 /*--------------------------------------------------------------------
174 Beschreibung: Pool fuer
175 --------------------------------------------------------------------*/
177 class SwDocStyleSheetPool : public SfxStyleSheetBasePool
179 SwDocStyleSheet aStyleSheet;
180 SwDoc& rDoc;
181 BOOL bOrganizer : 1; // TRUE: fuer den Organizer
184 public:
185 SwDocStyleSheetPool( SwDoc&, BOOL bOrganizer = FALSE );
186 virtual ~SwDocStyleSheetPool();
188 virtual SfxStyleSheetBase& Make(const String&, SfxStyleFamily, USHORT nMask, USHORT nPos = 0xffff);
189 virtual SfxStyleSheetBase* Find( const String&, SfxStyleFamily eFam,
190 USHORT n=0xFFFF );
191 virtual BOOL SetParent( SfxStyleFamily eFam, const String &rStyle,
192 const String &rParent );
194 void SetItemSet(const SfxItemSet& rSet) { aStyleSheet.SetItemSet(rSet); }
196 void SetOrganizerMode( BOOL bMode ) { bOrganizer = bMode; }
197 BOOL IsOrganizerMode() const { return bOrganizer; }
199 virtual SfxStyleSheetIterator* CreateIterator( SfxStyleFamily,
200 USHORT nMask );
202 SwDoc& GetDoc() const { return rDoc; }
204 //Fuer die daemlicheren Compiler
205 private:
206 SwDocStyleSheetPool( const SwDocStyleSheetPool& );
210 } //namespace binfilter
211 #endif