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: fmtornt.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 <com/sun/star/text/HoriOrientation.hpp>
34 #include <com/sun/star/text/VertOrientation.hpp>
35 #include <com/sun/star/text/RelOrientation.hpp>
37 #include <hintids.hxx>
38 #include <swtypes.hxx>
40 #include <svtools/poolitem.hxx>
45 #define IVER_VERTORIENT_REL ((USHORT)0x0001)
47 class SW_DLLPUBLIC SwFmtVertOrient
: public SfxPoolItem
49 SwTwips nYPos
; //Enthaelt _immer_ die aktuelle RelPos.
54 SwFmtVertOrient( SwTwips nY
= 0, sal_Int16 eVert
= com::sun::star::text::VertOrientation::NONE
,
55 sal_Int16 eRel
= com::sun::star::text::RelOrientation::PRINT_AREA
);
56 inline SwFmtVertOrient
&operator=( const SwFmtVertOrient
&rCpy
);
58 // "pure virtual Methoden" vom SfxPoolItem
59 virtual int operator==( const SfxPoolItem
& ) const;
60 virtual SfxPoolItem
* Clone( SfxItemPool
* pPool
= 0 ) const;
61 virtual SfxItemPresentation
GetPresentation( SfxItemPresentation ePres
,
62 SfxMapUnit eCoreMetric
,
63 SfxMapUnit ePresMetric
,
65 const IntlWrapper
* pIntl
= 0 ) const;
66 virtual BOOL
QueryValue( com::sun::star::uno::Any
& rVal
, BYTE nMemberId
= 0 ) const;
67 virtual BOOL
PutValue( const com::sun::star::uno::Any
& rVal
, BYTE nMemberId
= 0 );
69 sal_Int16
GetVertOrient() const { return eOrient
; }
70 sal_Int16
GetRelationOrient() const { return eRelation
; }
71 void SetVertOrient( sal_Int16 eNew
) { eOrient
= eNew
; }
72 void SetRelationOrient( sal_Int16 eNew
) { eRelation
= eNew
; }
74 SwTwips
GetPos() const { return nYPos
; }
75 void SetPos( SwTwips nNew
) { nYPos
= nNew
; }
78 //SwFmtHoriOrient, wie und woran orientiert --
79 // sich der FlyFrm in der Hoizontalen ----------
81 #define IVER_HORIORIENT_TOGGLE ((USHORT)0x0001)
82 #define IVER_HORIORIENT_REL ((USHORT)0x0002)
84 class SW_DLLPUBLIC SwFmtHoriOrient
: public SfxPoolItem
86 SwTwips nXPos
; //Enthaelt _immer_ die aktuelle RelPos.
89 BOOL bPosToggle
: 1; // auf geraden Seiten Position spiegeln
92 SwFmtHoriOrient( SwTwips nX
= 0, sal_Int16 eHori
= com::sun::star::text::HoriOrientation::NONE
,
93 sal_Int16 eRel
= com::sun::star::text::RelOrientation::PRINT_AREA
, BOOL bPos
= FALSE
);
94 inline SwFmtHoriOrient
&operator=( const SwFmtHoriOrient
&rCpy
);
96 // "pure virtual Methoden" vom SfxPoolItem
97 virtual int operator==( const SfxPoolItem
& ) const;
98 virtual SfxPoolItem
* Clone( SfxItemPool
* pPool
= 0 ) const;
99 virtual SfxItemPresentation
GetPresentation( SfxItemPresentation ePres
,
100 SfxMapUnit eCoreMetric
,
101 SfxMapUnit ePresMetric
,
103 const IntlWrapper
* pIntl
= 0 ) const;
104 virtual BOOL
QueryValue( com::sun::star::uno::Any
& rVal
, BYTE nMemberId
= 0 ) const;
105 virtual BOOL
PutValue( const com::sun::star::uno::Any
& rVal
, BYTE nMemberId
= 0 );
107 sal_Int16
GetHoriOrient() const { return eOrient
; }
108 sal_Int16
GetRelationOrient() const { return eRelation
; }
109 void SetHoriOrient( sal_Int16 eNew
) { eOrient
= eNew
; }
110 void SetRelationOrient( sal_Int16 eNew
) { eRelation
= eNew
; }
112 SwTwips
GetPos() const { return nXPos
; }
113 void SetPos( SwTwips nNew
) { nXPos
= nNew
; }
115 BOOL
IsPosToggle() const { return bPosToggle
; }
116 void SetPosToggle( BOOL bNew
) { bPosToggle
= bNew
; }
119 inline SwFmtVertOrient
&SwFmtVertOrient::operator=( const SwFmtVertOrient
&rCpy
)
121 nYPos
= rCpy
.GetPos();
122 eOrient
= rCpy
.GetVertOrient();
123 eRelation
= rCpy
.GetRelationOrient();
126 inline SwFmtHoriOrient
&SwFmtHoriOrient::operator=( const SwFmtHoriOrient
&rCpy
)
128 nXPos
= rCpy
.GetPos();
129 eOrient
= rCpy
.GetHoriOrient();
130 eRelation
= rCpy
.GetRelationOrient();
131 bPosToggle
= rCpy
.IsPosToggle();
135 inline const SwFmtVertOrient
&SwAttrSet::GetVertOrient(BOOL bInP
) const
136 { return (const SwFmtVertOrient
&)Get( RES_VERT_ORIENT
,bInP
); }
137 inline const SwFmtHoriOrient
&SwAttrSet::GetHoriOrient(BOOL bInP
) const
138 { return (const SwFmtHoriOrient
&)Get( RES_HORI_ORIENT
,bInP
); }
140 inline const SwFmtVertOrient
&SwFmt::GetVertOrient(BOOL bInP
) const
141 { return aSet
.GetVertOrient(bInP
); }
142 inline const SwFmtHoriOrient
&SwFmt::GetHoriOrient(BOOL bInP
) const
143 { return aSet
.GetHoriOrient(bInP
); }