xref: /aoo42x/main/svx/inc/svx/charthelper.hxx (revision 6f0b96b4)
14f506f19SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
34f506f19SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
44f506f19SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
54f506f19SAndrew Rist  * distributed with this work for additional information
64f506f19SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
74f506f19SAndrew Rist  * to you under the Apache License, Version 2.0 (the
84f506f19SAndrew Rist  * "License"); you may not use this file except in compliance
94f506f19SAndrew Rist  * with the License.  You may obtain a copy of the License at
104f506f19SAndrew Rist  *
114f506f19SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
124f506f19SAndrew Rist  *
134f506f19SAndrew Rist  * Unless required by applicable law or agreed to in writing,
144f506f19SAndrew Rist  * software distributed under the License is distributed on an
154f506f19SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
164f506f19SAndrew Rist  * KIND, either express or implied.  See the License for the
174f506f19SAndrew Rist  * specific language governing permissions and limitations
184f506f19SAndrew Rist  * under the License.
194f506f19SAndrew Rist  *
204f506f19SAndrew Rist  *************************************************************/
214f506f19SAndrew Rist 
2278d93489SArmin Le Grand #ifndef CHARTHELPER_HXX
2378d93489SArmin Le Grand #define CHARTHELPER_HXX
244f506f19SAndrew Rist 
2578d93489SArmin Le Grand #include <com/sun/star/frame/XModel.hpp>
2678d93489SArmin Le Grand #include <com/sun/star/uno/Sequence.hxx>
2778d93489SArmin Le Grand #include <basegfx/range/b2drange.hxx>
2878d93489SArmin Le Grand #include <svx/svxdllapi.h>
2978d93489SArmin Le Grand #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
30*6f0b96b4SArmin Le Grand #include <com/sun/star/embed/XEmbeddedObject.hpp>
31cdf0e10cSrcweir 
32cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
3378d93489SArmin Le Grand // predeclarations
34cdf0e10cSrcweir 
3578d93489SArmin Le Grand namespace svt { class EmbeddedObjectRef; }
36cdf0e10cSrcweir 
37cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
38cdf0e10cSrcweir 
3978d93489SArmin Le Grand class SVX_DLLPUBLIC ChartHelper
40cdf0e10cSrcweir {
4178d93489SArmin Le Grand public:
4278d93489SArmin Le Grand     // test if given reference is a chart
4378d93489SArmin Le Grand     static bool IsChart(const svt::EmbeddedObjectRef& xObjRef);
4478d93489SArmin Le Grand 
4578d93489SArmin Le Grand     // try to access rXModel in case of a chart to to get the chart content
4678d93489SArmin Le Grand     // as sequence of primitives. Return range of primitives (chart size) in rRange;
4778d93489SArmin Le Grand     // it will be used to embed the chart to the SdrObject transformation. This
4878d93489SArmin Le Grand     // allows to define possible distances between chart and SDrObject bounds here
4978d93489SArmin Le Grand     static drawinglayer::primitive2d::Primitive2DSequence tryToGetChartContentAsPrimitive2DSequence(
5078d93489SArmin Le Grand         const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rXModel,
5178d93489SArmin Le Grand         basegfx::B2DRange& rRange);
52*6f0b96b4SArmin Le Grand 
53*6f0b96b4SArmin Le Grand     // #121334# Allow to switch off line and fill style by setting these as attributes
54*6f0b96b4SArmin Le Grand     // at the OLE chart object. This is needed to allow fill styles of the covering objects
55*6f0b96b4SArmin Le Grand     // to make their own fill/line settings work. This should not be done by changing
56*6f0b96b4SArmin Le Grand     // the defaults at the chart (see StaticPageBackgroundDefaults_Initializer::lcl_AddDefaultsToMap)
57*6f0b96b4SArmin Le Grand     // since this would not be saved/loaded, thus the compatibility will be better when setting it at
58*6f0b96b4SArmin Le Grand     // newly created charts using this method
59*6f0b96b4SArmin Le Grand     static void AdaptDefaultsForChart(
60*6f0b96b4SArmin Le Grand         const com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > & xEmbObj,
61*6f0b96b4SArmin Le Grand         bool bNoFillStyle = true,
62*6f0b96b4SArmin Le Grand         bool bNoLineStyle = true);
6378d93489SArmin Le Grand };
64cdf0e10cSrcweir 
65cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
66cdf0e10cSrcweir 
6778d93489SArmin Le Grand #endif //CHARTHELPER_HXX
68