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: uinums.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 ************************************************************************/
33 #include <svtools/svarray.hxx>
34 #include <numrule.hxx>
41 #define MAX_NUM_RULES 9
43 typedef SfxPoolItem
* SfxPoolItemPtr
;
44 SV_DECL_PTRARR_DEL( _SwNumFmtsAttrs
, SfxPoolItemPtr
, 5,0 )
46 //------------------------------------------------------------------------
47 class SW_DLLPUBLIC SwNumRulesWithName
50 // die Formate der NumRule muessen! unabhaengig von einem Document sein
51 // (Sie sollen immer vorhanden sein!)
52 class SW_DLLPRIVATE _SwNumFmtGlobal
57 _SwNumFmtsAttrs aItems
;
59 _SwNumFmtGlobal
& operator=( const _SwNumFmtGlobal
& );
62 _SwNumFmtGlobal( const SwNumFmt
& rFmt
);
63 _SwNumFmtGlobal( const _SwNumFmtGlobal
& );
64 _SwNumFmtGlobal( SvStream
&, USHORT nVersion
);
67 void Store( SvStream
& );
68 void ChgNumFmt( SwWrtShell
& rSh
, SwNumFmt
& rChg
) const;
71 _SwNumFmtGlobal
* aFmts
[ MAXLEVEL
];
74 void SetName(const String
& rSet
) {aName
= rSet
;}
77 SwNumRulesWithName(const SwNumRule
&, const String
&);
78 SwNumRulesWithName( const SwNumRulesWithName
& );
79 SwNumRulesWithName(SvStream
&, USHORT nVersion
);
80 ~SwNumRulesWithName();
82 const SwNumRulesWithName
&operator=(const SwNumRulesWithName
&);
84 const String
& GetName() const { return aName
; }
85 void MakeNumRule( SwWrtShell
& rSh
, SwNumRule
& rChg
) const;
87 void Store( SvStream
& );
89 /********************************************************************
91 ********************************************************************/
95 enum { nMaxRules
= MAX_NUM_RULES
}; // zur Zeit 9 definierte Forms
97 SwNumRulesWithName
*pNumRules
[ MAX_NUM_RULES
];
102 virtual int Load(SvStream
&);
103 virtual BOOL
Store(SvStream
&);
108 SwBaseNumRules(const String
& rFileName
);
109 virtual ~SwBaseNumRules();
111 inline const SwNumRulesWithName
* GetRules(USHORT nIdx
) const;
112 virtual void ApplyNumRules(
113 const SwNumRulesWithName
&rCopy
,
118 /********************************************************************
120 ********************************************************************/
121 class SwChapterNumRules
: public SwBaseNumRules
126 virtual ~SwChapterNumRules();
128 virtual void ApplyNumRules( const SwNumRulesWithName
&rCopy
,
132 // INLINE METHODE --------------------------------------------------------
133 inline const SwNumRulesWithName
*SwBaseNumRules::GetRules(USHORT nIdx
) const
135 ASSERT(nIdx
< nMaxRules
, Array der NumRules ueberindiziert
.);
136 return pNumRules
[nIdx
];