Coverage Report

Created: 2026-07-10 11:04

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/include/editeng/udlnitem.hxx
Line
Count
Source
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/*
3
 * This file is part of the LibreOffice project.
4
 *
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/.
8
 *
9
 * This file incorporates work covered by the following license notice:
10
 *
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 .
18
 */
19
#pragma once
20
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>
26
27
// class SvxTextLineItem ------------------------------------------------
28
29
/* Value container for underline and overline font effects */
30
31
class EDITENG_DLLPUBLIC SvxTextLineItem : public SfxEnumItem<FontLineStyle>
32
{
33
    Color maColor;
34
    model::ComplexColor maComplexColor;
35
36
public:
37
    DECLARE_ITEM_TYPE_FUNCTION(SvxTextLineItem)
38
    SvxTextLineItem( const FontLineStyle eSt,
39
                     const sal_uInt16 nId);
40
41
    // "pure virtual Methods" from SfxPoolItem
42
    virtual bool GetPresentation( SfxItemPresentation ePres,
43
                                  MapUnit eCoreMetric,
44
                                  MapUnit ePresMetric,
45
                                  OUString &rText, const IntlWrapper& ) const override;
46
47
    virtual SvxTextLineItem* Clone( SfxItemPool *pPool = nullptr ) const override;
48
    virtual OUString        GetValueTextByPos( sal_uInt16 nPos ) const;
49
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;
52
53
    using SfxEnumItem::SetValue;
54
    virtual bool            HasBoolValue() const override;
55
    virtual bool            GetBoolValue() const override;
56
    virtual void            SetBoolValue( bool bVal ) override;
57
58
    virtual bool            operator==( const SfxPoolItem& ) const override;
59
60
    // enum cast
61
    FontLineStyle           GetLineStyle() const
62
28.1M
                                { return GetValue(); }
63
    void                    SetLineStyle( FontLineStyle eNew )
64
1.08k
    {
65
1.08k
        ASSERT_CHANGE_REFCOUNTED_ITEM;
66
1.08k
        SetValue(eNew);
67
1.08k
    }
68
69
138k
    const Color& GetColor() const { return maColor; }
70
2.77k
    void SetColor(const Color& rColor) { maColor = rColor; }
71
72
    const model::ComplexColor& getComplexColor() const
73
0
    {
74
0
        return maComplexColor;
75
0
    }
76
77
    void setComplexColor(model::ComplexColor const& rComplexColor)
78
0
    {
79
0
        ASSERT_CHANGE_REFCOUNTED_ITEM;
80
0
        maComplexColor = rComplexColor;
81
0
    }
82
};
83
84
// class SvxUnderlineItem ------------------------------------------------
85
86
/* Value container for underline font effects */
87
88
class EDITENG_DLLPUBLIC SvxUnderlineItem final : public SvxTextLineItem
89
{
90
protected:
91
    virtual ItemInstanceManager* getItemInstanceManager() const override;
92
93
public:
94
    static SfxPoolItem* CreateDefault();
95
96
    DECLARE_ITEM_TYPE_FUNCTION(SvxUnderlineItem)
97
    SvxUnderlineItem( const FontLineStyle eSt,
98
                      const sal_uInt16 nId );
99
100
    virtual SvxUnderlineItem* Clone( SfxItemPool *pPool = nullptr ) const override;
101
    virtual OUString   GetValueTextByPos( sal_uInt16 nPos ) const override;
102
};
103
104
// class SvxOverlineItem ------------------------------------------------
105
106
/* Value container for overline font effects */
107
108
class EDITENG_DLLPUBLIC SvxOverlineItem final : public SvxTextLineItem
109
{
110
protected:
111
    virtual ItemInstanceManager* getItemInstanceManager() const override;
112
113
public:
114
    static SfxPoolItem* CreateDefault();
115
116
    DECLARE_ITEM_TYPE_FUNCTION(SvxOverlineItem)
117
    SvxOverlineItem( const FontLineStyle eSt,
118
                     const sal_uInt16 nId );
119
120
    virtual SvxOverlineItem* Clone( SfxItemPool *pPool = nullptr ) const override;
121
    virtual OUString   GetValueTextByPos( sal_uInt16 nPos ) const override;
122
};
123
124
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */