xref: /aoo41x/main/sw/inc/fmtornt.hxx (revision 1d2dbeb0)
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
10*1d2dbeb0SAndrew Rist  *
11*1d2dbeb0SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*1d2dbeb0SAndrew Rist  *
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.
19*1d2dbeb0SAndrew Rist  *
20*1d2dbeb0SAndrew Rist  *************************************************************/
21*1d2dbeb0SAndrew Rist 
22*1d2dbeb0SAndrew Rist 
23cdf0e10cSrcweir #ifndef _FMTORNT_HXX
24cdf0e10cSrcweir #define _FMTORNT_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <com/sun/star/text/HoriOrientation.hpp>
27cdf0e10cSrcweir #include <com/sun/star/text/VertOrientation.hpp>
28cdf0e10cSrcweir #include <com/sun/star/text/RelOrientation.hpp>
29cdf0e10cSrcweir #include "swdllapi.h"
30cdf0e10cSrcweir #include <hintids.hxx>
31cdf0e10cSrcweir #include <swtypes.hxx>
32cdf0e10cSrcweir #include <format.hxx>
33cdf0e10cSrcweir #include <svl/poolitem.hxx>
34cdf0e10cSrcweir 
35cdf0e10cSrcweir 
36cdf0e10cSrcweir class IntlWrapper;
37cdf0e10cSrcweir 
38cdf0e10cSrcweir #define IVER_VERTORIENT_REL ((sal_uInt16)0x0001)
39cdf0e10cSrcweir 
40cdf0e10cSrcweir class SW_DLLPUBLIC SwFmtVertOrient: public SfxPoolItem
41cdf0e10cSrcweir {
42cdf0e10cSrcweir     SwTwips         nYPos;  //Enthaelt _immer_ die aktuelle RelPos.
43cdf0e10cSrcweir     sal_Int16       eOrient;
44cdf0e10cSrcweir     sal_Int16       eRelation;
45cdf0e10cSrcweir public:
46cdf0e10cSrcweir 	TYPEINFO();
47cdf0e10cSrcweir     SwFmtVertOrient( SwTwips nY = 0, sal_Int16 eVert = com::sun::star::text::VertOrientation::NONE,
48cdf0e10cSrcweir                      sal_Int16 eRel = com::sun::star::text::RelOrientation::PRINT_AREA );
49cdf0e10cSrcweir 	inline SwFmtVertOrient &operator=( const SwFmtVertOrient &rCpy );
50cdf0e10cSrcweir 
51cdf0e10cSrcweir 	// "pure virtual Methoden" vom SfxPoolItem
52cdf0e10cSrcweir 	virtual int             operator==( const SfxPoolItem& ) const;
53cdf0e10cSrcweir 	virtual SfxPoolItem*	Clone( SfxItemPool* pPool = 0 ) const;
54cdf0e10cSrcweir 	virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
55cdf0e10cSrcweir 									SfxMapUnit eCoreMetric,
56cdf0e10cSrcweir 									SfxMapUnit ePresMetric,
57cdf0e10cSrcweir 									String &rText,
58cdf0e10cSrcweir                                     const IntlWrapper*    pIntl = 0 ) const;
59cdf0e10cSrcweir 	virtual	sal_Bool        	 QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
60cdf0e10cSrcweir 	virtual	sal_Bool			 PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
61cdf0e10cSrcweir 
GetVertOrient() const62cdf0e10cSrcweir     sal_Int16 GetVertOrient() const { return eOrient; }
GetRelationOrient() const63cdf0e10cSrcweir     sal_Int16 GetRelationOrient() const { return eRelation; }
SetVertOrient(sal_Int16 eNew)64cdf0e10cSrcweir     void   SetVertOrient( sal_Int16 eNew ) { eOrient = eNew; }
SetRelationOrient(sal_Int16 eNew)65cdf0e10cSrcweir     void   SetRelationOrient( sal_Int16 eNew ) { eRelation = eNew; }
66cdf0e10cSrcweir 
GetPos() const67cdf0e10cSrcweir 	SwTwips GetPos() const { return nYPos; }
SetPos(SwTwips nNew)68cdf0e10cSrcweir 	void    SetPos( SwTwips nNew ) { nYPos = nNew; }
69cdf0e10cSrcweir };
70cdf0e10cSrcweir 
71cdf0e10cSrcweir //SwFmtHoriOrient, wie und woran orientiert --
72cdf0e10cSrcweir //	sich der FlyFrm in der Hoizontalen ----------
73cdf0e10cSrcweir 
74cdf0e10cSrcweir #define IVER_HORIORIENT_TOGGLE ((sal_uInt16)0x0001)
75cdf0e10cSrcweir #define IVER_HORIORIENT_REL ((sal_uInt16)0x0002)
76cdf0e10cSrcweir 
77cdf0e10cSrcweir class SW_DLLPUBLIC SwFmtHoriOrient: public SfxPoolItem
78cdf0e10cSrcweir {
79cdf0e10cSrcweir     SwTwips         nXPos;  //Enthaelt _immer_ die aktuelle RelPos.
80cdf0e10cSrcweir     sal_Int16       eOrient;
81cdf0e10cSrcweir     sal_Int16       eRelation;
82cdf0e10cSrcweir     sal_Bool            bPosToggle : 1; // auf geraden Seiten Position spiegeln
83cdf0e10cSrcweir public:
84cdf0e10cSrcweir 	TYPEINFO();
85cdf0e10cSrcweir     SwFmtHoriOrient( SwTwips nX = 0, sal_Int16 eHori = com::sun::star::text::HoriOrientation::NONE,
86cdf0e10cSrcweir         sal_Int16 eRel = com::sun::star::text::RelOrientation::PRINT_AREA, sal_Bool bPos = sal_False );
87cdf0e10cSrcweir 	inline SwFmtHoriOrient &operator=( const SwFmtHoriOrient &rCpy );
88cdf0e10cSrcweir 
89cdf0e10cSrcweir 	// "pure virtual Methoden" vom SfxPoolItem
90cdf0e10cSrcweir 	virtual int             operator==( const SfxPoolItem& ) const;
91cdf0e10cSrcweir 	virtual SfxPoolItem*	Clone( SfxItemPool* pPool = 0 ) const;
92cdf0e10cSrcweir 	virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
93cdf0e10cSrcweir 									SfxMapUnit eCoreMetric,
94cdf0e10cSrcweir 									SfxMapUnit ePresMetric,
95cdf0e10cSrcweir 									String &rText,
96cdf0e10cSrcweir                                     const IntlWrapper*    pIntl = 0 ) const;
97cdf0e10cSrcweir 	virtual	sal_Bool        	 QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
98cdf0e10cSrcweir 	virtual	sal_Bool			 PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
99cdf0e10cSrcweir 
GetHoriOrient() const100cdf0e10cSrcweir     sal_Int16 GetHoriOrient() const { return eOrient; }
GetRelationOrient() const101cdf0e10cSrcweir     sal_Int16 GetRelationOrient() const { return eRelation; }
SetHoriOrient(sal_Int16 eNew)102cdf0e10cSrcweir     void SetHoriOrient( sal_Int16 eNew ) { eOrient = eNew; }
SetRelationOrient(sal_Int16 eNew)103cdf0e10cSrcweir     void SetRelationOrient( sal_Int16 eNew ) { eRelation = eNew; }
104cdf0e10cSrcweir 
GetPos() const105cdf0e10cSrcweir 	SwTwips GetPos() const { return nXPos; }
SetPos(SwTwips nNew)106cdf0e10cSrcweir 	void    SetPos( SwTwips nNew ) { nXPos = nNew; }
107cdf0e10cSrcweir 
IsPosToggle() const108cdf0e10cSrcweir 	sal_Bool IsPosToggle() const { return bPosToggle; }
SetPosToggle(sal_Bool bNew)109cdf0e10cSrcweir 	void SetPosToggle( sal_Bool bNew ) { bPosToggle = bNew; }
110cdf0e10cSrcweir };
111cdf0e10cSrcweir 
operator =(const SwFmtVertOrient & rCpy)112cdf0e10cSrcweir inline SwFmtVertOrient &SwFmtVertOrient::operator=( const SwFmtVertOrient &rCpy )
113cdf0e10cSrcweir {
114cdf0e10cSrcweir 	nYPos = rCpy.GetPos();
115cdf0e10cSrcweir 	eOrient = rCpy.GetVertOrient();
116cdf0e10cSrcweir 	eRelation = rCpy.GetRelationOrient();
117cdf0e10cSrcweir 	return *this;
118cdf0e10cSrcweir }
operator =(const SwFmtHoriOrient & rCpy)119cdf0e10cSrcweir inline SwFmtHoriOrient &SwFmtHoriOrient::operator=( const SwFmtHoriOrient &rCpy )
120cdf0e10cSrcweir {
121cdf0e10cSrcweir 	nXPos = rCpy.GetPos();
122cdf0e10cSrcweir 	eOrient = rCpy.GetHoriOrient();
123cdf0e10cSrcweir 	eRelation = rCpy.GetRelationOrient();
124cdf0e10cSrcweir 	bPosToggle = rCpy.IsPosToggle();
125cdf0e10cSrcweir 	return *this;
126cdf0e10cSrcweir }
127cdf0e10cSrcweir 
GetVertOrient(sal_Bool bInP) const128cdf0e10cSrcweir inline const SwFmtVertOrient &SwAttrSet::GetVertOrient(sal_Bool bInP) const
129cdf0e10cSrcweir 	{ return (const SwFmtVertOrient&)Get( RES_VERT_ORIENT,bInP); }
GetHoriOrient(sal_Bool bInP) const130cdf0e10cSrcweir inline const SwFmtHoriOrient &SwAttrSet::GetHoriOrient(sal_Bool bInP) const
131cdf0e10cSrcweir 	{ return (const SwFmtHoriOrient&)Get( RES_HORI_ORIENT,bInP); }
132cdf0e10cSrcweir 
GetVertOrient(sal_Bool bInP) const133cdf0e10cSrcweir inline const SwFmtVertOrient &SwFmt::GetVertOrient(sal_Bool bInP) const
134cdf0e10cSrcweir 	{ return aSet.GetVertOrient(bInP); }
GetHoriOrient(sal_Bool bInP) const135cdf0e10cSrcweir inline const SwFmtHoriOrient &SwFmt::GetHoriOrient(sal_Bool bInP) const
136cdf0e10cSrcweir 	{ return aSet.GetHoriOrient(bInP); }
137cdf0e10cSrcweir 
138cdf0e10cSrcweir #endif
139cdf0e10cSrcweir 
140