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 <ObjectIdentifier.hxx>
22 #include <sfx2/tabdlg.hxx>
23 #include <vcl/graph.hxx>
25 namespace com::sun::star::util
{ class XNumberFormatsSupplier
; }
30 class ObjectPropertiesDialogParameter final
33 ObjectPropertiesDialogParameter( OUString aObjectCID
);
34 ~ObjectPropertiesDialogParameter();
36 void init( const rtl::Reference
<::chart::ChartModel
>& xModel
);
37 ObjectType
getObjectType() const { return m_eObjectType
;}
38 const OUString
& getLocalizedName() const { return m_aLocalizedName
;}
40 bool HasGeometryProperties() const { return m_bHasGeometryProperties
;}
41 bool HasStatisticProperties() const { return m_bHasStatisticProperties
;}
42 bool ProvidesSecondaryYAxis() const { return m_bProvidesSecondaryYAxis
;}
43 bool ProvidesOverlapAndGapWidth() const { return m_bProvidesOverlapAndGapWidth
;}
44 bool ProvidesBarConnectors() const { return m_bProvidesBarConnectors
;}
45 bool HasAreaProperties() const { return m_bHasAreaProperties
;}
46 bool HasSymbolProperties() const { return m_bHasSymbolProperties
;}
47 bool HasNumberProperties() const { return m_bHasNumberProperties
;}
48 bool ProvidesStartingAngle() const { return m_bProvidesStartingAngle
;}
49 bool ProvidesMissingValueTreatments() const { return m_bProvidesMissingValueTreatments
;}
50 bool IsPieChartDataPoint() const { return m_bIsPieChartDataPoint
;}
52 bool HasScaleProperties() const { return m_bHasScaleProperties
;}
53 bool CanAxisLabelsBeStaggered() const { return m_bCanAxisLabelsBeStaggered
;}
54 bool IsSupportingAxisPositioning() const { return m_bSupportingAxisPositioning
;}
55 bool ShowAxisOrigin() const { return m_bShowAxisOrigin
;}
56 bool IsCrossingAxisIsCategoryAxis() const { return m_bIsCrossingAxisIsCategoryAxis
;}
57 bool IsSupportingCategoryPositioning() const { return m_bSupportingCategoryPositioning
;}
58 const css::uno::Sequence
< OUString
>& GetCategories() const { return m_aCategories
;}
60 const rtl::Reference
<::chart::ChartModel
>&
61 getDocument() const { return m_xChartDocument
;}
63 bool IsComplexCategoriesAxis() const { return m_bComplexCategoriesAxis
;}
65 sal_Int32
getNbPoints() const { return m_nNbPoints
;}
68 OUString m_aObjectCID
;
69 ObjectType m_eObjectType
;
70 bool m_bAffectsMultipleObjects
;//is true if more than one object of the given type will be changed (e.g. all axes or all titles)
72 OUString m_aLocalizedName
;
74 bool m_bHasGeometryProperties
;
75 bool m_bHasStatisticProperties
;
76 bool m_bProvidesSecondaryYAxis
;
77 bool m_bProvidesOverlapAndGapWidth
;
78 bool m_bProvidesBarConnectors
;
79 bool m_bHasAreaProperties
;
80 bool m_bHasSymbolProperties
;
81 bool m_bHasNumberProperties
;
82 bool m_bProvidesStartingAngle
;
83 bool m_bProvidesMissingValueTreatments
;
84 bool m_bIsPieChartDataPoint
;
86 bool m_bHasScaleProperties
;
87 bool m_bCanAxisLabelsBeStaggered
;
89 bool m_bSupportingAxisPositioning
;
90 bool m_bShowAxisOrigin
;
91 bool m_bIsCrossingAxisIsCategoryAxis
;
92 bool m_bSupportingCategoryPositioning
;
93 css::uno::Sequence
< OUString
> m_aCategories
;
95 rtl::Reference
<::chart::ChartModel
> m_xChartDocument
;
97 bool m_bComplexCategoriesAxis
;
99 sal_Int32 m_nNbPoints
;
102 /*************************************************************************
104 |* dialog for properties of different chart object
106 \************************************************************************/
108 class ViewElementListProvider
;
110 class SchAttribTabDlg final
: public SfxTabDialogController
113 const ObjectPropertiesDialogParameter
* const m_pParameter
;
114 const ViewElementListProvider
* const m_pViewElementListProvider
;
115 SvNumberFormatter
* m_pNumberFormatter
;
117 std::optional
<SfxItemSet
> m_oSymbolShapeProperties
;
118 std::optional
<Graphic
> m_oAutoSymbolGraphic
;
120 double m_fAxisMinorStepWidthForErrorBarDecimals
;
123 DECL_LINK(OKPressed
, weld::Button
&, void);
125 virtual void PageCreated(const OUString
& rId
, SfxTabPage
& rPage
) override
;
128 SchAttribTabDlg(weld::Window
* pParent
, const SfxItemSet
* pAttr
,
129 const ObjectPropertiesDialogParameter
* pDialogParameter
,
130 const ViewElementListProvider
* pViewElementListProvider
,
131 const css::uno::Reference
< css::util::XNumberFormatsSupplier
>& xNumberFormatsSupplier
);
132 virtual ~SchAttribTabDlg() override
;
134 //pSymbolShapeProperties: Properties to be set on the symbollist shapes
135 //pAutoSymbolGraphic: Graphic to be shown if AutoSymbol gets selected
136 void setSymbolInformation( SfxItemSet
&& rSymbolShapeProperties
, std::optional
<Graphic
> oAutoSymbolGraphic
);
138 void SetAxisMinorStepWidthForErrorBarDecimals( double fMinorStepWidth
);
140 bool DialogWasClosedWithOK() const { return m_bOKPressed
;}
145 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */