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 _SVX_UDLNITEM_HXX 24 #define _SVX_UDLNITEM_HXX 25 26 // include --------------------------------------------------------------- 27 28 #include <svl/eitem.hxx> 29 #include <vcl/vclenum.hxx> 30 #include <tools/color.hxx> 31 #include <editeng/editengdllapi.h> 32 33 class SvXMLUnitConverter; 34 namespace rtl 35 { 36 class OUString; 37 } 38 39 // class SvxTextLineItem ------------------------------------------------ 40 41 /* Value container for underline and overline font effects */ 42 43 class EDITENG_DLLPUBLIC SvxTextLineItem : public SfxEnumItem 44 { 45 Color mColor; 46 public: 47 TYPEINFO(); 48 49 SvxTextLineItem( const FontUnderline eSt, 50 const sal_uInt16 nId ); 51 52 // "pure virtual Methoden" vom SfxPoolItem 53 virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, 54 SfxMapUnit eCoreMetric, 55 SfxMapUnit ePresMetric, 56 String &rText, const IntlWrapper * = 0 ) const; 57 58 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; 59 virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const; 60 virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const; 61 virtual String GetValueTextByPos( sal_uInt16 nPos ) const; 62 virtual sal_uInt16 GetValueCount() const; 63 64 virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, 65 sal_uInt8 nMemberId = 0 ) const; 66 virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, 67 sal_uInt8 nMemberId = 0 ); 68 69 // MS VC4.0 kommt durcheinander SetValue(sal_uInt16 nNewVal)70 void SetValue( sal_uInt16 nNewVal ) 71 {SfxEnumItem::SetValue(nNewVal); } 72 virtual int HasBoolValue() const; 73 virtual sal_Bool GetBoolValue() const; 74 virtual void SetBoolValue( sal_Bool bVal ); 75 76 virtual int operator==( const SfxPoolItem& ) const; 77 operator =(const SvxTextLineItem & rTextLine)78 inline SvxTextLineItem& operator=(const SvxTextLineItem& rTextLine) 79 { 80 SetValue( rTextLine.GetValue() ); 81 SetColor( rTextLine.GetColor() ); 82 return *this; 83 } 84 SvxTextLineItem(const SvxTextLineItem&) = default; 85 86 // enum cast GetLineStyle() const87 FontUnderline GetLineStyle() const 88 { return (FontUnderline)GetValue(); } SetLineStyle(FontUnderline eNew)89 void SetLineStyle( FontUnderline eNew ) 90 { SetValue((sal_uInt16) eNew); } 91 GetColor() const92 const Color& GetColor() const { return mColor; } SetColor(const Color & rCol)93 void SetColor( const Color& rCol ) { mColor = rCol; } 94 }; 95 96 // class SvxUnderlineItem ------------------------------------------------ 97 98 /* Value container for underline font effects */ 99 100 class EDITENG_DLLPUBLIC SvxUnderlineItem : public SvxTextLineItem 101 { 102 public: 103 TYPEINFO(); 104 105 SvxUnderlineItem( const FontUnderline eSt, 106 const sal_uInt16 nId ); 107 108 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; 109 virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const; 110 virtual String GetValueTextByPos( sal_uInt16 nPos ) const; 111 }; 112 113 // class SvxOverlineItem ------------------------------------------------ 114 115 /* Value container for overline font effects */ 116 117 class EDITENG_DLLPUBLIC SvxOverlineItem : public SvxTextLineItem 118 { 119 public: 120 TYPEINFO(); 121 122 SvxOverlineItem( const FontUnderline eSt, 123 const sal_uInt16 nId ); 124 125 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; 126 virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const; 127 virtual String GetValueTextByPos( sal_uInt16 nPos ) const; 128 }; 129 130 #endif // #ifndef _SVX_UDLNITEM_HXX 131