1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 #ifndef _FMTORNT_HXX 24 #define _FMTORNT_HXX 25 26 #include <com/sun/star/text/HoriOrientation.hpp> 27 #include <com/sun/star/text/VertOrientation.hpp> 28 #include <com/sun/star/text/RelOrientation.hpp> 29 #include "swdllapi.h" 30 #include <hintids.hxx> 31 #include <swtypes.hxx> 32 #include <format.hxx> 33 #include <svl/poolitem.hxx> 34 35 36 class IntlWrapper; 37 38 #define IVER_VERTORIENT_REL ((sal_uInt16)0x0001) 39 40 class SW_DLLPUBLIC SwFmtVertOrient: public SfxPoolItem 41 { 42 SwTwips nYPos; //Enthaelt _immer_ die aktuelle RelPos. 43 sal_Int16 eOrient; 44 sal_Int16 eRelation; 45 public: 46 TYPEINFO(); 47 SwFmtVertOrient( SwTwips nY = 0, sal_Int16 eVert = com::sun::star::text::VertOrientation::NONE, 48 sal_Int16 eRel = com::sun::star::text::RelOrientation::PRINT_AREA ); 49 inline SwFmtVertOrient &operator=( const SwFmtVertOrient &rCpy ); 50 51 // "pure virtual Methoden" vom SfxPoolItem 52 virtual int operator==( const SfxPoolItem& ) const; 53 virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; 54 virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, 55 SfxMapUnit eCoreMetric, 56 SfxMapUnit ePresMetric, 57 String &rText, 58 const IntlWrapper* pIntl = 0 ) const; 59 virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; 60 virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); 61 62 sal_Int16 GetVertOrient() const { return eOrient; } 63 sal_Int16 GetRelationOrient() const { return eRelation; } 64 void SetVertOrient( sal_Int16 eNew ) { eOrient = eNew; } 65 void SetRelationOrient( sal_Int16 eNew ) { eRelation = eNew; } 66 67 SwTwips GetPos() const { return nYPos; } 68 void SetPos( SwTwips nNew ) { nYPos = nNew; } 69 }; 70 71 //SwFmtHoriOrient, wie und woran orientiert -- 72 // sich der FlyFrm in der Hoizontalen ---------- 73 74 #define IVER_HORIORIENT_TOGGLE ((sal_uInt16)0x0001) 75 #define IVER_HORIORIENT_REL ((sal_uInt16)0x0002) 76 77 class SW_DLLPUBLIC SwFmtHoriOrient: public SfxPoolItem 78 { 79 SwTwips nXPos; //Enthaelt _immer_ die aktuelle RelPos. 80 sal_Int16 eOrient; 81 sal_Int16 eRelation; 82 sal_Bool bPosToggle : 1; // auf geraden Seiten Position spiegeln 83 public: 84 TYPEINFO(); 85 SwFmtHoriOrient( SwTwips nX = 0, sal_Int16 eHori = com::sun::star::text::HoriOrientation::NONE, 86 sal_Int16 eRel = com::sun::star::text::RelOrientation::PRINT_AREA, sal_Bool bPos = sal_False ); 87 inline SwFmtHoriOrient &operator=( const SwFmtHoriOrient &rCpy ); 88 89 // "pure virtual Methoden" vom SfxPoolItem 90 virtual int operator==( const SfxPoolItem& ) const; 91 virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; 92 virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, 93 SfxMapUnit eCoreMetric, 94 SfxMapUnit ePresMetric, 95 String &rText, 96 const IntlWrapper* pIntl = 0 ) const; 97 virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; 98 virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); 99 100 sal_Int16 GetHoriOrient() const { return eOrient; } 101 sal_Int16 GetRelationOrient() const { return eRelation; } 102 void SetHoriOrient( sal_Int16 eNew ) { eOrient = eNew; } 103 void SetRelationOrient( sal_Int16 eNew ) { eRelation = eNew; } 104 105 SwTwips GetPos() const { return nXPos; } 106 void SetPos( SwTwips nNew ) { nXPos = nNew; } 107 108 sal_Bool IsPosToggle() const { return bPosToggle; } 109 void SetPosToggle( sal_Bool bNew ) { bPosToggle = bNew; } 110 }; 111 112 inline SwFmtVertOrient &SwFmtVertOrient::operator=( const SwFmtVertOrient &rCpy ) 113 { 114 nYPos = rCpy.GetPos(); 115 eOrient = rCpy.GetVertOrient(); 116 eRelation = rCpy.GetRelationOrient(); 117 return *this; 118 } 119 inline SwFmtHoriOrient &SwFmtHoriOrient::operator=( const SwFmtHoriOrient &rCpy ) 120 { 121 nXPos = rCpy.GetPos(); 122 eOrient = rCpy.GetHoriOrient(); 123 eRelation = rCpy.GetRelationOrient(); 124 bPosToggle = rCpy.IsPosToggle(); 125 return *this; 126 } 127 128 inline const SwFmtVertOrient &SwAttrSet::GetVertOrient(sal_Bool bInP) const 129 { return (const SwFmtVertOrient&)Get( RES_VERT_ORIENT,bInP); } 130 inline const SwFmtHoriOrient &SwAttrSet::GetHoriOrient(sal_Bool bInP) const 131 { return (const SwFmtHoriOrient&)Get( RES_HORI_ORIENT,bInP); } 132 133 inline const SwFmtVertOrient &SwFmt::GetVertOrient(sal_Bool bInP) const 134 { return aSet.GetVertOrient(bInP); } 135 inline const SwFmtHoriOrient &SwFmt::GetHoriOrient(sal_Bool bInP) const 136 { return aSet.GetHoriOrient(bInP); } 137 138 #endif 139 140