1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 #ifndef _SVX_UDLNITEM_HXX 28 #define _SVX_UDLNITEM_HXX 29 30 // include --------------------------------------------------------------- 31 32 #include <svl/eitem.hxx> 33 #include <vcl/vclenum.hxx> 34 #include <tools/color.hxx> 35 #include <editeng/editengdllapi.h> 36 37 class SvXMLUnitConverter; 38 namespace rtl 39 { 40 class OUString; 41 } 42 43 // class SvxTextLineItem ------------------------------------------------ 44 45 /* Value container for underline and overline font effects */ 46 47 class EDITENG_DLLPUBLIC SvxTextLineItem : public SfxEnumItem 48 { 49 Color mColor; 50 public: 51 TYPEINFO(); 52 53 SvxTextLineItem( const FontUnderline eSt, 54 const sal_uInt16 nId ); 55 56 // "pure virtual Methoden" vom SfxPoolItem 57 virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, 58 SfxMapUnit eCoreMetric, 59 SfxMapUnit ePresMetric, 60 String &rText, const IntlWrapper * = 0 ) const; 61 62 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; 63 virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const; 64 virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const; 65 virtual String GetValueTextByPos( sal_uInt16 nPos ) const; 66 virtual sal_uInt16 GetValueCount() const; 67 68 virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, 69 sal_uInt8 nMemberId = 0 ) const; 70 virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, 71 sal_uInt8 nMemberId = 0 ); 72 73 // MS VC4.0 kommt durcheinander 74 void SetValue( sal_uInt16 nNewVal ) 75 {SfxEnumItem::SetValue(nNewVal); } 76 virtual int HasBoolValue() const; 77 virtual sal_Bool GetBoolValue() const; 78 virtual void SetBoolValue( sal_Bool bVal ); 79 80 virtual int operator==( const SfxPoolItem& ) const; 81 82 inline SvxTextLineItem& operator=(const SvxTextLineItem& rTextLine) 83 { 84 SetValue( rTextLine.GetValue() ); 85 SetColor( rTextLine.GetColor() ); 86 return *this; 87 } 88 89 // enum cast 90 FontUnderline GetLineStyle() const 91 { return (FontUnderline)GetValue(); } 92 void SetLineStyle( FontUnderline eNew ) 93 { SetValue((sal_uInt16) eNew); } 94 95 const Color& GetColor() const { return mColor; } 96 void SetColor( const Color& rCol ) { mColor = rCol; } 97 }; 98 99 // class SvxUnderlineItem ------------------------------------------------ 100 101 /* Value container for underline font effects */ 102 103 class EDITENG_DLLPUBLIC SvxUnderlineItem : public SvxTextLineItem 104 { 105 public: 106 TYPEINFO(); 107 108 SvxUnderlineItem( const FontUnderline eSt, 109 const sal_uInt16 nId ); 110 111 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; 112 virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const; 113 virtual String GetValueTextByPos( sal_uInt16 nPos ) const; 114 }; 115 116 // class SvxOverlineItem ------------------------------------------------ 117 118 /* Value container for overline font effects */ 119 120 class EDITENG_DLLPUBLIC SvxOverlineItem : public SvxTextLineItem 121 { 122 public: 123 TYPEINFO(); 124 125 SvxOverlineItem( const FontUnderline eSt, 126 const sal_uInt16 nId ); 127 128 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; 129 virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const; 130 virtual String GetValueTextByPos( sal_uInt16 nPos ) const; 131 }; 132 133 #endif // #ifndef _SVX_UDLNITEM_HXX 134