1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
22 #include <numrule.hxx>
24 #include <boost/ptr_container/ptr_vector.hpp>
30 #define MAX_NUM_RULES 9
32 typedef boost::ptr_vector
<SfxPoolItem
> _SwNumFmtsAttrs
;
34 class SW_DLLPUBLIC SwNumRulesWithName
37 // the NumRule's formats _have_ to be independent of a document
38 // (They should always be there!)
39 class SW_DLLPRIVATE _SwNumFmtGlobal
43 sal_uInt16 nCharPoolId
;
44 _SwNumFmtsAttrs aItems
;
46 _SwNumFmtGlobal
& operator=( const _SwNumFmtGlobal
& );
49 _SwNumFmtGlobal( const SwNumFmt
& rFmt
);
50 _SwNumFmtGlobal( const _SwNumFmtGlobal
& );
51 _SwNumFmtGlobal( SvStream
&, sal_uInt16 nVersion
);
54 void Store( SvStream
& );
55 void ChgNumFmt( SwWrtShell
& rSh
, SwNumFmt
& rChg
) const;
58 _SwNumFmtGlobal
* aFmts
[ MAXLEVEL
];
61 void SetName(const String
& rSet
) {maName
= rSet
;}
64 SwNumRulesWithName(const SwNumRule
&, const String
&);
65 SwNumRulesWithName( const SwNumRulesWithName
& );
66 SwNumRulesWithName(SvStream
&, sal_uInt16 nVersion
);
67 ~SwNumRulesWithName();
69 const SwNumRulesWithName
&operator=(const SwNumRulesWithName
&);
71 const String
& GetName() const { return maName
; }
72 void MakeNumRule( SwWrtShell
& rSh
, SwNumRule
& rChg
) const;
74 void Store( SvStream
& );
80 enum { nMaxRules
= MAX_NUM_RULES
}; // currently 9 defined forms
82 SwNumRulesWithName
*pNumRules
[ MAX_NUM_RULES
];
87 virtual int Load(SvStream
&);
88 virtual sal_Bool
Store(SvStream
&);
93 SwBaseNumRules(const String
& rFileName
);
94 virtual ~SwBaseNumRules();
96 inline const SwNumRulesWithName
* GetRules(sal_uInt16 nIdx
) const;
97 virtual void ApplyNumRules(
98 const SwNumRulesWithName
&rCopy
,
103 class SwChapterNumRules
: public SwBaseNumRules
108 virtual ~SwChapterNumRules();
110 virtual void ApplyNumRules( const SwNumRulesWithName
&rCopy
,
114 // INLINE METHODE --------------------------------------------------------
115 inline const SwNumRulesWithName
*SwBaseNumRules::GetRules(sal_uInt16 nIdx
) const
117 OSL_ENSURE(nIdx
< nMaxRules
, "Array der NumRules ueberindiziert.");
118 return pNumRules
[nIdx
];
123 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */