bump product version to 4.1.6.2
[LibreOffice.git] / sw / source / ui / inc / uinums.hxx
blob44502b4d9dd2521ae4c76f71f4e906bd32dbdf2d
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
19 #ifndef _UINUMS_HXX
20 #define _UINUMS_HXX
22 #include <numrule.hxx>
23 #include "swdllapi.h"
24 #include <boost/ptr_container/ptr_vector.hpp>
26 class SfxPoolItem;
27 class SwWrtShell;
28 class SvStream;
30 #define MAX_NUM_RULES 9
32 typedef boost::ptr_vector<SfxPoolItem> _SwNumFmtsAttrs;
34 class SW_DLLPUBLIC SwNumRulesWithName
36 String maName;
37 // the NumRule's formats _have_ to be independent of a document
38 // (They should always be there!)
39 class SW_DLLPRIVATE _SwNumFmtGlobal
41 SwNumFmt aFmt;
42 String sCharFmtName;
43 sal_uInt16 nCharPoolId;
44 _SwNumFmtsAttrs aItems;
46 _SwNumFmtGlobal& operator=( const _SwNumFmtGlobal& );
48 public:
49 _SwNumFmtGlobal( const SwNumFmt& rFmt );
50 _SwNumFmtGlobal( const _SwNumFmtGlobal& );
51 _SwNumFmtGlobal( SvStream&, sal_uInt16 nVersion );
52 ~_SwNumFmtGlobal();
54 void Store( SvStream& );
55 void ChgNumFmt( SwWrtShell& rSh, SwNumFmt& rChg ) const;
58 _SwNumFmtGlobal* aFmts[ MAXLEVEL ];
60 protected:
61 void SetName(const String& rSet) {maName = rSet;}
63 public:
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& );
77 class SwBaseNumRules
79 public:
80 enum { nMaxRules = MAX_NUM_RULES }; // currently 9 defined forms
81 protected:
82 SwNumRulesWithName *pNumRules[ MAX_NUM_RULES ];
83 String sFileName;
84 sal_uInt16 nVersion;
85 sal_Bool bModified;
87 virtual int Load(SvStream&);
88 virtual sal_Bool Store(SvStream&);
90 void Init();
92 public:
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,
99 sal_uInt16 nIdx);
103 class SwChapterNumRules : public SwBaseNumRules
106 public:
107 SwChapterNumRules();
108 virtual ~SwChapterNumRules();
110 virtual void ApplyNumRules( const SwNumRulesWithName &rCopy,
111 sal_uInt16 nIdx);
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];
121 #endif
123 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */