1*3334a7e6SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*3334a7e6SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*3334a7e6SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*3334a7e6SAndrew Rist * distributed with this work for additional information 6*3334a7e6SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*3334a7e6SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*3334a7e6SAndrew Rist * "License"); you may not use this file except in compliance 9*3334a7e6SAndrew Rist * with the License. You may obtain a copy of the License at 10*3334a7e6SAndrew Rist * 11*3334a7e6SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*3334a7e6SAndrew Rist * 13*3334a7e6SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*3334a7e6SAndrew Rist * software distributed under the License is distributed on an 15*3334a7e6SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*3334a7e6SAndrew Rist * KIND, either express or implied. See the License for the 17*3334a7e6SAndrew Rist * specific language governing permissions and limitations 18*3334a7e6SAndrew Rist * under the License. 19*3334a7e6SAndrew Rist * 20*3334a7e6SAndrew Rist *************************************************************/ 21*3334a7e6SAndrew Rist 22*3334a7e6SAndrew Rist 23cdf0e10cSrcweir #ifndef _SVX_ALGITEM_HXX 24cdf0e10cSrcweir #define _SVX_ALGITEM_HXX 25cdf0e10cSrcweir 26cdf0e10cSrcweir // include --------------------------------------------------------------- 27cdf0e10cSrcweir 28cdf0e10cSrcweir #include <svx/svxids.hrc> 29cdf0e10cSrcweir #include <svl/poolitem.hxx> 30cdf0e10cSrcweir #include <svl/eitem.hxx> 31cdf0e10cSrcweir #include <editeng/svxenum.hxx> 32cdf0e10cSrcweir #include "svx/svxdllapi.h" 33cdf0e10cSrcweir 34cdf0e10cSrcweir class SvStream; 35cdf0e10cSrcweir 36cdf0e10cSrcweir //------------------------------------------------------------------------ 37cdf0e10cSrcweir 38cdf0e10cSrcweir 39cdf0e10cSrcweir 40cdf0e10cSrcweir class SVX_DLLPUBLIC SvxHorJustifyItem: public SfxEnumItem 41cdf0e10cSrcweir { 42cdf0e10cSrcweir public: 43cdf0e10cSrcweir TYPEINFO(); 44cdf0e10cSrcweir 45cdf0e10cSrcweir SvxHorJustifyItem( const sal_uInt16 nId ); 46cdf0e10cSrcweir 47cdf0e10cSrcweir SvxHorJustifyItem( 48cdf0e10cSrcweir const SvxCellHorJustify eJustify /*= SVX_HOR_JUSTIFY_STANDARD*/, 49cdf0e10cSrcweir const sal_uInt16 nId ); 50cdf0e10cSrcweir 51cdf0e10cSrcweir virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, 52cdf0e10cSrcweir SfxMapUnit eCoreMetric, 53cdf0e10cSrcweir SfxMapUnit ePresMetric, 54cdf0e10cSrcweir String &rText, const IntlWrapper * = 0 ) const; 55cdf0e10cSrcweir 56cdf0e10cSrcweir virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; 57cdf0e10cSrcweir virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); 58cdf0e10cSrcweir 59cdf0e10cSrcweir virtual sal_uInt16 GetValueCount() const; 60cdf0e10cSrcweir virtual String GetValueText( sal_uInt16 nVal ) const; 61cdf0e10cSrcweir virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; 62cdf0e10cSrcweir virtual SfxPoolItem* Create( SvStream& rStream, sal_uInt16 nVer ) const; 63cdf0e10cSrcweir operator =(const SvxHorJustifyItem & rHorJustify)64cdf0e10cSrcweir inline SvxHorJustifyItem& operator=(const SvxHorJustifyItem& rHorJustify) 65cdf0e10cSrcweir { 66cdf0e10cSrcweir SetValue( rHorJustify.GetValue() ); 67cdf0e10cSrcweir return *this; 68cdf0e10cSrcweir } 69cdf0e10cSrcweir }; 70cdf0e10cSrcweir 71cdf0e10cSrcweir 72cdf0e10cSrcweir //------------------------------------------------------------------------ 73cdf0e10cSrcweir 74cdf0e10cSrcweir 75cdf0e10cSrcweir class SVX_DLLPUBLIC SvxVerJustifyItem: public SfxEnumItem 76cdf0e10cSrcweir { 77cdf0e10cSrcweir public: 78cdf0e10cSrcweir TYPEINFO(); 79cdf0e10cSrcweir 80cdf0e10cSrcweir SvxVerJustifyItem( const sal_uInt16 nId ); 81cdf0e10cSrcweir 82cdf0e10cSrcweir SvxVerJustifyItem( 83cdf0e10cSrcweir const SvxCellVerJustify eJustify /*= SVX_VER_JUSTIFY_STANDARD*/, 84cdf0e10cSrcweir const sal_uInt16 nId ); 85cdf0e10cSrcweir 86cdf0e10cSrcweir virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, 87cdf0e10cSrcweir SfxMapUnit eCoreMetric, 88cdf0e10cSrcweir SfxMapUnit ePresMetric, 89cdf0e10cSrcweir String &rText, const IntlWrapper * = 0 ) const; 90cdf0e10cSrcweir 91cdf0e10cSrcweir virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; 92cdf0e10cSrcweir virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); 93cdf0e10cSrcweir 94cdf0e10cSrcweir virtual sal_uInt16 GetValueCount() const; 95cdf0e10cSrcweir virtual String GetValueText( sal_uInt16 nVal ) const; 96cdf0e10cSrcweir virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; 97cdf0e10cSrcweir virtual SfxPoolItem* Create( SvStream& rStream, sal_uInt16 nVer ) const; 98cdf0e10cSrcweir operator =(const SvxVerJustifyItem & rVerJustify)99cdf0e10cSrcweir inline SvxVerJustifyItem& operator=(const SvxVerJustifyItem& rVerJustify) 100cdf0e10cSrcweir { 101cdf0e10cSrcweir SetValue( rVerJustify.GetValue() ); 102cdf0e10cSrcweir return *this; 103cdf0e10cSrcweir } 104cdf0e10cSrcweir }; 105cdf0e10cSrcweir 106cdf0e10cSrcweir 107cdf0e10cSrcweir //------------------------------------------------------------------------ 108cdf0e10cSrcweir 109cdf0e10cSrcweir class SVX_DLLPUBLIC SvxOrientationItem: public SfxEnumItem 110cdf0e10cSrcweir { 111cdf0e10cSrcweir public: 112cdf0e10cSrcweir TYPEINFO(); 113cdf0e10cSrcweir 114cdf0e10cSrcweir SvxOrientationItem( 115cdf0e10cSrcweir const SvxCellOrientation eOrientation /*= SVX_ORIENTATION_STANDARD*/, 116cdf0e10cSrcweir const sal_uInt16 nId ); 117cdf0e10cSrcweir 118cdf0e10cSrcweir SvxOrientationItem( 119cdf0e10cSrcweir sal_Int32 nRotation, sal_Bool bStacked, 120cdf0e10cSrcweir const sal_uInt16 nId ); 121cdf0e10cSrcweir 122cdf0e10cSrcweir virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, 123cdf0e10cSrcweir SfxMapUnit eCoreMetric, 124cdf0e10cSrcweir SfxMapUnit ePresMetric, 125cdf0e10cSrcweir String &rText, const IntlWrapper * = 0 ) const; 126cdf0e10cSrcweir 127cdf0e10cSrcweir virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; 128cdf0e10cSrcweir virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); 129cdf0e10cSrcweir 130cdf0e10cSrcweir virtual sal_uInt16 GetValueCount() const; 131cdf0e10cSrcweir virtual String GetValueText( sal_uInt16 nVal ) const; 132cdf0e10cSrcweir virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; 133cdf0e10cSrcweir virtual SfxPoolItem* Create( SvStream& rStream, sal_uInt16 nVer ) const; 134cdf0e10cSrcweir operator =(const SvxOrientationItem & rOrientation)135cdf0e10cSrcweir inline SvxOrientationItem& operator=(const SvxOrientationItem& rOrientation) 136cdf0e10cSrcweir { 137cdf0e10cSrcweir SetValue( rOrientation.GetValue() ); 138cdf0e10cSrcweir return *this; 139cdf0e10cSrcweir } 140cdf0e10cSrcweir 141cdf0e10cSrcweir /** Returns sal_True, if the item represents STACKED state. */ 142cdf0e10cSrcweir sal_Bool IsStacked() const; 143cdf0e10cSrcweir /** Returns the rotation this item represents (returns nStdAngle for STANDARD and STACKED state). */ 144cdf0e10cSrcweir sal_Int32 GetRotation( sal_Int32 nStdAngle = 0 ) const; 145cdf0e10cSrcweir /** Fills this item according to passed item values. */ 146cdf0e10cSrcweir void SetFromRotation( sal_Int32 nRotation, sal_Bool bStacked ); 147cdf0e10cSrcweir }; 148cdf0e10cSrcweir 149cdf0e10cSrcweir //------------------------------------------------------------------------ 150cdf0e10cSrcweir 151cdf0e10cSrcweir class SVX_DLLPUBLIC SvxMarginItem: public SfxPoolItem 152cdf0e10cSrcweir { 153cdf0e10cSrcweir sal_Int16 nLeftMargin; 154cdf0e10cSrcweir sal_Int16 nTopMargin; 155cdf0e10cSrcweir sal_Int16 nRightMargin; 156cdf0e10cSrcweir sal_Int16 nBottomMargin; 157cdf0e10cSrcweir public: 158cdf0e10cSrcweir TYPEINFO(); 159cdf0e10cSrcweir SvxMarginItem( const sal_uInt16 nId ); 160cdf0e10cSrcweir SvxMarginItem( sal_Int16 nLeft, sal_Int16 nTop /*= 0*/, 161cdf0e10cSrcweir sal_Int16 nRight /*= 0*/, sal_Int16 nBottom /*= 0*/, 162cdf0e10cSrcweir const sal_uInt16 nId ); 163cdf0e10cSrcweir SvxMarginItem( const SvxMarginItem& ); 164cdf0e10cSrcweir 165cdf0e10cSrcweir virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, 166cdf0e10cSrcweir SfxMapUnit eCoreMetric, 167cdf0e10cSrcweir SfxMapUnit ePresMetric, 168cdf0e10cSrcweir String &rText, const IntlWrapper * = 0 ) const; 169cdf0e10cSrcweir 170cdf0e10cSrcweir virtual int operator==( const SfxPoolItem& ) const; 171cdf0e10cSrcweir virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; 172cdf0e10cSrcweir virtual SfxPoolItem* Create( SvStream& rStream, sal_uInt16 nVer ) const; 173cdf0e10cSrcweir virtual SvStream& Store( SvStream&, sal_uInt16 nItemVersion ) const; 174cdf0e10cSrcweir 175cdf0e10cSrcweir virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; 176cdf0e10cSrcweir virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); 177cdf0e10cSrcweir GetLeftMargin() const178cdf0e10cSrcweir sal_Int16 GetLeftMargin() const {return nLeftMargin; } 179cdf0e10cSrcweir sal_Bool SetLeftMargin(sal_Int16 nLeft); GetTopMargin() const180cdf0e10cSrcweir sal_Int16 GetTopMargin() const {return nTopMargin; } 181cdf0e10cSrcweir sal_Bool SetTopMargin(sal_Int16 nTop); GetRightMargin() const182cdf0e10cSrcweir sal_Int16 GetRightMargin() const {return nRightMargin; } 183cdf0e10cSrcweir sal_Bool SetRightMargin(sal_Int16 nRight); GetBottomMargin() const184cdf0e10cSrcweir sal_Int16 GetBottomMargin() const {return nBottomMargin; } 185cdf0e10cSrcweir sal_Bool SetBottomMargin(sal_Int16 nBottom); 186cdf0e10cSrcweir operator =(const SvxMarginItem & rMargin)187cdf0e10cSrcweir inline SvxMarginItem& operator=(const SvxMarginItem& rMargin) 188cdf0e10cSrcweir { 189cdf0e10cSrcweir nLeftMargin = rMargin.nLeftMargin; 190cdf0e10cSrcweir nTopMargin = rMargin.nTopMargin; 191cdf0e10cSrcweir nRightMargin = rMargin.nRightMargin; 192cdf0e10cSrcweir nBottomMargin = rMargin.nBottomMargin; 193cdf0e10cSrcweir return *this; 194cdf0e10cSrcweir } 195cdf0e10cSrcweir }; 196cdf0e10cSrcweir 197cdf0e10cSrcweir #endif 198cdf0e10cSrcweir 199