Avoid potential negative array index access to cached text.
[LibreOffice.git] / chart2 / source / inc / ChartTypeHelper.hxx
blob379f96ad0e44e1b9e41d8d8fd2915dead59e2cd5
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #pragma once
22 #include <com/sun/star/drawing/Direction3D.hpp>
23 #include "charttoolsdllapi.hxx"
24 #include <rtl/ref.hxx>
26 namespace com::sun::star::chart2 { class XChartType; }
27 namespace com::sun::star::chart2 { class XDataSeries; }
29 namespace chart
31 class ChartType;
32 class DataSeries;
34 class OOO_DLLPUBLIC_CHARTTOOLS ChartTypeHelper
36 public:
37 static bool isSupportingGeometryProperties( const rtl::Reference< ::chart::ChartType >& xChartType, sal_Int32 nDimensionCount );
38 static bool isSupportingStatisticProperties( const rtl::Reference< ::chart::ChartType >& xChartType, sal_Int32 nDimensionCount );
39 static bool isSupportingRegressionProperties(const rtl::Reference< ::chart::ChartType >& xChartType, sal_Int32 nDimensionCount );
40 static bool isSupportingMainAxis( const rtl::Reference< ::chart::ChartType >& xChartType, sal_Int32 nDimensionCount, sal_Int32 nDimensionIndex );
41 static bool isSupportingSecondaryAxis( const rtl::Reference< ::chart::ChartType >& xChartType, sal_Int32 nDimensionCount );
42 static bool isSupportingAreaProperties( const rtl::Reference< ::chart::ChartType >& xChartType, sal_Int32 nDimensionCount );
43 static bool isSupportingSymbolProperties( const rtl::Reference< ::chart::ChartType >& xChartType, sal_Int32 nDimensionCount );
44 static bool isSupportingOverlapAndGapWidthProperties( const rtl::Reference< ::chart::ChartType >& xChartType, sal_Int32 nDimensionCount );
45 static bool isSupportingBarConnectors( const rtl::Reference< ::chart::ChartType >& xChartType, sal_Int32 nDimensionCount );
46 static bool isSupportingRightAngledAxes( const rtl::Reference< ::chart::ChartType >& xChartType );
47 static bool isSupportingAxisSideBySide( const rtl::Reference< ::chart::ChartType >& xChartType, sal_Int32 nDimensionCount );
48 static bool isSupportingStartingAngle( const rtl::Reference< ::chart::ChartType >& xChartType );
49 //starting value for bars or baseline for areas for example
50 static bool isSupportingBaseValue( const rtl::Reference< ::chart::ChartType >& xChartType );
51 static bool isSupportingAxisPositioning( const rtl::Reference< ::chart::ChartType >& xChartType, sal_Int32 nDimensionCount, sal_Int32 nDimensionIndex );
52 static bool isSupportingDateAxis( const rtl::Reference< ::chart::ChartType >& xChartType, sal_Int32 nDimensionIndex );
53 static bool isSupportingComplexCategory( const rtl::Reference< ::chart::ChartType >& xChartType );
54 static bool isSupportingCategoryPositioning( const rtl::Reference< ::chart::ChartType >& xChartType, sal_Int32 nDimensionCount );
55 static bool shiftCategoryPosAtXAxisPerDefault( const rtl::Reference< ::chart::ChartType >& xChartType );
57 //returns sequence of css::chart::DataLabelPlacement
58 static css::uno::Sequence < sal_Int32 > getSupportedLabelPlacements(
59 const rtl::Reference< ::chart::ChartType >& xChartType, bool bSwapXAndY
60 , const rtl::Reference< ::chart::DataSeries >& xSeries );
62 //returns sequence of css::chart::MissingValueTreatment
63 static css::uno::Sequence < sal_Int32 > getSupportedMissingValueTreatments(
64 const rtl::Reference< ::chart::ChartType >& xChartType );
66 SAL_DLLPRIVATE static css::drawing::Direction3D getDefaultSimpleLightDirection( const rtl::Reference< ::chart::ChartType >& xChartType );
67 SAL_DLLPRIVATE static css::drawing::Direction3D getDefaultRealisticLightDirection( const rtl::Reference< ::chart::ChartType >& xChartType );
68 SAL_DLLPRIVATE static sal_Int32 getDefaultDirectLightColor( bool bSimple, const rtl::Reference< ::chart::ChartType >& xChartType );
69 SAL_DLLPRIVATE static sal_Int32 getDefaultAmbientLightColor( bool bSimple, const rtl::Reference< ::chart::ChartType >& xChartType );
70 static sal_Int32 getNumberOfDisplayedSeries( const rtl::Reference< ::chart::ChartType >& xChartType, sal_Int32 nNumberOfSeries );
71 SAL_DLLPRIVATE static bool noBordersForSimpleScheme( const rtl::Reference< ::chart::ChartType >& xChartType );
73 static bool isSeriesInFrontOfAxisLine( const rtl::Reference< ::chart::ChartType >& xChartType );
75 static sal_Int32 //one of css::chart2::AxisType
76 getAxisType( const rtl::Reference< ::chart::ChartType >& xChartType
77 , sal_Int32 nDimensionIndex );
79 static OUString getRoleOfSequenceForYAxisNumberFormatDetection( const rtl::Reference<
80 ::chart::ChartType >& xChartType );
82 static OUString getRoleOfSequenceForDataLabelNumberFormatDetection( const rtl::Reference<
83 ::chart::ChartType >& xChartType );
85 static bool isSupportingOnlyDeepStackingFor3D( const rtl::Reference< ::chart::ChartType >& xChartType );
88 } //namespace chart
90 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */