1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: fmtftntx.hxx,v $
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 ************************************************************************/
33 #include <svtools/eitem.hxx>
34 #include <hintids.hxx>
36 #include <numrule.hxx>
41 FTNEND_ATPGORDOCEND
, // at page or document end
42 FTNEND_ATTXTEND
, // at end of the current text end
43 FTNEND_ATTXTEND_OWNNUMSEQ
, // -""- and with own number sequence
44 FTNEND_ATTXTEND_OWNNUMANDFMT
, // -""- and with onw numberformat
49 class SW_DLLPUBLIC SwFmtFtnEndAtTxtEnd
: public SfxEnumItem
57 SwFmtFtnEndAtTxtEnd( USHORT nWhichL
, SwFtnEndPosEnum ePos
)
58 : SfxEnumItem( nWhichL
, sal::static_int_cast
< USHORT
>(ePos
) ), nOffset( 0 )
60 SwFmtFtnEndAtTxtEnd( const SwFmtFtnEndAtTxtEnd
& rAttr
)
61 : SfxEnumItem( rAttr
), sPrefix( rAttr
.sPrefix
),
62 sSuffix( rAttr
.sSuffix
), aFmt( rAttr
.aFmt
),
63 nOffset( rAttr
.nOffset
)
67 virtual USHORT
GetValueCount() const;
69 virtual int operator==( const SfxPoolItem
& ) const;
71 virtual BOOL
QueryValue( com::sun::star::uno::Any
& rVal
, BYTE nMemberId
= 0 ) const;
72 virtual BOOL
PutValue( const com::sun::star::uno::Any
& rVal
, BYTE nMemberId
= 0 );
74 // will be used at time??
75 // void FillVariable( SbxVariable &rVar,
76 // SfxMapUnit eCoreMetric,
77 // SfxMapUnit eUserMetric ) const;
78 // virtual SfxArgumentError SetVariable( const SbxVariable &rVal,
79 // SfxMapUnit eCoreMetric,
80 // SfxMapUnit eUserMetric );
81 virtual SfxItemPresentation
GetPresentation( SfxItemPresentation ePres
,
82 SfxMapUnit eCoreMetric
,
83 SfxMapUnit ePresMetric
,
85 const IntlWrapper
* pIntl
= 0 ) const;
87 inline BOOL
IsAtEnd() const { return FTNEND_ATPGORDOCEND
!= GetValue(); }
89 SwFmtFtnEndAtTxtEnd
& operator=( const SwFmtFtnEndAtTxtEnd
& rAttr
);
91 sal_Int16
GetNumType() const { return aFmt
.GetNumberingType(); }
92 void SetNumType( sal_Int16 eType
) { aFmt
.SetNumberingType(eType
); }
94 const SvxNumberType
& GetSwNumType() const { return aFmt
; }
96 USHORT
GetOffset() const { return nOffset
; }
97 void SetOffset( USHORT nOff
) { nOffset
= nOff
; }
99 const String
& GetPrefix() const { return sPrefix
; }
100 void SetPrefix(const String
& rSet
) { sPrefix
= rSet
; }
102 const String
& GetSuffix() const { return sSuffix
; }
103 void SetSuffix(const String
& rSet
) { sSuffix
= rSet
; }
106 class SW_DLLPUBLIC SwFmtFtnAtTxtEnd
: public SwFmtFtnEndAtTxtEnd
109 SwFmtFtnAtTxtEnd( SwFtnEndPosEnum ePos
= FTNEND_ATPGORDOCEND
)
110 : SwFmtFtnEndAtTxtEnd( RES_FTN_AT_TXTEND
, ePos
)
113 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const;
116 class SW_DLLPUBLIC SwFmtEndAtTxtEnd
: public SwFmtFtnEndAtTxtEnd
119 SwFmtEndAtTxtEnd( SwFtnEndPosEnum ePos
= FTNEND_ATPGORDOCEND
)
120 : SwFmtFtnEndAtTxtEnd( RES_END_AT_TXTEND
, ePos
)
122 SetNumType( SVX_NUM_ROMAN_LOWER
);
125 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const;
128 inline const SwFmtFtnAtTxtEnd
&SwAttrSet::GetFtnAtTxtEnd(BOOL bInP
) const
129 { return (const SwFmtFtnAtTxtEnd
&)Get( RES_FTN_AT_TXTEND
, bInP
); }
130 inline const SwFmtEndAtTxtEnd
&SwAttrSet::GetEndAtTxtEnd(BOOL bInP
) const
131 { return (const SwFmtEndAtTxtEnd
&)Get( RES_END_AT_TXTEND
, bInP
); }
134 inline const SwFmtFtnAtTxtEnd
&SwFmt::GetFtnAtTxtEnd(BOOL bInP
) const
135 { return aSet
.GetFtnAtTxtEnd(bInP
); }
136 inline const SwFmtEndAtTxtEnd
&SwFmt::GetEndAtTxtEnd(BOOL bInP
) const
137 { return aSet
.GetEndAtTxtEnd(bInP
); }