summaryrefslogtreecommitdiffstats
path: root/chart2/source/inc/AxisHelper.hxx
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:06:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:06:44 +0000
commited5640d8b587fbcfed7dd7967f3de04b37a76f26 (patch)
tree7a5f7c6c9d02226d7471cb3cc8fbbf631b415303 /chart2/source/inc/AxisHelper.hxx
parentInitial commit. (diff)
downloadlibreoffice-upstream.tar.xz
libreoffice-upstream.zip
Adding upstream version 4:7.4.7.upstream/4%7.4.7upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--chart2/source/inc/AxisHelper.hxx230
1 files changed, 230 insertions, 0 deletions
diff --git a/chart2/source/inc/AxisHelper.hxx b/chart2/source/inc/AxisHelper.hxx
new file mode 100644
index 000000000..cd51d5adb
--- /dev/null
+++ b/chart2/source/inc/AxisHelper.hxx
@@ -0,0 +1,230 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#pragma once
+
+#include "charttoolsdllapi.hxx"
+#include <com/sun/star/chart2/ScaleData.hpp>
+#include <rtl/ref.hxx>
+
+#include <vector>
+
+namespace chart { class ChartModel; }
+namespace chart { class ExplicitCategoriesProvider; }
+namespace chart { class ReferenceSizeProvider; }
+namespace com::sun::star::beans { class XPropertySet; }
+namespace com::sun::star::chart2 { class XAxis; }
+namespace com::sun::star::chart2 { class XChartDocument; }
+namespace com::sun::star::chart2 { class XChartType; }
+namespace com::sun::star::chart2 { class XCoordinateSystem; }
+namespace com::sun::star::chart2 { class XDiagram; }
+namespace com::sun::star::chart2 { class XScaling; }
+namespace com::sun::star::uno { class XComponentContext; }
+
+namespace chart
+{
+class Axis;
+class BaseCoordinateSystem;
+class ChartType;
+class Diagram;
+
+class OOO_DLLPUBLIC_CHARTTOOLS AxisHelper
+{
+public:
+ static css::uno::Reference< css::chart2::XScaling > createLinearScaling();
+ static css::uno::Reference< css::chart2::XScaling > createLogarithmicScaling( double fBase = 10.0 );
+
+ static css::chart2::ScaleData createDefaultScale();
+
+ static void removeExplicitScaling( css::chart2::ScaleData& rScaleData );
+
+ static bool isLogarithmic( const css::uno::Reference< css::chart2::XScaling >& xScaling );
+
+ static void checkDateAxis( css::chart2::ScaleData& rScale, ExplicitCategoriesProvider* pExplicitCategoriesProvider, bool bChartTypeAllowsDateAxis );
+ static css::chart2::ScaleData getDateCheckedScale( const rtl::Reference< ::chart::Axis >& xAxis, ChartModel& rModel );
+
+ static sal_Int32 getExplicitNumberFormatKeyForAxis(
+ const css::uno::Reference< css::chart2::XAxis >& xAxis
+ , const rtl::Reference< ::chart::BaseCoordinateSystem >& xCorrespondingCoordinateSystem
+ , const rtl::Reference< ::chart::ChartModel>& xChartDoc
+ , bool bSearchForParallelAxisIfNothingIsFound );
+ static sal_Int32 getExplicitNumberFormatKeyForAxis(
+ const rtl::Reference< ::chart::Axis >& xAxis
+ , const rtl::Reference< ::chart::BaseCoordinateSystem >& xCorrespondingCoordinateSystem
+ , const rtl::Reference< ::chart::ChartModel>& xChartDoc
+ , bool bSearchForParallelAxisIfNothingIsFound );
+
+ static rtl::Reference< ::chart::Axis >
+ createAxis( sal_Int32 nDimensionIndex, bool bMainAxis
+ , const rtl::Reference< ::chart::Diagram >& xDiagram
+ , const css::uno::Reference< css::uno::XComponentContext >& xContext
+ , ReferenceSizeProvider * pRefSizeProvider = nullptr );
+
+ static rtl::Reference< ::chart::Axis >
+ createAxis(
+ sal_Int32 nDimensionIndex
+ , sal_Int32 nAxisIndex // 0==main or 1==secondary axis
+ , const rtl::Reference< ::chart::BaseCoordinateSystem >& xCooSys
+ , const css::uno::Reference< css::uno::XComponentContext > & xContext
+ , ReferenceSizeProvider * pRefSizeProvider = nullptr );
+
+ static void showAxis( sal_Int32 nDimensionIndex, bool bMainAxis
+ , const rtl::Reference< ::chart::Diagram >& xDiagram
+ , const css::uno::Reference< css::uno::XComponentContext >& xContext
+ , ReferenceSizeProvider * pRefSizeProvider = nullptr );
+
+ static void showGrid( sal_Int32 nDimensionIndex, sal_Int32 nCooSysIndex, bool bMainGrid
+ , const rtl::Reference< ::chart::Diagram >& xDiagram );
+
+ static void hideAxis( sal_Int32 nDimensionIndex, bool bMainAxis
+ , const rtl::Reference< ::chart::Diagram >& xDiagram );
+ static void hideGrid( sal_Int32 nDimensionIndex, sal_Int32 nCooSysIndex, bool bMainGrid
+ , const rtl::Reference< ::chart::Diagram >& xDiagram );
+
+ static bool isAxisShown( sal_Int32 nDimensionIndex, bool bMainAxis
+ , const rtl::Reference< ::chart::Diagram >& xDiagram );
+ static bool isGridShown( sal_Int32 nDimensionIndex, sal_Int32 nCooSysIndex, bool bMainGrid
+ , const rtl::Reference< ::chart::Diagram >& xDiagram );
+
+ static void makeAxisVisible( const rtl::Reference< ::chart::Axis >& xAxis );
+ static void makeGridVisible( const css::uno::Reference< css::beans::XPropertySet >& xGridProperties );
+
+ static void makeAxisInvisible( const rtl::Reference< ::chart::Axis >& xAxis );
+ static void makeGridInvisible( const css::uno::Reference< css::beans::XPropertySet >& xGridProperties );
+
+ static void hideAxisIfNoDataIsAttached( const rtl::Reference< ::chart::Axis >& xAxis
+ , const rtl::Reference< ::chart::Diagram >& xDiagram);
+
+ SAL_DLLPRIVATE static bool areAxisLabelsVisible( const css::uno::Reference< css::beans::XPropertySet >& xAxisProperties );
+ static bool isAxisVisible( const css::uno::Reference< css::chart2::XAxis >& xAxis );
+ static bool isGridVisible( const css::uno::Reference< css::beans::XPropertySet >& xGridProperties );
+
+ static rtl::Reference< ::chart::BaseCoordinateSystem >
+ getCoordinateSystemByIndex(
+ const rtl::Reference< ::chart::Diagram >& xDiagram
+ , sal_Int32 nIndex );
+
+ static rtl::Reference< ::chart::BaseCoordinateSystem >
+ getCoordinateSystemOfAxis(
+ const css::uno::Reference< css::chart2::XAxis >& xAxis
+ , const rtl::Reference< ::chart::Diagram >& xDiagram );
+ static rtl::Reference< ::chart::BaseCoordinateSystem >
+ getCoordinateSystemOfAxis(
+ const rtl::Reference< ::chart::Axis >& xAxis
+ , const rtl::Reference< ::chart::Diagram >& xDiagram );
+
+ static rtl::Reference< ::chart::Axis >
+ getAxis( sal_Int32 nDimensionIndex, bool bMainAxis
+ , const rtl::Reference< ::chart::Diagram >& xDiagram );
+ static rtl::Reference< ::chart::Axis >
+ getAxis( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex
+ , const rtl::Reference< ::chart::BaseCoordinateSystem >& xCooSys );
+
+ static rtl::Reference< ::chart::Axis >
+ getCrossingMainAxis( const css::uno::Reference< css::chart2::XAxis >& xAxis
+ , const rtl::Reference< ::chart::BaseCoordinateSystem >& xCooSys );
+ static rtl::Reference< ::chart::Axis >
+ getCrossingMainAxis( const rtl::Reference< ::chart::Axis >& xAxis
+ , const rtl::Reference< ::chart::BaseCoordinateSystem >& xCooSys );
+
+ static rtl::Reference< ::chart::Axis >
+ getParallelAxis( const css::uno::Reference< css::chart2::XAxis >& xAxis
+ , const rtl::Reference< ::chart::Diagram >& xDiagram );
+
+ static css::uno::Reference< css::beans::XPropertySet >
+ getGridProperties( const rtl::Reference< ::chart::BaseCoordinateSystem >& xCooSys
+ , sal_Int32 nDimensionIndex
+ , sal_Int32 nAxisIndex //0: Primary axis, 1: secondary axis
+ , sal_Int32 nSubGridIndex //-1: Main Grid; 0: First SubGrid etc
+ );
+
+ static sal_Int32 getDimensionIndexOfAxis(
+ const rtl::Reference< ::chart::Axis >& xAxis
+ , const rtl::Reference< ::chart::Diagram >& xDiagram );
+
+ static bool getIndicesForAxis(
+ const css::uno::Reference< css::chart2::XAxis >& xAxis
+ , const rtl::Reference< ::chart::BaseCoordinateSystem >& xCooSys
+ , sal_Int32& rOutDimensionIndex, sal_Int32& rOutAxisIndex );
+ static bool getIndicesForAxis(
+ const rtl::Reference< ::chart::Axis >& xAxis
+ , const rtl::Reference< ::chart::BaseCoordinateSystem >& xCooSys
+ , sal_Int32& rOutDimensionIndex, sal_Int32& rOutAxisIndex );
+
+ static bool getIndicesForAxis(
+ const css::uno::Reference< css::chart2::XAxis >& xAxis
+ , const rtl::Reference< ::chart::Diagram >& xDiagram
+ , sal_Int32& rOutCooSysIndex, sal_Int32& rOutDimensionIndex, sal_Int32& rOutAxisIndex );
+ static bool getIndicesForAxis(
+ const rtl::Reference< ::chart::Axis >& xAxis
+ , const rtl::Reference< ::chart::Diagram >& xDiagram
+ , sal_Int32& rOutCooSysIndex, sal_Int32& rOutDimensionIndex, sal_Int32& rOutAxisIndex );
+
+ /** @param bOnlyVisible if </TRUE>, only axes with property "Show" set to
+ </sal_True> are returned
+ */
+ static std::vector< rtl::Reference< ::chart::Axis > >
+ getAllAxesOfDiagram( const rtl::Reference< ::chart::Diagram >& xDiagram
+ , bool bOnlyVisible = false );
+
+ /** @param bOnlyVisible if </TRUE>, only axes with property "Show" set to
+ </sal_True> are returned
+ */
+ SAL_DLLPRIVATE static std::vector< rtl::Reference< ::chart::Axis > >
+ getAllAxesOfCoordinateSystem( const rtl::Reference< ::chart::BaseCoordinateSystem >& xCooSys
+ , bool bOnlyVisible = false );
+
+ static css::uno::Sequence< css::uno::Reference< css::beans::XPropertySet > >
+ getAllGrids( const rtl::Reference< ::chart::Diagram >& xDiagram );
+
+ static void getAxisOrGridPossibilities( css::uno::Sequence< sal_Bool >& rPossibilityList
+ , const rtl::Reference< ::chart::Diagram>& xDiagram, bool bAxis=true );
+
+ static void getAxisOrGridExistence( css::uno::Sequence< sal_Bool >& rExistenceList
+ , const rtl::Reference< ::chart::Diagram>& xDiagram, bool bAxis=true );
+
+ static bool changeVisibilityOfGrids( const rtl::Reference< ::chart::Diagram>& xDiagram
+ , const css::uno::Sequence< sal_Bool >& rOldExistenceList
+ , const css::uno::Sequence< sal_Bool >& rNewExistenceList );
+
+ static bool changeVisibilityOfAxes( const rtl::Reference< ::chart::Diagram>& xDiagram
+ , const css::uno::Sequence< sal_Bool >& rOldExistenceList
+ , const css::uno::Sequence< sal_Bool >& rNewExistenceList
+ , const css::uno::Reference< css::uno::XComponentContext >& xContext
+ , ReferenceSizeProvider * pRefSizeProvider );
+
+ static bool shouldAxisBeDisplayed( const rtl::Reference< ::chart::Axis >& xAxis
+ , const rtl::Reference< ::chart::BaseCoordinateSystem >& xCooSys );
+ static bool isSecondaryYAxisNeeded( const rtl::Reference<
+ ::chart::BaseCoordinateSystem >& xCooSys );
+
+ static rtl::Reference< ::chart::ChartType >
+ getChartTypeByIndex( const rtl::Reference< ::chart::BaseCoordinateSystem >& xCooSys,
+ sal_Int32 nIndex );
+
+ static void setRTLAxisLayout( const rtl::Reference< ::chart::BaseCoordinateSystem >& xCooSys );
+
+ static rtl::Reference< ::chart::ChartType >
+ getFirstChartTypeWithSeriesAttachedToAxisIndex( const rtl::Reference< ::chart::Diagram >& xDiagram, const sal_Int32 nAttachedAxisIndex );
+
+ static bool isAxisPositioningEnabled();
+};
+
+} //namespace chart
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */