xref: /AOO41X/main/sw/inc/fmtftntx.hxx (revision 1d2dbeb0b7301723c6d13094e87a8714ef81a328)
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
10cdf0e10cSrcweir  *
11*1d2dbeb0SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
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.
19cdf0e10cSrcweir  *
20*1d2dbeb0SAndrew Rist  *************************************************************/
21*1d2dbeb0SAndrew Rist 
22*1d2dbeb0SAndrew Rist 
23cdf0e10cSrcweir #ifndef _FMTFTNTX_HXX
24cdf0e10cSrcweir #define _FMTFTNTX_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <svl/eitem.hxx>
27cdf0e10cSrcweir #include <hintids.hxx>
28cdf0e10cSrcweir #include <format.hxx>
29cdf0e10cSrcweir #include <numrule.hxx>
30cdf0e10cSrcweir #include "swdllapi.h"
31cdf0e10cSrcweir 
32cdf0e10cSrcweir enum SwFtnEndPosEnum
33cdf0e10cSrcweir {
34cdf0e10cSrcweir 	FTNEND_ATPGORDOCEND,				// at page or document end
35cdf0e10cSrcweir 	FTNEND_ATTXTEND,					// at end of the current text end
36cdf0e10cSrcweir 	FTNEND_ATTXTEND_OWNNUMSEQ,			// -""- and with own number sequence
37cdf0e10cSrcweir 	FTNEND_ATTXTEND_OWNNUMANDFMT,		// -""- and with onw numberformat
38cdf0e10cSrcweir 	FTNEND_ATTXTEND_END
39cdf0e10cSrcweir };
40cdf0e10cSrcweir 
41cdf0e10cSrcweir 
42cdf0e10cSrcweir class SW_DLLPUBLIC SwFmtFtnEndAtTxtEnd : public SfxEnumItem
43cdf0e10cSrcweir {
44cdf0e10cSrcweir 	String 		sPrefix;
45cdf0e10cSrcweir 	String 		sSuffix;
46cdf0e10cSrcweir 	SvxNumberType aFmt;
47cdf0e10cSrcweir 	sal_uInt16 	  	nOffset;
48cdf0e10cSrcweir 
49cdf0e10cSrcweir protected:
SwFmtFtnEndAtTxtEnd(sal_uInt16 nWhichL,SwFtnEndPosEnum ePos)50cdf0e10cSrcweir     SwFmtFtnEndAtTxtEnd( sal_uInt16 nWhichL, SwFtnEndPosEnum ePos )
51cdf0e10cSrcweir         : SfxEnumItem( nWhichL, sal::static_int_cast< sal_uInt16 >(ePos) ), nOffset( 0 )
52cdf0e10cSrcweir 	{}
SwFmtFtnEndAtTxtEnd(const SwFmtFtnEndAtTxtEnd & rAttr)53cdf0e10cSrcweir 	SwFmtFtnEndAtTxtEnd( const SwFmtFtnEndAtTxtEnd& rAttr )
54cdf0e10cSrcweir 		: SfxEnumItem( rAttr ), sPrefix( rAttr.sPrefix ),
55cdf0e10cSrcweir 		sSuffix( rAttr.sSuffix ), aFmt( rAttr.aFmt ),
56cdf0e10cSrcweir 		nOffset( rAttr.nOffset )
57cdf0e10cSrcweir 	{}
58cdf0e10cSrcweir 
59cdf0e10cSrcweir public:
60cdf0e10cSrcweir 	virtual sal_uInt16 			GetValueCount() const;
61cdf0e10cSrcweir 
62cdf0e10cSrcweir 	virtual int				operator==( const SfxPoolItem& ) const;
63cdf0e10cSrcweir 
64cdf0e10cSrcweir 	virtual	sal_Bool        	 QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
65cdf0e10cSrcweir 	virtual	sal_Bool			 PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
66cdf0e10cSrcweir 
67cdf0e10cSrcweir // will be used at time??
68cdf0e10cSrcweir //	void					FillVariable( SbxVariable &rVar,
69cdf0e10cSrcweir //										  SfxMapUnit eCoreMetric,
70cdf0e10cSrcweir //										  SfxMapUnit eUserMetric ) const;
71cdf0e10cSrcweir //	virtual SfxArgumentError SetVariable( const SbxVariable &rVal,
72cdf0e10cSrcweir //										  SfxMapUnit eCoreMetric,
73cdf0e10cSrcweir //										  SfxMapUnit eUserMetric );
74cdf0e10cSrcweir 	virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
75cdf0e10cSrcweir 									SfxMapUnit eCoreMetric,
76cdf0e10cSrcweir 									SfxMapUnit ePresMetric,
77cdf0e10cSrcweir 									String &rText,
78cdf0e10cSrcweir                                     const IntlWrapper* pIntl = 0 ) const;
79cdf0e10cSrcweir 
IsAtEnd() const80cdf0e10cSrcweir 	inline sal_Bool IsAtEnd() const { return FTNEND_ATPGORDOCEND != GetValue(); }
81cdf0e10cSrcweir 
82cdf0e10cSrcweir 	SwFmtFtnEndAtTxtEnd & operator=( const SwFmtFtnEndAtTxtEnd & rAttr );
83cdf0e10cSrcweir 
GetNumType() const84cdf0e10cSrcweir 	sal_Int16 GetNumType() const 		{ return aFmt.GetNumberingType(); }
SetNumType(sal_Int16 eType)85cdf0e10cSrcweir 	void SetNumType( sal_Int16 eType )	{ aFmt.SetNumberingType(eType); }
86cdf0e10cSrcweir 
GetSwNumType() const87cdf0e10cSrcweir 	const SvxNumberType& GetSwNumType() const 	{ return aFmt; }
88cdf0e10cSrcweir 
GetOffset() const89cdf0e10cSrcweir 	sal_uInt16 GetOffset() const 				{ return nOffset; }
SetOffset(sal_uInt16 nOff)90cdf0e10cSrcweir 	void SetOffset( sal_uInt16 nOff ) 			{ nOffset = nOff; }
91cdf0e10cSrcweir 
GetPrefix() const92cdf0e10cSrcweir 	const String& GetPrefix() const 		{ return sPrefix; }
SetPrefix(const String & rSet)93cdf0e10cSrcweir 	void SetPrefix(const String& rSet)		{ sPrefix = rSet; }
94cdf0e10cSrcweir 
GetSuffix() const95cdf0e10cSrcweir 	const String& GetSuffix() const 		{ return sSuffix; }
SetSuffix(const String & rSet)96cdf0e10cSrcweir 	void SetSuffix(const String& rSet)		{ sSuffix = rSet; }
97cdf0e10cSrcweir };
98cdf0e10cSrcweir 
99cdf0e10cSrcweir class SW_DLLPUBLIC SwFmtFtnAtTxtEnd : public SwFmtFtnEndAtTxtEnd
100cdf0e10cSrcweir {
101cdf0e10cSrcweir public:
SwFmtFtnAtTxtEnd(SwFtnEndPosEnum ePos=FTNEND_ATPGORDOCEND)102cdf0e10cSrcweir 	SwFmtFtnAtTxtEnd( SwFtnEndPosEnum ePos = FTNEND_ATPGORDOCEND )
103cdf0e10cSrcweir 		: SwFmtFtnEndAtTxtEnd( RES_FTN_AT_TXTEND, ePos )
104cdf0e10cSrcweir 	{}
105cdf0e10cSrcweir 
106cdf0e10cSrcweir 	virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
107cdf0e10cSrcweir };
108cdf0e10cSrcweir 
109cdf0e10cSrcweir class SW_DLLPUBLIC SwFmtEndAtTxtEnd : public SwFmtFtnEndAtTxtEnd
110cdf0e10cSrcweir {
111cdf0e10cSrcweir public:
SwFmtEndAtTxtEnd(SwFtnEndPosEnum ePos=FTNEND_ATPGORDOCEND)112cdf0e10cSrcweir 	SwFmtEndAtTxtEnd( SwFtnEndPosEnum ePos = FTNEND_ATPGORDOCEND )
113cdf0e10cSrcweir 		: SwFmtFtnEndAtTxtEnd( RES_END_AT_TXTEND, ePos )
114cdf0e10cSrcweir 	{
115cdf0e10cSrcweir 		SetNumType( SVX_NUM_ROMAN_LOWER );
116cdf0e10cSrcweir 	}
117cdf0e10cSrcweir 
118cdf0e10cSrcweir 	virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
119cdf0e10cSrcweir };
120cdf0e10cSrcweir 
GetFtnAtTxtEnd(sal_Bool bInP) const121cdf0e10cSrcweir inline const SwFmtFtnAtTxtEnd &SwAttrSet::GetFtnAtTxtEnd(sal_Bool bInP) const
122cdf0e10cSrcweir 	{ return (const SwFmtFtnAtTxtEnd&)Get( RES_FTN_AT_TXTEND, bInP); }
GetEndAtTxtEnd(sal_Bool bInP) const123cdf0e10cSrcweir inline const SwFmtEndAtTxtEnd &SwAttrSet::GetEndAtTxtEnd(sal_Bool bInP) const
124cdf0e10cSrcweir 	{ return (const SwFmtEndAtTxtEnd&)Get( RES_END_AT_TXTEND, bInP); }
125cdf0e10cSrcweir 
126cdf0e10cSrcweir 
GetFtnAtTxtEnd(sal_Bool bInP) const127cdf0e10cSrcweir inline const SwFmtFtnAtTxtEnd &SwFmt::GetFtnAtTxtEnd(sal_Bool bInP) const
128cdf0e10cSrcweir 	{ return aSet.GetFtnAtTxtEnd(bInP); }
GetEndAtTxtEnd(sal_Bool bInP) const129cdf0e10cSrcweir inline const SwFmtEndAtTxtEnd &SwFmt::GetEndAtTxtEnd(sal_Bool bInP) const
130cdf0e10cSrcweir 	{ return aSet.GetEndAtTxtEnd(bInP); }
131cdf0e10cSrcweir 
132cdf0e10cSrcweir #endif
133cdf0e10cSrcweir 
134