Coverage Report

Created: 2026-02-14 09:37

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/include/svx/chrtitem.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
#ifndef INCLUDED_SVX_CHRTITEM_HXX
20
#define INCLUDED_SVX_CHRTITEM_HXX
21
22
#include <config_options.h>
23
#include <rtl/ustring.hxx>
24
#include <sal/types.h>
25
#include <svl/eitem.hxx>
26
#include <svl/poolitem.hxx>
27
#include <svx/svxdllapi.h>
28
29
enum class ChartColorPaletteType: sal_uInt8;
30
31
enum class SvxChartTextOrder
32
{
33
    SideBySide,
34
    UpDown,
35
    DownUp,
36
    Auto
37
};
38
39
#define CHTXTORDER_COUNT    (sal_uInt16(SvxChartTextOrder::Auto) + 1)
40
41
enum class SvxChartKindError
42
{
43
    NONE,
44
    Variant,
45
    Sigma,
46
    Percent,
47
    BigError,
48
    Const,
49
    StdError,
50
    Range
51
};
52
53
#define CHERROR_COUNT   (sal_uInt16(SvxChartKindError::Range) + 1)
54
55
enum class SvxChartIndicate
56
{
57
    NONE,
58
    Both,
59
    Up,
60
    Down
61
};
62
63
#define CHINDICATE_COUNT    (sal_uInt16(SvxChartIndicate::Down) + 1)
64
65
enum class SvxChartRegress
66
{
67
    NONE,
68
    Linear,
69
    Log,
70
    Exp,
71
    Power,
72
    Polynomial,
73
    MovingAverage,
74
    MeanValue,
75
    Unknown
76
};
77
78
#define CHREGRESS_COUNT (sal_uInt16(SvxChartRegress::Unknown) + 1)
79
80
class SAL_WARN_UNUSED UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) SvxChartRegressItem final : public SfxEnumItem<SvxChartRegress>
81
{
82
public:
83
    DECLARE_ITEM_TYPE_FUNCTION(SvxChartRegressItem)
84
    SvxChartRegressItem(SvxChartRegress eRegress /*= SvxChartRegress::Linear*/,
85
                        TypedWhichId<SvxChartRegressItem> nId );
86
87
    virtual SvxChartRegressItem* Clone(SfxItemPool* pPool = nullptr) const override;
88
};
89
90
class SAL_WARN_UNUSED UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) SvxChartTextOrderItem final : public SfxEnumItem<SvxChartTextOrder>
91
{
92
public:
93
    DECLARE_ITEM_TYPE_FUNCTION(SvxChartTextOrderItem)
94
    SvxChartTextOrderItem(SvxChartTextOrder eOrder /*= SvxChartTextOrder::SideBySide*/,
95
                          TypedWhichId<SvxChartTextOrderItem> nId );
96
97
    virtual SvxChartTextOrderItem* Clone(SfxItemPool* pPool = nullptr) const override;
98
99
    virtual bool         QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
100
    virtual bool         PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
101
};
102
103
class SAL_WARN_UNUSED UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) SvxChartKindErrorItem final : public SfxEnumItem<SvxChartKindError>
104
{
105
public:
106
    DECLARE_ITEM_TYPE_FUNCTION(SvxChartKindErrorItem)
107
    SvxChartKindErrorItem(SvxChartKindError /*eOrient = SvxChartKindError::NONE*/,
108
                           TypedWhichId<SvxChartKindErrorItem> nId );
109
110
    virtual SvxChartKindErrorItem* Clone(SfxItemPool* pPool = nullptr) const override;
111
};
112
113
class SAL_WARN_UNUSED UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) SvxChartIndicateItem final : public SfxEnumItem<SvxChartIndicate>
114
{
115
public:
116
    DECLARE_ITEM_TYPE_FUNCTION(SvxChartIndicateItem)
117
    SvxChartIndicateItem(SvxChartIndicate eOrient /*= SvxChartIndicate::NONE*/,
118
                           TypedWhichId<SvxChartIndicateItem> nId );
119
120
    virtual SvxChartIndicateItem* Clone(SfxItemPool* pPool = nullptr) const override;
121
};
122
123
class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC SvxDoubleItem final : public SfxPoolItem
124
{
125
    double m_fVal;
126
127
public:
128
    static SfxPoolItem* CreateDefault();
129
    DECLARE_ITEM_TYPE_FUNCTION(SvxDoubleItem)
130
    SvxDoubleItem(double fValue /*= 0.0*/, TypedWhichId<SvxDoubleItem> nId );
131
    SvxDoubleItem(const SvxDoubleItem& rItem);
132
133
    virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
134
    virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
135
136
    virtual bool GetPresentation(SfxItemPresentation ePres,
137
                                 MapUnit eCoreMetric,
138
                                 MapUnit ePresMetric,
139
                                 OUString &rText, const IntlWrapper&) const override;
140
141
    virtual bool             operator == (const SfxPoolItem&) const override;
142
    virtual SvxDoubleItem* Clone(SfxItemPool *pPool = nullptr) const override;
143
144
0
    double GetValue() const { return m_fVal; }
145
};
146
147
// This SfxPoolItem is used to represent a chart color palette.
148
// A chart color palette is uniquely determined by its type and an index.
149
// Chart color palettes depends on current color theme and are generated by ChartColorPaletteHelper.
150
class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC SvxChartColorPaletteItem final : public SfxPoolItem
151
{
152
    ChartColorPaletteType meType;
153
    sal_uInt32 mnIndex;
154
155
public:
156
    DECLARE_ITEM_TYPE_FUNCTION(SvxChartColorPaletteItem);
157
    SvxChartColorPaletteItem(ChartColorPaletteType eType, sal_uInt32 nIndex,
158
                             TypedWhichId<SvxChartColorPaletteItem> nId);
159
    SvxChartColorPaletteItem(const SvxChartColorPaletteItem& rItem);
160
161
    virtual bool QueryValue(css::uno::Any& rVal, sal_uInt8 nMemberId = 0) const override;
162
    virtual bool PutValue(const css::uno::Any& rVal, sal_uInt8 nMemberId) override;
163
164
    virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric,
165
                                 MapUnit ePresMetric, OUString& rText,
166
                                 const IntlWrapper&) const override;
167
168
    virtual bool operator==(const SfxPoolItem& rItem) const override;
169
    virtual SvxChartColorPaletteItem* Clone(SfxItemPool* pPool = nullptr) const override;
170
171
0
    ChartColorPaletteType GetType() const { return meType; }
172
0
    sal_uInt32 GetIndex() const { return mnIndex; }
173
};
174
175
#endif // INCLUDED_SVX_CHRTITEM_HXX
176
177
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */