Update ooo320-m1
[ooovba.git] / binfilter / inc / bf_sw / chpfld.hxx
blob951df8444870dc7d1698bb4255be89972351966c
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: chpfld.hxx,v $
10 * $Revision: 1.8 $
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 _CHPFLD_HXX
31 #define _CHPFLD_HXX
34 class SwFrm;
35 class SwTxtNode;
37 #ifndef _UNOOBJ_HXX
38 #include <unoobj.hxx>
39 #endif
40 namespace binfilter {
42 enum SwChapterFormat
44 CF_BEGIN,
45 CF_NUMBER = CF_BEGIN, // nur die Kapitelnummer
46 CF_TITLE, // nur die "Ueberschrift"
47 CF_NUM_TITLE, // Kapitelnummer und "Ueberschrift"
48 CF_NUMBER_NOPREPST, // nur die Kapitelnummer ohne Post/Prefix
49 CF_NUM_NOPREPST_TITLE, // Kapitelnummer ohne Post/Prefix und "Ueberschrift"
50 CF_END
53 /*--------------------------------------------------------------------
54 Beschreibung: Kapitel
55 --------------------------------------------------------------------*/
57 class SwChapterFieldType : public SwFieldType
59 public:
60 SwChapterFieldType();
62 virtual SwFieldType* Copy() const;
68 /*--------------------------------------------------------------------
69 Beschreibung: Kapitelnummer
70 --------------------------------------------------------------------*/
71 class SwChapterField : public SwField
73 friend class SwChapterFieldType;
74 BYTE nLevel;
75 String sTitle, sNumber, sPre, sPost;
76 public:
77 SwChapterField(SwChapterFieldType*, sal_uInt32 nFmt = 0);
79 void ChangeExpansion( const SwFrm*, const SwTxtNode*, BOOL bSrchNum = FALSE);
81 virtual String Expand() const;
82 virtual SwField* Copy() const;
84 inline BYTE GetLevel() const;
85 inline void SetLevel(BYTE);
87 inline const String& GetNumber() const;
88 inline const String& GetTitle() const;
89 virtual BOOL QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMId ) const;
90 virtual BOOL PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMId );
93 inline BYTE SwChapterField::GetLevel() const { return nLevel; }
94 inline void SwChapterField::SetLevel(BYTE nLev) { nLevel = nLev; }
95 inline const String& SwChapterField::GetNumber() const { return sNumber; }
96 inline const String& SwChapterField::GetTitle() const { return sTitle; }
98 } //namespace binfilter
99 #endif // _CHPFLD_HXX