Coverage Report

Created: 2025-12-08 09:28

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/chart2/source/controller/inc/dlg_ObjectProperties.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 <ObjectIdentifier.hxx>
22
#include <sfx2/tabdlg.hxx>
23
#include <vcl/graph.hxx>
24
25
class SvNumberFormatter;
26
27
namespace com::sun::star::util { class XNumberFormatsSupplier; }
28
29
namespace chart
30
{
31
32
class ObjectPropertiesDialogParameter final
33
{
34
public:
35
    ObjectPropertiesDialogParameter( OUString aObjectCID );
36
    ~ObjectPropertiesDialogParameter();
37
38
    void            init( const rtl::Reference<::chart::ChartModel>& xModel );
39
0
    ObjectType      getObjectType() const { return m_eObjectType;}
40
0
    const OUString& getLocalizedName() const { return m_aLocalizedName;}
41
42
0
    bool HasGeometryProperties() const { return m_bHasGeometryProperties;}
43
0
    bool HasStatisticProperties() const { return m_bHasStatisticProperties;}
44
0
    bool ProvidesSecondaryYAxis() const { return m_bProvidesSecondaryYAxis;}
45
0
    bool ProvidesOverlapAndGapWidth() const { return m_bProvidesOverlapAndGapWidth;}
46
0
    bool ProvidesBarConnectors() const { return m_bProvidesBarConnectors;}
47
0
    bool HasAreaProperties() const { return m_bHasAreaProperties;}
48
0
    bool HasSymbolProperties() const { return m_bHasSymbolProperties;}
49
0
    bool HasNumberProperties() const { return m_bHasNumberProperties;}
50
0
    bool ProvidesStartingAngle() const { return m_bProvidesStartingAngle;}
51
0
    bool ProvidesMissingValueTreatments() const { return m_bProvidesMissingValueTreatments;}
52
0
    bool IsPieChartDataPoint() const { return m_bIsPieChartDataPoint;}
53
54
0
    bool HasScaleProperties() const { return m_bHasScaleProperties;}
55
0
    bool CanAxisLabelsBeStaggered() const { return m_bCanAxisLabelsBeStaggered;}
56
0
    bool IsSupportingAxisPositioning() const { return m_bSupportingAxisPositioning;}
57
0
    bool ShowAxisOrigin() const { return m_bShowAxisOrigin;}
58
0
    bool IsCrossingAxisIsCategoryAxis() const { return m_bIsCrossingAxisIsCategoryAxis;}
59
0
    bool IsSupportingCategoryPositioning() const { return m_bSupportingCategoryPositioning;}
60
0
    const css::uno::Sequence< OUString >& GetCategories() const { return m_aCategories;}
61
62
    const rtl::Reference<::chart::ChartModel>&
63
0
        getDocument() const { return m_xChartDocument;}
64
65
0
    bool IsComplexCategoriesAxis() const { return m_bComplexCategoriesAxis;}
66
67
0
    sal_Int32 getNbPoints() const { return m_nNbPoints;}
68
69
private:
70
    OUString   m_aObjectCID;
71
    ObjectType      m_eObjectType;
72
    bool m_bAffectsMultipleObjects;//is true if more than one object of the given type will be changed (e.g. all axes or all titles)
73
74
    OUString   m_aLocalizedName;
75
76
    bool m_bHasGeometryProperties;
77
    bool m_bHasStatisticProperties;
78
    bool m_bProvidesSecondaryYAxis;
79
    bool m_bProvidesOverlapAndGapWidth;
80
    bool m_bProvidesBarConnectors;
81
    bool m_bHasAreaProperties;
82
    bool m_bHasSymbolProperties;
83
    bool m_bHasNumberProperties;
84
    bool m_bProvidesStartingAngle;
85
    bool m_bProvidesMissingValueTreatments;
86
    bool m_bIsPieChartDataPoint;
87
88
    bool m_bHasScaleProperties;
89
    bool m_bCanAxisLabelsBeStaggered;
90
91
    bool m_bSupportingAxisPositioning;
92
    bool m_bShowAxisOrigin;
93
    bool m_bIsCrossingAxisIsCategoryAxis;
94
    bool m_bSupportingCategoryPositioning;
95
    css::uno::Sequence< OUString > m_aCategories;
96
97
    rtl::Reference<::chart::ChartModel> m_xChartDocument;
98
99
    bool m_bComplexCategoriesAxis;
100
101
    sal_Int32 m_nNbPoints;
102
};
103
104
/*************************************************************************
105
|*
106
|* dialog for properties of different chart object
107
|*
108
\************************************************************************/
109
110
class ViewElementListProvider;
111
112
class SchAttribTabDlg final : public SfxTabDialogController
113
{
114
private:
115
    const ObjectPropertiesDialogParameter& m_rParameter;
116
    const ViewElementListProvider* const                 m_pViewElementListProvider;
117
    SvNumberFormatter* m_pNumberFormatter;
118
119
    std::optional<SfxItemSet>     m_oSymbolShapeProperties;
120
    std::optional<Graphic>        m_oAutoSymbolGraphic;
121
122
    double          m_fAxisMinorStepWidthForErrorBarDecimals;
123
    bool            m_bOKPressed;
124
125
    DECL_LINK(OKPressed, weld::Button&, void);
126
127
    virtual void PageCreated(const OUString& rId, SfxTabPage& rPage) override;
128
129
public:
130
    SchAttribTabDlg(weld::Window* pParent, const SfxItemSet* pAttr,
131
                    const ObjectPropertiesDialogParameter& rDialogParameter,
132
                    const ViewElementListProvider* pViewElementListProvider,
133
                    const css::uno::Reference< css::util::XNumberFormatsSupplier >& xNumberFormatsSupplier );
134
    virtual ~SchAttribTabDlg() override;
135
136
    //pSymbolShapeProperties: Properties to be set on the symbollist shapes
137
    //pAutoSymbolGraphic: Graphic to be shown if AutoSymbol gets selected
138
    void setSymbolInformation( SfxItemSet&& rSymbolShapeProperties, std::optional<Graphic> oAutoSymbolGraphic );
139
140
    void SetAxisMinorStepWidthForErrorBarDecimals( double fMinorStepWidth );
141
142
0
    bool DialogWasClosedWithOK() const { return m_bOKPressed;}
143
};
144
145
} //namespace chart
146
147
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */