1*1d2dbeb0SAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
3*1d2dbeb0SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*1d2dbeb0SAndrew Rist * or more contributor license agreements. See the NOTICE file
5*1d2dbeb0SAndrew Rist * distributed with this work for additional information
6*1d2dbeb0SAndrew Rist * regarding copyright ownership. The ASF licenses this file
7*1d2dbeb0SAndrew Rist * to you under the Apache License, Version 2.0 (the
8*1d2dbeb0SAndrew Rist * "License"); you may not use this file except in compliance
9*1d2dbeb0SAndrew Rist * with the License. You may obtain a copy of the License at
10*1d2dbeb0SAndrew Rist *
11*1d2dbeb0SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12*1d2dbeb0SAndrew Rist *
13*1d2dbeb0SAndrew Rist * Unless required by applicable law or agreed to in writing,
14*1d2dbeb0SAndrew Rist * software distributed under the License is distributed on an
15*1d2dbeb0SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*1d2dbeb0SAndrew Rist * KIND, either express or implied. See the License for the
17*1d2dbeb0SAndrew Rist * specific language governing permissions and limitations
18*1d2dbeb0SAndrew Rist * under the License.
19*1d2dbeb0SAndrew Rist *
20*1d2dbeb0SAndrew Rist *************************************************************/
21*1d2dbeb0SAndrew Rist
22*1d2dbeb0SAndrew Rist
23cdf0e10cSrcweir #ifndef SW_CHPFLD_HXX
24cdf0e10cSrcweir #define SW_CHPFLD_HXX
25cdf0e10cSrcweir
26cdf0e10cSrcweir #include "fldbas.hxx"
27cdf0e10cSrcweir
28cdf0e10cSrcweir
29cdf0e10cSrcweir class SwFrm;
30cdf0e10cSrcweir class SwCntntNode;
31cdf0e10cSrcweir class SwTxtNode;
32cdf0e10cSrcweir
33cdf0e10cSrcweir
34cdf0e10cSrcweir enum SwChapterFormat
35cdf0e10cSrcweir {
36cdf0e10cSrcweir CF_BEGIN,
37cdf0e10cSrcweir CF_NUMBER = CF_BEGIN, // nur die Kapitelnummer
38cdf0e10cSrcweir CF_TITLE, // nur die "Ueberschrift"
39cdf0e10cSrcweir CF_NUM_TITLE, // Kapitelnummer und "Ueberschrift"
40cdf0e10cSrcweir CF_NUMBER_NOPREPST, // nur die Kapitelnummer ohne Post/Prefix
41cdf0e10cSrcweir CF_NUM_NOPREPST_TITLE, // Kapitelnummer ohne Post/Prefix und "Ueberschrift"
42cdf0e10cSrcweir CF_END
43cdf0e10cSrcweir };
44cdf0e10cSrcweir
45cdf0e10cSrcweir /*--------------------------------------------------------------------
46cdf0e10cSrcweir Beschreibung: Kapitel
47cdf0e10cSrcweir --------------------------------------------------------------------*/
48cdf0e10cSrcweir
49cdf0e10cSrcweir class SwChapterFieldType : public SwFieldType
50cdf0e10cSrcweir {
51cdf0e10cSrcweir public:
52cdf0e10cSrcweir SwChapterFieldType();
53cdf0e10cSrcweir
54cdf0e10cSrcweir virtual SwFieldType* Copy() const;
55cdf0e10cSrcweir
56cdf0e10cSrcweir };
57cdf0e10cSrcweir
58cdf0e10cSrcweir
59cdf0e10cSrcweir
60cdf0e10cSrcweir /*--------------------------------------------------------------------
61cdf0e10cSrcweir Beschreibung: Kapitelnummer
62cdf0e10cSrcweir --------------------------------------------------------------------*/
63cdf0e10cSrcweir class SW_DLLPUBLIC SwChapterField : public SwField
64cdf0e10cSrcweir {
65cdf0e10cSrcweir friend class SwChapterFieldType;
66cdf0e10cSrcweir sal_uInt8 nLevel;
67cdf0e10cSrcweir String sTitle, sNumber, sPre, sPost;
68cdf0e10cSrcweir
69cdf0e10cSrcweir virtual String Expand() const;
70cdf0e10cSrcweir virtual SwField* Copy() const;
71cdf0e10cSrcweir
72cdf0e10cSrcweir public:
73cdf0e10cSrcweir SwChapterField(SwChapterFieldType*, sal_uInt32 nFmt = 0);
74cdf0e10cSrcweir
75cdf0e10cSrcweir // --> OD 2008-02-14 #i53420#
76cdf0e10cSrcweir // void ChangeExpansion( const SwFrm*,
77cdf0e10cSrcweir // const SwTxtNode*,
78cdf0e10cSrcweir // sal_Bool bSrchNum = sal_False);
79cdf0e10cSrcweir void ChangeExpansion( const SwFrm*,
80cdf0e10cSrcweir const SwCntntNode*,
81cdf0e10cSrcweir sal_Bool bSrchNum = sal_False);
82cdf0e10cSrcweir // <--
83cdf0e10cSrcweir void ChangeExpansion(const SwTxtNode &rNd, sal_Bool bSrchNum);
84cdf0e10cSrcweir
85cdf0e10cSrcweir inline sal_uInt8 GetLevel() const;
86cdf0e10cSrcweir inline void SetLevel(sal_uInt8);
87cdf0e10cSrcweir
88cdf0e10cSrcweir inline const String& GetNumber() const;
89cdf0e10cSrcweir inline const String& GetTitle() const;
90cdf0e10cSrcweir virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const;
91cdf0e10cSrcweir virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich );
92cdf0e10cSrcweir };
93cdf0e10cSrcweir
GetLevel() const94cdf0e10cSrcweir inline sal_uInt8 SwChapterField::GetLevel() const { return nLevel; }
SetLevel(sal_uInt8 nLev)95cdf0e10cSrcweir inline void SwChapterField::SetLevel(sal_uInt8 nLev) { nLevel = nLev; }
GetNumber() const96cdf0e10cSrcweir inline const String& SwChapterField::GetNumber() const { return sNumber; }
GetTitle() const97cdf0e10cSrcweir inline const String& SwChapterField::GetTitle() const { return sTitle; }
98cdf0e10cSrcweir
99cdf0e10cSrcweir #endif // SW_CHPFLD_HXX
100