LibreOffice Module chart2 (master) 1
Diagram.hxx
Go to the documentation of this file.
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 "OPropertySet.hxx"
23#include <comphelper/uno3.hxx>
24#include <com/sun/star/chart2/XDiagram.hpp>
25#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
26#include <com/sun/star/chart2/XTitled.hpp>
27#include <com/sun/star/chart/X3DDefaultSetter.hpp>
28#include <com/sun/star/util/XCloneable.hpp>
29#include <com/sun/star/lang/XServiceInfo.hpp>
31#include "charttoolsdllapi.hxx"
32
33#include <vector>
34
35namespace com::sun::star::beans { struct PropertyValue; }
36namespace com::sun::star::chart2 { class XDataSeries; }
37namespace com::sun::star::chart2::data { class XDataSource; }
38namespace com::sun::star::uno { class XComponentContext; }
39
40namespace chart
41{
42class Axis;
43class BaseCoordinateSystem;
44class ChartType;
45class ChartTypeManager;
46class ChartTypeTemplate;
47class DataSeries;
48class Legend;
49class DataTable;
50class RegressionCurveModel;
51enum class StackMode;
52class Wall;
53enum class ThreeDLookScheme;
54
56{
58};
59
60
61namespace impl
62{
63typedef ::cppu::WeakImplHelper<
64 css::chart2::XDiagram,
65 css::lang::XServiceInfo,
66 css::chart2::XCoordinateSystemContainer,
67 css::chart2::XTitled,
68 css::chart::X3DDefaultSetter,
69 css::util::XModifyBroadcaster,
70 css::util::XModifyListener,
71 css::util::XCloneable >
73}
74
76#if !defined __GNUC__ || __GNUC__ >= 12 || defined __clang__
77 final
78#endif
79 : public impl::Diagram_Base
80 , public ::property::OPropertySet
81{
82public:
83 Diagram( css::uno::Reference< css::uno::XComponentContext > xContext );
84 virtual ~Diagram() override;
85
87 virtual OUString SAL_CALL getImplementationName() override;
88 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
89 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
90
94 DECLARE_XTYPEPROVIDER()
95
96 explicit Diagram( const Diagram & rOther );
97
98 // ____ OPropertySet ____
99 virtual void GetDefaultValue( sal_Int32 nHandle, css::uno::Any& rAny ) const override;
100
101 // ____ OPropertySet ____
102 virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
103
104 // ____ XPropertySet ____
105 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
106 getPropertySetInfo() override;
107
108 // ____ XFastPropertySet ____
109 virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const css::uno::Any& rValue ) override;
110
112 using ::com::sun::star::beans::XFastPropertySet::getFastPropertyValue;
113
114 virtual void SAL_CALL getFastPropertyValue(
115 css::uno::Any& rValue, sal_Int32 nHandle ) const override;
116
117 // ____ XDiagram ____
118 virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getWall() override;
119 virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getFloor() override;
120 virtual css::uno::Reference< css::chart2::XLegend > SAL_CALL getLegend() override;
121 virtual void SAL_CALL setLegend( const css::uno::Reference<
122 css::chart2::XLegend >& xLegend ) override;
123 virtual css::uno::Reference< css::chart2::XColorScheme > SAL_CALL getDefaultColorScheme() override;
124 virtual void SAL_CALL setDefaultColorScheme(
125 const css::uno::Reference< css::chart2::XColorScheme >& xColorScheme ) override;
126 virtual void SAL_CALL setDiagramData(
127 const css::uno::Reference< css::chart2::data::XDataSource >& xDataSource,
128 const css::uno::Sequence< css::beans::PropertyValue >& aArguments ) override;
129
130 virtual css::uno::Reference<css::chart2::XDataTable> SAL_CALL getDataTable() override;
131 virtual void SAL_CALL setDataTable(const css::uno::Reference<css::chart2::XDataTable>& xDataTable) override;
132
133 // ____ XCoordinateSystemContainer ____
134 virtual void SAL_CALL addCoordinateSystem(
135 const css::uno::Reference< css::chart2::XCoordinateSystem >& aCoordSys ) override;
136 virtual void SAL_CALL removeCoordinateSystem(
137 const css::uno::Reference< css::chart2::XCoordinateSystem >& aCoordSys ) override;
138 virtual css::uno::Sequence< css::uno::Reference< css::chart2::XCoordinateSystem > > SAL_CALL getCoordinateSystems() override;
139 virtual void SAL_CALL setCoordinateSystems(
140 const css::uno::Sequence< css::uno::Reference< css::chart2::XCoordinateSystem > >& aCoordinateSystems ) override;
141
142 // ____ XTitled ____
143 virtual css::uno::Reference<
144 css::chart2::XTitle > SAL_CALL getTitleObject() override;
145 virtual void SAL_CALL setTitleObject( const css::uno::Reference<
146 css::chart2::XTitle >& Title ) override;
147
148 // ____ X3DDefaultSetter ____
149 virtual void SAL_CALL set3DSettingsToDefault() override;
150 virtual void SAL_CALL setDefaultRotation() override;
151 virtual void SAL_CALL setDefaultIllumination() override;
152
153 // ____ XCloneable ____
154 virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override;
155
156 // ____ XModifyBroadcaster ____
157 virtual void SAL_CALL addModifyListener(
158 const css::uno::Reference< css::util::XModifyListener >& aListener ) override;
159 virtual void SAL_CALL removeModifyListener(
160 const css::uno::Reference< css::util::XModifyListener >& aListener ) override;
161
162 typedef
163 std::vector< rtl::Reference< ::chart::BaseCoordinateSystem > >
165
166 tCoordinateSystemContainerType getBaseCoordinateSystems() const;
167 void setCoordinateSystems(
168 const std::vector< rtl::Reference< ::chart::BaseCoordinateSystem > >& aCoordinateSystems );
169
170 rtl::Reference< ::chart::Legend > getLegend2() const;
171 void setLegend(const rtl::Reference< ::chart::Legend > &);
172
173 void setDataTable(const rtl::Reference<::chart::DataTable>& xNewDataTable);
174 rtl::Reference<::chart::DataTable> getDataTableRef() const;
175
176 DiagramPositioningMode getDiagramPositioningMode();
177
178 //returns integer from constant group css::chart::MissingValueTreatment
179 sal_Int32 getCorrectedMissingValueTreatment(
180 const rtl::Reference< ::chart::ChartType >& xChartType );
181
182 void setGeometry3D( sal_Int32 nNewGeometry );
183
184 sal_Int32 getGeometry3D( bool& rbFound, bool& rbAmbiguous );
185
186 bool isPieOrDonutChart();
187
188 bool isSupportingFloorAndWall();
189
205 bool moveSeries(
206 const rtl::Reference< DataSeries >& xGivenDataSeries,
207 bool bForward );
208
224 bool isSeriesMoveable(
225 const rtl::Reference< DataSeries >& xGivenDataSeries,
226 bool bForward );
227
228 std::vector< rtl::Reference< ChartType > > getChartTypes();
229
230 rtl::Reference< ChartType > getChartTypeByIndex( sal_Int32 nIndex );
231
232 bool isSupportingDateAxis();
233
234 css::uno::Reference< css::chart2::data::XLabeledDataSequence >
235 getCategories();
236
237 void setCategories(
238 const css::uno::Reference< css::chart2::data::XLabeledDataSequence >& xCategories,
239 bool bSetAxisType = false, // when this flag is true ...
240 bool bCategoryAxis = true);// set the AxisType to CATEGORY or back to REALNUMBER
241
242 bool isCategory();
243
246 std::vector<
247 std::vector<
248 rtl::Reference< ::chart::DataSeries > > >
249 getDataSeriesGroups();
250
251 std::vector< rtl::Reference< ::chart::DataSeries > >
252 getDataSeries();
253
255 getChartTypeOfSeries( const rtl::Reference< DataSeries >& xSeries );
256
257 rtl::Reference< ::chart::Axis > getAttachedAxis(
258 const rtl::Reference< ::chart::DataSeries >& xSeries );
259
260 bool attachSeriesToAxis( bool bMainAxis,
261 const rtl::Reference< DataSeries >& xSeries,
262 const css::uno::Reference< css::uno::XComponentContext > & xContext,
263 bool bAdaptAxes=true );
264
268 SAL_DLLPRIVATE void replaceCoordinateSystem(
269 const rtl::Reference< ::chart::BaseCoordinateSystem > & xCooSysToReplace,
270 const rtl::Reference< ::chart::BaseCoordinateSystem > & xReplacement );
271
272
276 sal_Int32 getDimension();
277
285 void setDimension( sal_Int32 nNewDimensionCount );
286
287
288 StackMode getStackMode(bool& rbFound, bool& rbAmbiguous);
289
296 void setStackMode(StackMode eStackMode);
297
298
304 void setVertical( bool bVertical );
305
311 bool getVertical( bool& rbOutFoundResult, bool& rbOutAmbiguousResult );
312
315 OUString sServiceName;
316 };
317
327 getTemplate(const rtl::Reference< ::chart::ChartTypeManager > & xChartTypeManager);
328
329 std::vector<rtl::Reference<::chart::RegressionCurveModel> >
330 getAllRegressionCurvesNotMeanValueLine();
331
332 double getCameraDistance();
333 void setCameraDistance( double fCameraDistance );
334
335 void getRotation(
336 sal_Int32& rnHorizontalAngleDegree, sal_Int32& rnVerticalAngleDegree );
337 void setRotation(
338 sal_Int32 nHorizontalAngleDegree, sal_Int32 nVerticalYAngleDegree );
339 void getRotationAngle(
340 double& rfXAngleRad, double& rfYAngleRad, double& rfZAngleRad );
341 void setRotationAngle(
342 double fXAngleRad, double fYAngleRad, double fZAngleRad );
343
344 ThreeDLookScheme detectScheme();
345 void setScheme( ThreeDLookScheme aScheme );
346
347 void setDefaultRotation( bool bPieOrDonut );
348
349 void switchRightAngledAxes( bool bRightAngledAxes );
350
351private:
352 // ____ XModifyListener ____
353 virtual void SAL_CALL modified(
354 const css::lang::EventObject& aEvent ) override;
355
356 // ____ XEventListener (base of XModifyListener) ____
357 virtual void SAL_CALL disposing(
358 const css::lang::EventObject& Source ) override;
359
360 // ____ OPropertySet ____
361 virtual void firePropertyChangeEvent() override;
362 using OPropertySet::disposing;
363
364 void fireModifyEvent();
365
366 css::uno::Reference<css::uno::XComponentContext> m_xContext;
368
371
372 css::uno::Reference<css::chart2::XTitle> m_xTitle;
373
376 css::uno::Reference<css::chart2::XColorScheme> m_xColorScheme;
378
379};
380
381} // namespace chart
382
383/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define OOO_DLLPUBLIC_CHARTTOOLS
Data table implementation.
Definition: DataTable.hxx:32
rtl::Reference<::chart::Legend > m_xLegend
Definition: Diagram.hxx:374
rtl::Reference< Wall > m_xWall
Definition: Diagram.hxx:369
css::uno::Reference< css::chart2::XTitle > m_xTitle
Definition: Diagram.hxx:372
rtl::Reference<::chart::DataTable > m_xDataTable
Definition: Diagram.hxx:375
css::uno::Reference< css::chart2::XColorScheme > m_xColorScheme
Definition: Diagram.hxx:376
tCoordinateSystemContainerType m_aCoordSystems
Definition: Diagram.hxx:367
rtl::Reference< Wall > m_xFloor
Definition: Diagram.hxx:370
Diagram(css::uno::Reference< css::uno::XComponentContext > xContext)
std::vector< rtl::Reference< ::chart::BaseCoordinateSystem > > tCoordinateSystemContainerType
Definition: Diagram.hxx:164
css::uno::Reference< css::uno::XComponentContext > m_xContext
Definition: Diagram.hxx:366
rtl::Reference< ModifyEventForwarder > m_xModifyEventForwarder
Definition: Diagram.hxx:377
if(aStr !=aBuf) UpdateName_Impl(m_xFollowLb.get()
OOO_DLLPUBLIC_CHARTTOOLS rtl::Reference< ::chart::ChartType > getChartTypeOfSeries(const rtl::Reference< ::chart::DataSeries > &xSeries, const rtl::Reference< ::chart::Diagram > &xDiagram)
::cppu::WeakImplHelper< css::chart2::XDiagram, css::lang::XServiceInfo, css::chart2::XCoordinateSystemContainer, css::chart2::XTitled, css::chart::X3DDefaultSetter, css::util::XModifyBroadcaster, css::util::XModifyListener, css::util::XCloneable > Diagram_Base
Definition: Diagram.hxx:72
DiagramPositioningMode
Definition: Diagram.hxx:56
ThreeDLookScheme
css::uno::Sequence< OUString > getSupportedServiceNames()
OUString getImplementationName()
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
rtl::Reference< ::chart::ChartTypeTemplate > xChartTypeTemplate
Definition: Diagram.hxx:314
unsigned char sal_Bool
#define DECLARE_XINTERFACE()