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 .
21 #include <editeng/editengdllapi.h>
22 #include <svl/eitem.hxx>
23 #include <tools/color.hxx>
24 #include <tools/fontenum.hxx>
25 #include <docmodel/color/ComplexColor.hxx>
27 // class SvxTextLineItem ------------------------------------------------
29 /* Value container for underline and overline font effects */
31 class EDITENG_DLLPUBLIC SvxTextLineItem
: public SfxEnumItem
<FontLineStyle
>
34 model::ComplexColor maComplexColor
;
37 SvxTextLineItem( const FontLineStyle eSt
,
38 const sal_uInt16 nId
);
40 // "pure virtual Methods" from SfxPoolItem
41 virtual bool GetPresentation( SfxItemPresentation ePres
,
44 OUString
&rText
, const IntlWrapper
& ) const override
;
46 virtual SvxTextLineItem
* Clone( SfxItemPool
*pPool
= nullptr ) const override
;
47 virtual OUString
GetValueTextByPos( sal_uInt16 nPos
) const;
48 virtual sal_uInt16
GetValueCount() const override
;
50 virtual bool QueryValue( css::uno::Any
& rVal
, sal_uInt8 nMemberId
= 0 ) const override
;
51 virtual bool PutValue( const css::uno::Any
& rVal
, sal_uInt8 nMemberId
) override
;
53 using SfxEnumItem::SetValue
;
54 virtual bool HasBoolValue() const override
;
55 virtual bool GetBoolValue() const override
;
56 virtual void SetBoolValue( bool bVal
) override
;
58 virtual bool operator==( const SfxPoolItem
& ) const override
;
61 FontLineStyle
GetLineStyle() const
62 { return GetValue(); }
63 void SetLineStyle( FontLineStyle eNew
)
66 const Color
& GetColor() const { return maColor
; }
67 void SetColor(const Color
& rColor
) { maColor
= rColor
; }
69 const model::ComplexColor
& getComplexColor() const
71 return maComplexColor
;
74 void setComplexColor(model::ComplexColor
const& rComplexColor
)
76 maComplexColor
= rComplexColor
;
80 // class SvxUnderlineItem ------------------------------------------------
82 /* Value container for underline font effects */
84 class EDITENG_DLLPUBLIC SvxUnderlineItem final
: public SvxTextLineItem
87 static SfxPoolItem
* CreateDefault();
89 SvxUnderlineItem( const FontLineStyle eSt
,
90 const sal_uInt16 nId
);
92 virtual SvxUnderlineItem
* Clone( SfxItemPool
*pPool
= nullptr ) const override
;
93 virtual OUString
GetValueTextByPos( sal_uInt16 nPos
) const override
;
96 // class SvxOverlineItem ------------------------------------------------
98 /* Value container for overline font effects */
100 class EDITENG_DLLPUBLIC SvxOverlineItem final
: public SvxTextLineItem
103 static SfxPoolItem
* CreateDefault();
105 SvxOverlineItem( const FontLineStyle eSt
,
106 const sal_uInt16 nId
);
108 virtual SvxOverlineItem
* Clone( SfxItemPool
*pPool
= nullptr ) const override
;
109 virtual OUString
GetValueTextByPos( sal_uInt16 nPos
) const override
;
112 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */