bump product version to 4.1.6.2
[LibreOffice.git] / sw / inc / fmtftntx.hxx
blob11258afeeee496db5e37584cc1ea4fb38b1b2e38
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 _FMTFTNTX_HXX
20 #define _FMTFTNTX_HXX
22 #include <svl/eitem.hxx>
23 #include <hintids.hxx>
24 #include <format.hxx>
25 #include <numrule.hxx>
26 #include "swdllapi.h"
28 enum SwFtnEndPosEnum
30 FTNEND_ATPGORDOCEND, ///< at page or document end
31 FTNEND_ATTXTEND, ///< at end of the current text end
32 FTNEND_ATTXTEND_OWNNUMSEQ, ///< -""- and with own number sequence
33 FTNEND_ATTXTEND_OWNNUMANDFMT, ///< -""- and with own numberformat
34 FTNEND_ATTXTEND_END
38 class SW_DLLPUBLIC SwFmtFtnEndAtTxtEnd : public SfxEnumItem
40 OUString sPrefix;
41 OUString sSuffix;
42 SvxNumberType aFmt;
43 sal_uInt16 nOffset;
45 protected:
46 SwFmtFtnEndAtTxtEnd( sal_uInt16 nWhichL, SwFtnEndPosEnum ePos )
47 : SfxEnumItem( nWhichL, sal::static_int_cast< sal_uInt16 >(ePos) ), nOffset( 0 )
49 SwFmtFtnEndAtTxtEnd( const SwFmtFtnEndAtTxtEnd& rAttr )
50 : SfxEnumItem( rAttr ), sPrefix( rAttr.sPrefix ),
51 sSuffix( rAttr.sSuffix ), aFmt( rAttr.aFmt ),
52 nOffset( rAttr.nOffset )
55 public:
56 virtual sal_uInt16 GetValueCount() const;
58 virtual int operator==( const SfxPoolItem& ) const;
60 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
61 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
63 virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
64 SfxMapUnit eCoreMetric,
65 SfxMapUnit ePresMetric,
66 OUString &rText,
67 const IntlWrapper* pIntl = 0 ) const;
69 inline sal_Bool IsAtEnd() const { return FTNEND_ATPGORDOCEND != GetValue(); }
71 SwFmtFtnEndAtTxtEnd & operator=( const SwFmtFtnEndAtTxtEnd & rAttr );
73 sal_Int16 GetNumType() const { return aFmt.GetNumberingType(); }
74 void SetNumType( sal_Int16 eType ) { aFmt.SetNumberingType(eType); }
76 const SvxNumberType& GetSwNumType() const { return aFmt; }
78 sal_uInt16 GetOffset() const { return nOffset; }
79 void SetOffset( sal_uInt16 nOff ) { nOffset = nOff; }
81 const OUString& GetPrefix() const { return sPrefix; }
82 void SetPrefix(const OUString& rSet) { sPrefix = rSet; }
84 const OUString& GetSuffix() const { return sSuffix; }
85 void SetSuffix(const OUString& rSet) { sSuffix = rSet; }
88 class SW_DLLPUBLIC SwFmtFtnAtTxtEnd : public SwFmtFtnEndAtTxtEnd
90 public:
91 SwFmtFtnAtTxtEnd( SwFtnEndPosEnum ePos = FTNEND_ATPGORDOCEND )
92 : SwFmtFtnEndAtTxtEnd( RES_FTN_AT_TXTEND, ePos )
95 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
98 class SW_DLLPUBLIC SwFmtEndAtTxtEnd : public SwFmtFtnEndAtTxtEnd
100 public:
101 SwFmtEndAtTxtEnd( SwFtnEndPosEnum ePos = FTNEND_ATPGORDOCEND )
102 : SwFmtFtnEndAtTxtEnd( RES_END_AT_TXTEND, ePos )
104 SetNumType( SVX_NUM_ROMAN_LOWER );
107 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
110 inline const SwFmtFtnAtTxtEnd &SwAttrSet::GetFtnAtTxtEnd(sal_Bool bInP) const
111 { return (const SwFmtFtnAtTxtEnd&)Get( RES_FTN_AT_TXTEND, bInP); }
112 inline const SwFmtEndAtTxtEnd &SwAttrSet::GetEndAtTxtEnd(sal_Bool bInP) const
113 { return (const SwFmtEndAtTxtEnd&)Get( RES_END_AT_TXTEND, bInP); }
116 inline const SwFmtFtnAtTxtEnd &SwFmt::GetFtnAtTxtEnd(sal_Bool bInP) const
117 { return aSet.GetFtnAtTxtEnd(bInP); }
118 inline const SwFmtEndAtTxtEnd &SwFmt::GetEndAtTxtEnd(sal_Bool bInP) const
119 { return aSet.GetEndAtTxtEnd(bInP); }
121 #endif
123 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */