LibreOffice Module chart2 (master) 1
DiagramHelper.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 "StackMode.hxx"
22#include "charttoolsdllapi.hxx"
23#include "ChartTypeTemplate.hxx"
24#include <com/sun/star/awt/Rectangle.hpp>
25#include <rtl/ref.hxx>
26
27#include <vector>
28
29namespace chart { class ChartModel; }
30namespace com::sun::star::chart2 { class XAxis; }
31namespace com::sun::star::chart2 { class XChartDocument; }
32namespace com::sun::star::chart2 { class XChartType; }
33namespace com::sun::star::chart2 { class XCoordinateSystem; }
34namespace com::sun::star::chart2 { class XDiagram; }
35namespace com::sun::star::chart2 { class XDataSeries; }
36namespace com::sun::star::chart2::data { class XLabeledDataSequence; }
37namespace com::sun::star::frame { class XModel; }
38namespace com::sun::star::lang { class XMultiServiceFactory; }
39namespace com::sun::star::uno { class XComponentContext; }
40namespace com::sun::star::util { class XNumberFormats; }
41namespace com::sun::star::util { class XNumberFormatsSupplier; }
42
43namespace chart
44{
45class Axis;
46class BaseCoordinateSystem;
47class ChartType;
48class ChartTypeManager;
49class ChartTypeTemplate;
50class DataSeries;
51class Diagram;
52class LabeledDataSequence;
53
55{
56public:
57
67 static StackMode getStackModeFromChartType(
68 const rtl::Reference< ::chart::ChartType > & xChartType,
69 bool& rbFound, bool& rbAmbiguous,
70 const rtl::Reference< ::chart::BaseCoordinateSystem > & xCorrespondingCoordinateSystem
71 );
72
73 static bool isSeriesAttachedToMainAxis(
74 const rtl::Reference< ::chart::DataSeries >& xDataSeries );
75
76 static css::uno::Sequence< OUString >
77 getExplicitSimpleCategories( ChartModel& rModel );
78
79 SAL_DLLPRIVATE static css::uno::Sequence< OUString >
80 generateAutomaticCategoriesFromCooSys(
82
83 static void switchToDateCategories(
84 const rtl::Reference<::chart::ChartModel> & xChartDoc );
85
86 static void switchToTextCategories(
87 const rtl::Reference<::chart::ChartModel> & xChartDoc );
88
89 static bool isDateNumberFormat( sal_Int32 nNumberFormat, const css::uno::Reference< css::util::XNumberFormats >& xNumberFormats );
90 static sal_Int32 getDateNumberFormat( const css::uno::Reference< css::util::XNumberFormatsSupplier >& xNumberFormatsSupplier );
91 static sal_Int32 getDateTimeInputNumberFormat( const css::uno::Reference< css::util::XNumberFormatsSupplier >& xNumberFormatsSupplier, double fNumber );
92
93 static sal_Int32 getPercentNumberFormat( const css::uno::Reference<
94 css::util::XNumberFormatsSupplier >& xNumberFormatsSupplier );
95
96 SAL_DLLPRIVATE static bool areChartTypesCompatible(
98 const rtl::Reference< ::chart::ChartType >& xSecondType );
99
100 static bool setDiagramPositioning( const rtl::Reference<::chart::ChartModel>& xChartModel,
101 const css::awt::Rectangle& rPosRect /*100th mm*/ );
102
103 static css::awt::Rectangle getDiagramRectangleFromModel( const rtl::Reference<::chart::ChartModel>& xChartModel );
104
105 static bool switchDiagramPositioningToExcludingPositioning( ChartModel& rModel
106 , bool bResetModifiedState //set model back to unchanged if it was unchanged before
107 , bool bConvertAlsoFromAutoPositioning );
108
109private:
110 DiagramHelper() = delete;
111
112};
113
114} // namespace chart
115
116/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define OOO_DLLPUBLIC_CHARTTOOLS