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 #ifndef _SFXENUMITEM_HXX //autogen
34 #include <bf_svtools/eitem.hxx>
37 #include <hintids.hxx>
39 #ifndef _FORMAT_HXX //autogen
43 #include <numrule.hxx>
50 FTNEND_ATPGORDOCEND
, // at page or document end
51 FTNEND_ATTXTEND
, // at end of the current text end
52 FTNEND_ATTXTEND_OWNNUMSEQ
, // -""- and with own number sequence
53 FTNEND_ATTXTEND_OWNNUMANDFMT
, // -""- and with onw numberformat
58 class SwFmtFtnEndAtTxtEnd
: public SfxEnumItem
66 SwFmtFtnEndAtTxtEnd( USHORT nWhich
, SwFtnEndPosEnum ePos
)
67 : SfxEnumItem( nWhich
, ePos
), nOffset( 0 )
69 SwFmtFtnEndAtTxtEnd( const SwFmtFtnEndAtTxtEnd
& rAttr
)
70 : SfxEnumItem( rAttr
), nOffset( rAttr
.nOffset
), aFmt( rAttr
.aFmt
),
71 sPrefix( rAttr
.sPrefix
), sSuffix( rAttr
.sSuffix
)
75 virtual USHORT
GetValueCount() const{DBG_BF_ASSERT(0, "STRIP"); return 0;} //STRIP001 virtual USHORT GetValueCount() const;
76 virtual SfxPoolItem
* Create(SvStream
&, USHORT nVer
) const;
77 virtual SvStream
& Store(SvStream
&, USHORT nIVer
) const;
78 virtual USHORT
GetVersion( USHORT nFFVer
) const;
80 virtual int operator==( const SfxPoolItem
& ) const;
82 virtual BOOL
QueryValue( ::com::sun::star::uno::Any
& rVal
, BYTE nMemberId
= 0 ) const;
83 virtual BOOL
PutValue( const ::com::sun::star::uno::Any
& rVal
, BYTE nMemberId
= 0 );
85 // will be used at time??
86 // void FillVariable( SbxVariable &rVar,
87 // SfxMapUnit eCoreMetric,
88 // SfxMapUnit eUserMetric ) const;
89 // virtual SfxArgumentError SetVariable( const SbxVariable &rVal,
90 // SfxMapUnit eCoreMetric,
91 // SfxMapUnit eUserMetric );
93 inline BOOL
IsAtEnd() const { return FTNEND_ATPGORDOCEND
!= GetValue(); }
95 SwFmtFtnEndAtTxtEnd
& operator=( const SwFmtFtnEndAtTxtEnd
& rAttr
);
97 sal_Int16
GetNumType() const { return aFmt
.GetNumberingType(); }
98 void SetNumType( sal_Int16 eType
) { aFmt
.SetNumberingType(eType
); }
100 const SvxNumberType
& GetSwNumType() const { return aFmt
; }
102 USHORT
GetOffset() const { return nOffset
; }
103 void SetOffset( USHORT nOff
) { nOffset
= nOff
; }
105 const String
& GetPrefix() const { return sPrefix
; }
106 void SetPrefix(const String
& rSet
) { sPrefix
= rSet
; }
108 const String
& GetSuffix() const { return sSuffix
; }
109 void SetSuffix(const String
& rSet
) { sSuffix
= rSet
; }
112 class SwFmtFtnAtTxtEnd
: public SwFmtFtnEndAtTxtEnd
115 SwFmtFtnAtTxtEnd( SwFtnEndPosEnum ePos
= FTNEND_ATPGORDOCEND
)
116 : SwFmtFtnEndAtTxtEnd( RES_FTN_AT_TXTEND
, ePos
)
119 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const;
122 class SwFmtEndAtTxtEnd
: public SwFmtFtnEndAtTxtEnd
125 SwFmtEndAtTxtEnd( SwFtnEndPosEnum ePos
= FTNEND_ATPGORDOCEND
)
126 : SwFmtFtnEndAtTxtEnd( RES_END_AT_TXTEND
, ePos
)
128 SetNumType( SVX_NUM_ROMAN_LOWER
);
131 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const;
134 #if !(defined(MACOSX) && ( __GNUC__ < 3 ))
135 // GrP moved to gcc_outl.cxx; revisit with gcc3
136 inline const SwFmtFtnAtTxtEnd
&SwAttrSet::GetFtnAtTxtEnd(BOOL bInP
) const
137 { return (const SwFmtFtnAtTxtEnd
&)Get( RES_FTN_AT_TXTEND
, bInP
); }
138 inline const SwFmtEndAtTxtEnd
&SwAttrSet::GetEndAtTxtEnd(BOOL bInP
) const
139 { return (const SwFmtEndAtTxtEnd
&)Get( RES_END_AT_TXTEND
, bInP
); }
142 inline const SwFmtFtnAtTxtEnd
&SwFmt::GetFtnAtTxtEnd(BOOL bInP
) const
143 { return aSet
.GetFtnAtTxtEnd(bInP
); }
144 inline const SwFmtEndAtTxtEnd
&SwFmt::GetEndAtTxtEnd(BOOL bInP
) const
145 { return aSet
.GetEndAtTxtEnd(bInP
); }
148 } //namespace binfilter