1*4c5491eaSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*4c5491eaSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*4c5491eaSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*4c5491eaSAndrew Rist * distributed with this work for additional information 6*4c5491eaSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*4c5491eaSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*4c5491eaSAndrew Rist * "License"); you may not use this file except in compliance 9*4c5491eaSAndrew Rist * with the License. You may obtain a copy of the License at 10*4c5491eaSAndrew Rist * 11*4c5491eaSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*4c5491eaSAndrew Rist * 13*4c5491eaSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*4c5491eaSAndrew Rist * software distributed under the License is distributed on an 15*4c5491eaSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*4c5491eaSAndrew Rist * KIND, either express or implied. See the License for the 17*4c5491eaSAndrew Rist * specific language governing permissions and limitations 18*4c5491eaSAndrew Rist * under the License. 19*4c5491eaSAndrew Rist * 20*4c5491eaSAndrew Rist *************************************************************/ 21*4c5491eaSAndrew Rist 22*4c5491eaSAndrew Rist 23cdf0e10cSrcweir #ifndef _SVX_UDLNITEM_HXX 24cdf0e10cSrcweir #define _SVX_UDLNITEM_HXX 25cdf0e10cSrcweir 26cdf0e10cSrcweir // include --------------------------------------------------------------- 27cdf0e10cSrcweir 28cdf0e10cSrcweir #include <svl/eitem.hxx> 29cdf0e10cSrcweir #include <vcl/vclenum.hxx> 30cdf0e10cSrcweir #include <tools/color.hxx> 31cdf0e10cSrcweir #include <editeng/editengdllapi.h> 32cdf0e10cSrcweir 33cdf0e10cSrcweir class SvXMLUnitConverter; 34cdf0e10cSrcweir namespace rtl 35cdf0e10cSrcweir { 36cdf0e10cSrcweir class OUString; 37cdf0e10cSrcweir } 38cdf0e10cSrcweir 39cdf0e10cSrcweir // class SvxTextLineItem ------------------------------------------------ 40cdf0e10cSrcweir 41cdf0e10cSrcweir /* Value container for underline and overline font effects */ 42cdf0e10cSrcweir 43cdf0e10cSrcweir class EDITENG_DLLPUBLIC SvxTextLineItem : public SfxEnumItem 44cdf0e10cSrcweir { 45cdf0e10cSrcweir Color mColor; 46cdf0e10cSrcweir public: 47cdf0e10cSrcweir TYPEINFO(); 48cdf0e10cSrcweir 49cdf0e10cSrcweir SvxTextLineItem( const FontUnderline eSt, 50cdf0e10cSrcweir const sal_uInt16 nId ); 51cdf0e10cSrcweir 52cdf0e10cSrcweir // "pure virtual Methoden" vom SfxPoolItem 53cdf0e10cSrcweir virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, 54cdf0e10cSrcweir SfxMapUnit eCoreMetric, 55cdf0e10cSrcweir SfxMapUnit ePresMetric, 56cdf0e10cSrcweir String &rText, const IntlWrapper * = 0 ) const; 57cdf0e10cSrcweir 58cdf0e10cSrcweir virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; 59cdf0e10cSrcweir virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const; 60cdf0e10cSrcweir virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const; 61cdf0e10cSrcweir virtual String GetValueTextByPos( sal_uInt16 nPos ) const; 62cdf0e10cSrcweir virtual sal_uInt16 GetValueCount() const; 63cdf0e10cSrcweir 64cdf0e10cSrcweir virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, 65cdf0e10cSrcweir sal_uInt8 nMemberId = 0 ) const; 66cdf0e10cSrcweir virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, 67cdf0e10cSrcweir sal_uInt8 nMemberId = 0 ); 68cdf0e10cSrcweir 69cdf0e10cSrcweir // MS VC4.0 kommt durcheinander SetValue(sal_uInt16 nNewVal)70cdf0e10cSrcweir void SetValue( sal_uInt16 nNewVal ) 71cdf0e10cSrcweir {SfxEnumItem::SetValue(nNewVal); } 72cdf0e10cSrcweir virtual int HasBoolValue() const; 73cdf0e10cSrcweir virtual sal_Bool GetBoolValue() const; 74cdf0e10cSrcweir virtual void SetBoolValue( sal_Bool bVal ); 75cdf0e10cSrcweir 76cdf0e10cSrcweir virtual int operator==( const SfxPoolItem& ) const; 77cdf0e10cSrcweir operator =(const SvxTextLineItem & rTextLine)78cdf0e10cSrcweir inline SvxTextLineItem& operator=(const SvxTextLineItem& rTextLine) 79cdf0e10cSrcweir { 80cdf0e10cSrcweir SetValue( rTextLine.GetValue() ); 81cdf0e10cSrcweir SetColor( rTextLine.GetColor() ); 82cdf0e10cSrcweir return *this; 83cdf0e10cSrcweir } 84cdf0e10cSrcweir 85cdf0e10cSrcweir // enum cast GetLineStyle() const86cdf0e10cSrcweir FontUnderline GetLineStyle() const 87cdf0e10cSrcweir { return (FontUnderline)GetValue(); } SetLineStyle(FontUnderline eNew)88cdf0e10cSrcweir void SetLineStyle( FontUnderline eNew ) 89cdf0e10cSrcweir { SetValue((sal_uInt16) eNew); } 90cdf0e10cSrcweir GetColor() const91cdf0e10cSrcweir const Color& GetColor() const { return mColor; } SetColor(const Color & rCol)92cdf0e10cSrcweir void SetColor( const Color& rCol ) { mColor = rCol; } 93cdf0e10cSrcweir }; 94cdf0e10cSrcweir 95cdf0e10cSrcweir // class SvxUnderlineItem ------------------------------------------------ 96cdf0e10cSrcweir 97cdf0e10cSrcweir /* Value container for underline font effects */ 98cdf0e10cSrcweir 99cdf0e10cSrcweir class EDITENG_DLLPUBLIC SvxUnderlineItem : public SvxTextLineItem 100cdf0e10cSrcweir { 101cdf0e10cSrcweir public: 102cdf0e10cSrcweir TYPEINFO(); 103cdf0e10cSrcweir 104cdf0e10cSrcweir SvxUnderlineItem( const FontUnderline eSt, 105cdf0e10cSrcweir const sal_uInt16 nId ); 106cdf0e10cSrcweir 107cdf0e10cSrcweir virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; 108cdf0e10cSrcweir virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const; 109cdf0e10cSrcweir virtual String GetValueTextByPos( sal_uInt16 nPos ) const; 110cdf0e10cSrcweir }; 111cdf0e10cSrcweir 112cdf0e10cSrcweir // class SvxOverlineItem ------------------------------------------------ 113cdf0e10cSrcweir 114cdf0e10cSrcweir /* Value container for overline font effects */ 115cdf0e10cSrcweir 116cdf0e10cSrcweir class EDITENG_DLLPUBLIC SvxOverlineItem : public SvxTextLineItem 117cdf0e10cSrcweir { 118cdf0e10cSrcweir public: 119cdf0e10cSrcweir TYPEINFO(); 120cdf0e10cSrcweir 121cdf0e10cSrcweir SvxOverlineItem( const FontUnderline eSt, 122cdf0e10cSrcweir const sal_uInt16 nId ); 123cdf0e10cSrcweir 124cdf0e10cSrcweir virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; 125cdf0e10cSrcweir virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const; 126cdf0e10cSrcweir virtual String GetValueTextByPos( sal_uInt16 nPos ) const; 127cdf0e10cSrcweir }; 128cdf0e10cSrcweir 129cdf0e10cSrcweir #endif // #ifndef _SVX_UDLNITEM_HXX 130