update dev300-m58
[ooovba.git] / sw / source / ui / inc / uinums.hxx
blobf3faf4b3027672d5fe36b2196acf1748a046f6b0
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: uinums.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 _UINUMS_HXX
31 #define _UINUMS_HXX
33 #include <svtools/svarray.hxx>
34 #include <numrule.hxx>
35 #include "swdllapi.h"
37 class SfxPoolItem;
38 class SwWrtShell;
39 class SvStream;
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
49 String aName;
50 // die Formate der NumRule muessen! unabhaengig von einem Document sein
51 // (Sie sollen immer vorhanden sein!)
52 class SW_DLLPRIVATE _SwNumFmtGlobal
54 SwNumFmt aFmt;
55 String sCharFmtName;
56 USHORT nCharPoolId;
57 _SwNumFmtsAttrs aItems;
59 _SwNumFmtGlobal& operator=( const _SwNumFmtGlobal& );
61 public:
62 _SwNumFmtGlobal( const SwNumFmt& rFmt );
63 _SwNumFmtGlobal( const _SwNumFmtGlobal& );
64 _SwNumFmtGlobal( SvStream&, USHORT nVersion );
65 ~_SwNumFmtGlobal();
67 void Store( SvStream& );
68 void ChgNumFmt( SwWrtShell& rSh, SwNumFmt& rChg ) const;
71 _SwNumFmtGlobal* aFmts[ MAXLEVEL ];
73 protected:
74 void SetName(const String& rSet) {aName = rSet;}
76 public:
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 ********************************************************************/
92 class SwBaseNumRules
94 public:
95 enum { nMaxRules = MAX_NUM_RULES }; // zur Zeit 9 definierte Forms
96 protected:
97 SwNumRulesWithName *pNumRules[ MAX_NUM_RULES ];
98 String sFileName;
99 USHORT nVersion;
100 BOOL bModified;
102 virtual int Load(SvStream&);
103 virtual BOOL Store(SvStream&);
105 void Init();
107 public:
108 SwBaseNumRules(const String& rFileName);
109 virtual ~SwBaseNumRules();
111 inline const SwNumRulesWithName* GetRules(USHORT nIdx) const;
112 virtual void ApplyNumRules(
113 const SwNumRulesWithName &rCopy,
114 USHORT nIdx);
118 /********************************************************************
120 ********************************************************************/
121 class SwChapterNumRules : public SwBaseNumRules
124 public:
125 SwChapterNumRules();
126 virtual ~SwChapterNumRules();
128 virtual void ApplyNumRules( const SwNumRulesWithName &rCopy,
129 USHORT nIdx);
132 // INLINE METHODE --------------------------------------------------------
133 inline const SwNumRulesWithName *SwBaseNumRules::GetRules(USHORT nIdx) const
135 ASSERT(nIdx < nMaxRules, Array der NumRules ueberindiziert.);
136 return pNumRules[nIdx];
139 #endif