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: docstyle.hxx,v $
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 ************************************************************************/
34 #define _SVSTDARR_STRINGSDTOR
35 #include <bf_svtools/svstdarr.hxx>
38 #ifndef _SFXSTYLE_HXX //autogen
39 #include <bf_svtools/style.hxx>
42 #ifndef _SFXITEMSET_HXX //autogen
43 #include <bf_svtools/itemset.hxx>
48 class SwDocStyleSheetPool
;
55 /*--------------------------------------------------------------------
56 Beschreibung: Lokale Hilfsklasse
57 --------------------------------------------------------------------*/
58 class SwPoolFmtList
: public SvStringsDtor
62 void Append( char cChar
, const String
& rStr
);
67 /*--------------------------------------------------------------------
68 Beschreibung: temp. StyleSheet
69 --------------------------------------------------------------------*/
70 class SwDocStyleSheet
: public SfxStyleSheetBase
72 friend class SwDocStyleSheetPool
;
73 friend class SwStyleSheetIterator
;
78 const SwPageDesc
* pDesc
;
79 const SwNumRule
* pNumRule
;
87 // leere Huelse zum richtigen StyleSheet (Core) machen
90 // den StyleSheet mit Daten fuellen
96 BOOL
FillStyleSheet( FillStyleType eFType
);
100 SwDocStyleSheet( SwDoc
& rDoc
,
102 SwDocStyleSheetPool
& rPool
,
106 SwDocStyleSheet( const SwDocStyleSheet
& );
107 virtual ~SwDocStyleSheet();
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
;
157 void AppendStyleList(const SvStringsDtor
& rLst
,
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
;
181 BOOL bOrganizer
: 1; // TRUE: fuer den Organizer
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
,
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
,
202 SwDoc
& GetDoc() const { return rDoc
; }
204 //Fuer die daemlicheren Compiler
206 SwDocStyleSheetPool( const SwDocStyleSheetPool
& );
210 } //namespace binfilter