25#include <bitmaps.hlst>
32#include <unonames.hxx>
36#include <com/sun/star/chart2/DataPointGeometry3D.hpp>
51 , bXAxisWithValues( false )
56 , eCurveStyle( CurveStyle_LINES )
57 , nCurveResolution(20)
59 , nGeometry3D(DataPointGeometry3D::CUBOID)
61 , bSortByXValues(false)
62 , mbRoundedEdge(false)
68 ,
bool HasSymbols,
bool HasLines
69 , CurveStyle nCurveStyle )
70 : nSubTypeIndex( SubTypeIndex )
71 , bXAxisWithValues( HasXAxisWithValues )
73 , bSymbols( HasSymbols )
75 , eStackMode( nStackMode )
76 , eCurveStyle( nCurveStyle )
77 , nCurveResolution(20)
79 , nGeometry3D(DataPointGeometry3D::CUBOID)
81 , bSortByXValues(false)
82 , mbRoundedEdge(false)
93 if(nTheHigherTheLess>nMax)
96 return nTheHigherTheLess>nMax-1;
98 return nTheHigherTheLess>nMax-2;
100 return nTheHigherTheLess>nMax-3;
102 return nTheHigherTheLess>nMax-4;
104 return nTheHigherTheLess>nMax-5;
106 return nTheHigherTheLess>nMax-6;
111 : bSupportsXAxisWithValues(false)
123 tTemplateServiceChartTypeParameterMap::const_iterator aIt( rTemplateMap.find( rServiceName ));
124 return aIt != rTemplateMap.end();
127 const OUString& rServiceName
132 tTemplateServiceChartTypeParameterMap::const_iterator aIt( rTemplateMap.find( rServiceName ));
133 if( aIt != rTemplateMap.end())
134 aRet = (*aIt).second;
135 if( xTemplateProps.is() )
143 catch( uno::Exception &
ex )
151 xTemplateProps->getPropertyValue(
"Geometry3D" ) >>= aRet.
nGeometry3D;
153 catch( uno::Exception&
ex )
184 bool bFoundSomeMatch=
false;
193 for( sal_Int32 nMatchPrecision=0; nMatchPrecision<7 && !bFoundSomeMatch; nMatchPrecision++ )
195 for (
auto const& elem : rMap)
208 rParameter = elem.second;
219 bFoundSomeMatch =
true;
227 rParameter = (*rMap.begin()).second;
240 for (
auto const& elem : rMap)
246 OSL_FAIL(
"ChartType not implemented yet - use fallback to similar type" );
247 for( sal_Int32 nMatchPrecision=1; nMatchPrecision<8; nMatchPrecision++ )
249 for (
auto const& elem : rMap)
264 if(!aServiceName.isEmpty())
266 xTemplate = xTemplateManager->createTemplate( aServiceName );
270 if(xTemplateProps.is())
278 catch( uno::Exception &
ex )
287 catch( uno::Exception &
ex )
297 catch(
const uno::Exception & )
320 aTemplateWithService = xDiagram->getTemplate( xTemplateManager );
323 xTemplate->changeDiagram( xDiagram );
336 rSubTypeList.
Clear();
407 return BMP_TYPE_COLUMN;
420 return s_aTemplateMap;
424 rSubTypeList.
Clear();
430 case DataPointGeometry3D::CYLINDER:
436 case DataPointGeometry3D::CONE:
442 case DataPointGeometry3D::PYRAMID:
497 return s_aTemplateMap;
501 rSubTypeList.
Clear();
507 case DataPointGeometry3D::CYLINDER:
513 case DataPointGeometry3D::CONE:
519 case DataPointGeometry3D::PYRAMID:
569 {
"com.sun.star.chart2.template.DonutAllExploded" ,
ChartTypeParameter(4,
false,
false)},
571 {
"com.sun.star.chart2.template.ThreeDPieAllExploded" ,
ChartTypeParameter(2,
false,
true)},
573 {
"com.sun.star.chart2.template.ThreeDDonutAllExploded" ,
ChartTypeParameter(4,
false,
true)}};
574 return s_aTemplateMap;
578 rSubTypeList.
Clear();
583 rSubTypeList.
InsertItem(2,
Image(StockImage::Yes, BMP_CIRCLES_3D_EXPLODED));
585 rSubTypeList.
InsertItem(4,
Image(StockImage::Yes, BMP_DONUT_3D_EXPLODED));
590 rSubTypeList.
InsertItem(2,
Image(StockImage::Yes, BMP_CIRCLES_2D_EXPLODED));
592 rSubTypeList.
InsertItem(4,
Image(StockImage::Yes, BMP_DONUT_2D_EXPLODED));
626 return BMP_TYPE_LINE;
644 return s_aTemplateMap;
648 rSubTypeList.
Clear();
652 case CurveStyle_CUBIC_SPLINES:
653 case CurveStyle_B_SPLINES:
656 rSubTypeList.
InsertItem(1,
Image(StockImage::Yes, BMP_POINTS_XCATEGORY));
657 rSubTypeList.
InsertItem(2,
Image(StockImage::Yes, BMP_LINE_P_XCATEGORY_SMOOTH));
658 rSubTypeList.
InsertItem(3,
Image(StockImage::Yes, BMP_LINE_O_XCATEGORY_SMOOTH));
659 rSubTypeList.
InsertItem(4,
Image(StockImage::Yes, BMP_LINE3D_XCATEGORY_SMOOTH));
663 rSubTypeList.
InsertItem(1,
Image(StockImage::Yes, BMP_POINTS_STACKED));
664 rSubTypeList.
InsertItem(2,
Image(StockImage::Yes, BMP_LINE_P_STACKED_SMOOTH));
665 rSubTypeList.
InsertItem(3,
Image(StockImage::Yes, BMP_LINE_O_STACKED_SMOOTH));
666 rSubTypeList.
InsertItem(4,
Image(StockImage::Yes, BMP_LINE3D_STACKED_SMOOTH));
669 case CurveStyle_STEP_START:
670 case CurveStyle_STEP_END:
671 case CurveStyle_STEP_CENTER_X:
672 case CurveStyle_STEP_CENTER_Y:
675 rSubTypeList.
InsertItem(1,
Image(StockImage::Yes, BMP_POINTS_XCATEGORY));
676 rSubTypeList.
InsertItem(2,
Image(StockImage::Yes, BMP_LINE_P_XCATEGORY_STEPPED));
677 rSubTypeList.
InsertItem(3,
Image(StockImage::Yes, BMP_LINE_O_XCATEGORY_STEPPED));
678 rSubTypeList.
InsertItem(4,
Image(StockImage::Yes, BMP_LINE3D_XCATEGORY_STEPPED));
682 rSubTypeList.
InsertItem(1,
Image(StockImage::Yes, BMP_POINTS_STACKED));
683 rSubTypeList.
InsertItem(2,
Image(StockImage::Yes, BMP_LINE_P_STACKED_STEPPED));
684 rSubTypeList.
InsertItem(3,
Image(StockImage::Yes, BMP_LINE_O_STACKED_STEPPED));
685 rSubTypeList.
InsertItem(4,
Image(StockImage::Yes, BMP_LINE3D_STACKED_STEPPED));
692 rSubTypeList.
InsertItem(1,
Image(StockImage::Yes, BMP_POINTS_XCATEGORY));
693 rSubTypeList.
InsertItem(2,
Image(StockImage::Yes, BMP_LINE_P_XCATEGORY));
694 rSubTypeList.
InsertItem(3,
Image(StockImage::Yes, BMP_LINE_O_XCATEGORY));
695 rSubTypeList.
InsertItem(4,
Image(StockImage::Yes, BMP_LINE3D_XCATEGORY));
699 rSubTypeList.
InsertItem(1,
Image(StockImage::Yes, BMP_POINTS_STACKED));
700 rSubTypeList.
InsertItem(2,
Image(StockImage::Yes, BMP_LINE_P_STACKED));
701 rSubTypeList.
InsertItem(3,
Image(StockImage::Yes, BMP_LINE_O_STACKED));
702 rSubTypeList.
InsertItem(4,
Image(StockImage::Yes, BMP_LINE3D_STACKED));
742 rParameter.
bLines =
false;
783 return s_aTemplateMap;
788 rSubTypeList.
Clear();
792 case CurveStyle_CUBIC_SPLINES:
793 case CurveStyle_B_SPLINES:
795 rSubTypeList.
InsertItem(1,
Image(StockImage::Yes, BMP_POINTS_XVALUES));
796 rSubTypeList.
InsertItem(2,
Image(StockImage::Yes, BMP_LINE_P_XVALUES_SMOOTH));
797 rSubTypeList.
InsertItem(3,
Image(StockImage::Yes, BMP_LINE_O_XVALUES_SMOOTH));
798 rSubTypeList.
InsertItem(4,
Image(StockImage::Yes, BMP_LINE3D_XVALUES_SMOOTH));
801 case CurveStyle_STEP_START:
802 case CurveStyle_STEP_END:
803 case CurveStyle_STEP_CENTER_X:
804 case CurveStyle_STEP_CENTER_Y:
806 rSubTypeList.
InsertItem(1,
Image(StockImage::Yes, BMP_POINTS_XVALUES));
807 rSubTypeList.
InsertItem(2,
Image(StockImage::Yes, BMP_LINE_P_XVALUES_STEPPED));
808 rSubTypeList.
InsertItem(3,
Image(StockImage::Yes, BMP_LINE_O_XVALUES_STEPPED));
809 rSubTypeList.
InsertItem(4,
Image(StockImage::Yes, BMP_LINE3D_XVALUES_STEPPED));
813 rSubTypeList.
InsertItem(1,
Image(StockImage::Yes, BMP_POINTS_XVALUES));
814 rSubTypeList.
InsertItem(2,
Image(StockImage::Yes, BMP_LINE_P_XVALUES));
815 rSubTypeList.
InsertItem(3,
Image(StockImage::Yes, BMP_LINE_O_XVALUES));
816 rSubTypeList.
InsertItem(4,
Image(StockImage::Yes, BMP_LINE3D_XVALUES));
856 rParameter.
bLines =
false;
876 return BMP_TYPE_AREA;
893 return s_aTemplateMap;
898 rSubTypeList.
Clear();
990 return s_aTemplateMap;
994 rSubTypeList.
Clear();
1005 rSubTypeList.
InsertItem(1,
Image(StockImage::Yes, BMP_NET_SYMB_STACK));
1006 rSubTypeList.
InsertItem(2,
Image(StockImage::Yes, BMP_NET_LINESYMB_STACK));
1008 rSubTypeList.
InsertItem(4,
Image(StockImage::Yes, BMP_NET_FILL_STACK));
1026 rParameter.
bLines =
true;
1030 rParameter.
bLines =
true;
1034 rParameter.
bLines =
false;
1038 rParameter.
bLines =
false;
1058 return BMP_TYPE_STOCK;
1067 {
"com.sun.star.chart2.template.StockVolumeOpenLowHighClose" ,
ChartTypeParameter(4)}};
1068 return s_aTemplateMap;
1073 rSubTypeList.
Clear();
1098 return SchResId(STR_TYPE_COMBI_COLUMN_LINE);
1103 return BMP_TYPE_COLUMN_LINE;
1111 return s_aTemplateMap;
1116 rSubTypeList.
Clear();
1118 rSubTypeList.
InsertItem(2,
Image(StockImage::Yes, BMP_COLUMN_LINE_STACKED));
1163 sal_Int32 nNumLines = 0;
1165 if(xTemplateProps.is())
1169 xTemplateProps->getPropertyValue(
"NumberOfLines" ) >>= nNumLines;
1171 catch(
const uno::Exception & )
1187 if( xTemplateProps.is() )
1190 xTemplateProps->setPropertyValue(
"NumberOfLines" ,
uno::Any(nNumLines) );
1196 if( m_pChangeListener )
1197 m_pChangeListener->stateChanged();
1231 return BMP_TYPE_BUBBLE;
1238 return s_aTemplateMap;
1242 rSubTypeList.
Clear();
static bool GetMathLayoutRTL()
void InsertItem(sal_uInt16 nItemId, const Image &rImage)
void SetItemText(sal_uInt16 nItemId, const OUString &rStr)
virtual void adjustParameterToMainType(ChartTypeParameter &rParameter) override
virtual OUString getName() override
virtual bool shouldShow_3DLookControl() const override
virtual const tTemplateServiceChartTypeParameterMap & getTemplateMap() const override
virtual OUString getImage() override
AreaChartDialogController()
virtual ~AreaChartDialogController() override
virtual void fillSubTypeList(ValueSet &rSubTypeList, const ChartTypeParameter &rParameter) override
virtual void adjustParameterToSubType(ChartTypeParameter &rParameter) override
static rtl::Reference< ::chart::BaseCoordinateSystem > getCoordinateSystemByIndex(const rtl::Reference< ::chart::Diagram > &xDiagram, sal_Int32 nIndex)
static void setRTLAxisLayout(const rtl::Reference< ::chart::BaseCoordinateSystem > &xCooSys)
virtual ~BarChartDialogController() override
BarChartDialogController()
virtual void fillSubTypeList(ValueSet &rSubTypeList, const ChartTypeParameter &rParameter) override
virtual OUString getImage() override
virtual const tTemplateServiceChartTypeParameterMap & getTemplateMap() const override
virtual OUString getName() override
virtual const tTemplateServiceChartTypeParameterMap & getTemplateMap() const override
virtual OUString getName() override
virtual ~BubbleChartDialogController() override
virtual void fillSubTypeList(ValueSet &rSubTypeList, const ChartTypeParameter &rParameter) override
virtual OUString getImage() override
BubbleChartDialogController()
virtual void adjustParameterToSubType(ChartTypeParameter &rParameter) override
static std::vector< rtl::Reference< ::chart::DataSeries > > getDataSeries(const rtl::Reference< ::chart::ChartModel > &xModel)
virtual void fillExtraControls(const rtl::Reference<::chart::ChartModel > &xChartModel, const css::uno::Reference< css::beans::XPropertySet > &xTemplateProps) const
virtual void fillSubTypeList(ValueSet &rSubTypeList, const ChartTypeParameter &rParameter)
ChartTypeDialogController()
virtual void hideExtraControls() const
bool bSupportsXAxisWithValues
void commitToModel(const ChartTypeParameter &rParameter, const rtl::Reference<::chart::ChartModel > &xChartModel)
virtual bool shouldShow_GeometryControl() const
virtual bool shouldShow_StackingControl() const
virtual bool shouldShow_SplineControl() const
virtual bool shouldShow_SortByXValuesResourceGroup() const
virtual bool shouldShow_3DLookControl() const
OUString getServiceNameForParameter(const ChartTypeParameter &rParameter) const
rtl::Reference<::chart::ChartTypeTemplate > getCurrentTemplate(const ChartTypeParameter &rParameter, const rtl::Reference<::chart::ChartTypeManager > &xTemplateManager) const
virtual void showExtraControls(weld::Builder *pBuilder)
virtual void adjustParameterToSubType(ChartTypeParameter &rParameter)
virtual const tTemplateServiceChartTypeParameterMap & getTemplateMap() const =0
virtual void adjustSubTypeAndEnableControls(ChartTypeParameter &rParameter)
virtual void setTemplateProperties(const css::uno::Reference< css::beans::XPropertySet > &xTemplateProps) const
ChartTypeParameter getChartTypeParameterForService(const OUString &rServiceName, const css::uno::Reference< css::beans::XPropertySet > &xTemplateProps)
virtual void adjustParameterToMainType(ChartTypeParameter &rParameter)
bool isSubType(const OUString &rServiceName)
virtual ~ChartTypeDialogController() override
css::chart2::CurveStyle eCurveStyle
bool mapsToSameService(const ChartTypeParameter &rParameter) const
ThreeDLookScheme eThreeDLookScheme
bool mapsToSimilarService(const ChartTypeParameter &rParameter, sal_Int32 nTheHigherTheLess) const
GlobalStackMode eStackMode
sal_Int32 nCurveResolution
virtual ~ColumnChartDialogController() override
virtual void fillSubTypeList(ValueSet &rSubTypeList, const ChartTypeParameter &rParameter) override
virtual OUString getName() override
ColumnChartDialogController()
virtual OUString getImage() override
virtual const tTemplateServiceChartTypeParameterMap & getTemplateMap() const override
virtual bool shouldShow_GeometryControl() const override
virtual ~ColumnOrBarChartDialogController_Base() override
ColumnOrBarChartDialogController_Base()
virtual void adjustSubTypeAndEnableControls(ChartTypeParameter &rParameter) override
virtual bool shouldShow_3DLookControl() const override
virtual void showExtraControls(weld::Builder *pBuilder) override
virtual OUString getName() override
virtual void fillExtraControls(const rtl::Reference<::chart::ChartModel > &xChartModel, const css::uno::Reference< css::beans::XPropertySet > &xTemplateProps) const override
std::unique_ptr< weld::Label > m_xFT_NumberOfLines
CombiColumnLineChartDialogController()
virtual void fillSubTypeList(ValueSet &rSubTypeList, const ChartTypeParameter &rParameter) override
virtual void adjustParameterToSubType(ChartTypeParameter &rParameter) override
virtual void hideExtraControls() const override
virtual OUString getImage() override
std::unique_ptr< weld::SpinButton > m_xMF_NumberOfLines
virtual const tTemplateServiceChartTypeParameterMap & getTemplateMap() const override
virtual void setTemplateProperties(const css::uno::Reference< css::beans::XPropertySet > &xTemplateProps) const override
This guard calls lockControllers at the given Model in the CTOR and unlockControllers in the DTOR.
virtual OUString getName() override
virtual ~LineChartDialogController() override
virtual const tTemplateServiceChartTypeParameterMap & getTemplateMap() const override
virtual void fillSubTypeList(ValueSet &rSubTypeList, const ChartTypeParameter &rParameter) override
virtual OUString getImage() override
virtual bool shouldShow_SplineControl() const override
virtual void adjustParameterToMainType(ChartTypeParameter &rParameter) override
virtual void adjustParameterToSubType(ChartTypeParameter &rParameter) override
LineChartDialogController()
virtual bool shouldShow_StackingControl() const override
virtual bool shouldShow_StackingControl() const override
virtual ~NetChartDialogController() override
virtual void adjustParameterToSubType(ChartTypeParameter &rParameter) override
virtual OUString getImage() override
NetChartDialogController()
virtual OUString getName() override
virtual void fillSubTypeList(ValueSet &rSubTypeList, const ChartTypeParameter &rParameter) override
virtual const tTemplateServiceChartTypeParameterMap & getTemplateMap() const override
virtual void fillSubTypeList(ValueSet &rSubTypeList, const ChartTypeParameter &rParameter) override
virtual OUString getName() override
virtual const tTemplateServiceChartTypeParameterMap & getTemplateMap() const override
virtual void adjustParameterToSubType(ChartTypeParameter &rParameter) override
virtual bool shouldShow_3DLookControl() const override
PieChartDialogController()
virtual ~PieChartDialogController() override
virtual OUString getImage() override
virtual const tTemplateServiceChartTypeParameterMap & getTemplateMap() const override
virtual void fillSubTypeList(ValueSet &rSubTypeList, const ChartTypeParameter &rParameter) override
virtual OUString getImage() override
StockChartDialogController()
virtual ~StockChartDialogController() override
virtual OUString getName() override
virtual void adjustParameterToSubType(ChartTypeParameter &rParameter) override
virtual ~XYChartDialogController() override
virtual OUString getName() override
XYChartDialogController()
virtual OUString getImage() override
virtual void adjustParameterToSubType(ChartTypeParameter &rParameter) override
virtual bool shouldShow_SplineControl() const override
virtual const tTemplateServiceChartTypeParameterMap & getTemplateMap() const override
virtual void fillSubTypeList(ValueSet &rSubTypeList, const ChartTypeParameter &rParameter) override
virtual bool shouldShow_SortByXValuesResourceGroup() const override
virtual std::unique_ptr< Label > weld_label(const OUString &id)=0
virtual std::unique_ptr< SpinButton > weld_spin_button(const OUString &id)=0
#define DBG_UNHANDLED_EXCEPTION(...)
#define LINK(Instance, Class, Member)
@ GlobalStackMode_STACK_Z
@ GlobalStackMode_STACK_Y
@ GlobalStackMode_STACK_Y_PERCENT
std::map< OUString, ChartTypeParameter > tTemplateServiceChartTypeParameterMap
@ ThreeDLookScheme_Realistic
OUString OOO_DLLPUBLIC_CHARTTOOLS SchResId(TranslateId aId)
IMPL_LINK_NOARG(SplinePropertiesDialog, SplineTypeListBoxHdl, weld::ComboBox &, void)
rtl::Reference< ::chart::ChartTypeTemplate > xChartTypeTemplate
constexpr OUStringLiteral CHART_UNONAME_SPLINE_ORDER
constexpr OUStringLiteral CHART_UNONAME_CURVE_STYLE
constexpr OUStringLiteral CHART_UNONAME_CURVE_RESOLUTION
constexpr OUStringLiteral CHART_UNONAME_SORT_BY_XVALUES