1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 #ifndef INCLUDED_SVX_CHARTHELPER_HXX
21 #define INCLUDED_SVX_CHARTHELPER_HXX
23 #include <com/sun/star/frame/XModel.hpp>
24 #include <com/sun/star/uno/Sequence.hxx>
25 #include <basegfx/range/b2drange.hxx>
26 #include <svx/svxdllapi.h>
27 #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
28 #include <com/sun/star/chart2/XDiagram.hpp>
29 #include <com/sun/star/embed/XEmbeddedObject.hpp>
31 class SVX_DLLPUBLIC SAL_WARN_UNUSED ChartHelper
34 /// Check that the XDiagram is a real 3D chart.
35 static bool isGL3DDiagram(const css::uno::Reference
<css::chart2::XDiagram
>& xDiagram
);
37 /// Use chart's XUpdatable::update() to update values.
38 static void updateChart( const css::uno::Reference
< css::frame::XModel
>& rXModel
, bool bHardUpdate
);
40 // try to access rXModel in case of a chart to get the chart content
41 // as sequence of primitives. Return range of primitives (chart size) in rRange;
42 // it will be used to embed the chart to the SdrObject transformation. This
43 // allows to define possible distances between chart and SDrObject bounds here
44 static drawinglayer::primitive2d::Primitive2DSequence
tryToGetChartContentAsPrimitive2DSequence(
45 const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XModel
>& rXModel
,
46 basegfx::B2DRange
& rRange
);
48 // #i121334# Allow to switch off line and fill style by setting these as attributes
49 // at the OLE chart object. This is needed to allow fill styles of the covering objects
50 // to make their own fill/line settings work. This should not be done by changing
51 // the defaults at the chart (see StaticPageBackgroundDefaults_Initializer::lcl_AddDefaultsToMap)
52 // since this would not be saved/loaded, thus the compatibility will be better when setting it at
53 // newly created charts using this method
54 static void AdaptDefaultsForChart(
55 const com::sun::star::uno::Reference
< com::sun::star::embed::XEmbeddedObject
> & xEmbObj
,
56 bool bNoFillStyle
= true,
57 bool bNoLineStyle
= true);
60 #endif // INCLUDED_SVX_CHARTHELPER_HXX
62 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */