bump product version to 4.1.6.2
[LibreOffice.git] / sw / inc / chpfld.hxx
blob25935787440bcb34ed30883fd9b3b0f227a16a3b
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 SW_CHPFLD_HXX
20 #define SW_CHPFLD_HXX
22 #include "fldbas.hxx"
25 class SwFrm;
26 class SwCntntNode;
27 class SwTxtNode;
30 enum SwChapterFormat
32 CF_BEGIN,
33 CF_NUMBER = CF_BEGIN, ///< only the chapter number
34 CF_TITLE, ///< only the title
35 CF_NUM_TITLE, ///< number and title
36 CF_NUMBER_NOPREPST, ///< only chapter number without post-/prefix
37 CF_NUM_NOPREPST_TITLE, ///< chapter number without post-/prefix and title
38 CF_END
41 class SwChapterFieldType : public SwFieldType
43 public:
44 SwChapterFieldType();
46 virtual SwFieldType* Copy() const;
50 class SW_DLLPUBLIC SwChapterField : public SwField
52 friend class SwChapterFieldType;
53 sal_uInt8 nLevel;
54 String sTitle, sNumber, sPre, sPost;
56 virtual String Expand() const;
57 virtual SwField* Copy() const;
59 public:
60 SwChapterField(SwChapterFieldType*, sal_uInt32 nFmt = 0);
62 // #i53420#
63 void ChangeExpansion( const SwFrm*,
64 const SwCntntNode*,
65 sal_Bool bSrchNum = sal_False);
66 void ChangeExpansion(const SwTxtNode &rNd, sal_Bool bSrchNum);
68 inline sal_uInt8 GetLevel() const;
69 inline void SetLevel(sal_uInt8);
71 inline const String& GetNumber() const;
72 inline const String& GetTitle() const;
73 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const;
74 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich );
77 inline sal_uInt8 SwChapterField::GetLevel() const { return nLevel; }
78 inline void SwChapterField::SetLevel(sal_uInt8 nLev) { nLevel = nLev; }
79 inline const String& SwChapterField::GetNumber() const { return sNumber; }
80 inline const String& SwChapterField::GetTitle() const { return sTitle; }
82 #endif // SW_CHPFLD_HXX
84 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */