1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_EDITENG_UDLNITEM_HXX
20 #define INCLUDED_EDITENG_UDLNITEM_HXX
22 #include <svl/eitem.hxx>
23 #include <tools/color.hxx>
24 #include <tools/fontenum.hxx>
25 #include <editeng/editengdllapi.h>
27 // class SvxTextLineItem ------------------------------------------------
29 /* Value container for underline and overline font effects */
31 class EDITENG_DLLPUBLIC SvxTextLineItem
: public SfxEnumItem
<FontLineStyle
>
35 SvxTextLineItem( const FontLineStyle eSt
,
36 const sal_uInt16 nId
);
38 // "pure virtual Methods" from SfxPoolItem
39 virtual bool GetPresentation( SfxItemPresentation ePres
,
42 OUString
&rText
, const IntlWrapper
& ) const override
;
44 virtual SvxTextLineItem
* Clone( SfxItemPool
*pPool
= nullptr ) const override
;
45 virtual OUString
GetValueTextByPos( sal_uInt16 nPos
) const;
46 virtual sal_uInt16
GetValueCount() const override
;
48 virtual bool QueryValue( css::uno::Any
& rVal
, sal_uInt8 nMemberId
= 0 ) const override
;
49 virtual bool PutValue( const css::uno::Any
& rVal
, sal_uInt8 nMemberId
) override
;
51 using SfxEnumItem::SetValue
;
52 virtual bool HasBoolValue() const override
;
53 virtual bool GetBoolValue() const override
;
54 virtual void SetBoolValue( bool bVal
) override
;
56 virtual bool operator==( const SfxPoolItem
& ) const override
;
59 FontLineStyle
GetLineStyle() const
60 { return GetValue(); }
61 void SetLineStyle( FontLineStyle eNew
)
64 const Color
& GetColor() const { return mColor
; }
65 void SetColor( const Color
& rCol
) { mColor
= rCol
; }
68 // class SvxUnderlineItem ------------------------------------------------
70 /* Value container for underline font effects */
72 class EDITENG_DLLPUBLIC SvxUnderlineItem final
: public SvxTextLineItem
75 static SfxPoolItem
* CreateDefault();
77 SvxUnderlineItem( const FontLineStyle eSt
,
78 const sal_uInt16 nId
);
80 virtual SvxUnderlineItem
* Clone( SfxItemPool
*pPool
= nullptr ) const override
;
81 virtual OUString
GetValueTextByPos( sal_uInt16 nPos
) const override
;
84 // class SvxOverlineItem ------------------------------------------------
86 /* Value container for overline font effects */
88 class EDITENG_DLLPUBLIC SvxOverlineItem final
: public SvxTextLineItem
91 static SfxPoolItem
* CreateDefault();
93 SvxOverlineItem( const FontLineStyle eSt
,
94 const sal_uInt16 nId
);
96 virtual SvxOverlineItem
* Clone( SfxItemPool
*pPool
= nullptr ) const override
;
97 virtual OUString
GetValueTextByPos( sal_uInt16 nPos
) const override
;
100 #endif // INCLUDED_EDITENG_UDLNITEM_HXX
102 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */