Update git submodules
[LibreOffice.git] / oox / inc / drawingml / chart / titleconverter.hxx
blobd25aec653c7a2ea0aa53a5afea31bd7b85a127f8
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 #ifndef INCLUDED_OOX_DRAWINGML_CHART_TITLECONVERTER_HXX
21 #define INCLUDED_OOX_DRAWINGML_CHART_TITLECONVERTER_HXX
23 #include <drawingml/chart/converterbase.hxx>
25 namespace com::sun::star {
26 namespace chart2 { class XDiagram; }
27 namespace chart2 { class XFormattedString; }
28 namespace chart2 { class XTitled; }
29 namespace chart2::data { class XDataSequence; }
32 namespace oox::drawingml { struct TextCharacterProperties; }
34 namespace oox::drawingml::chart {
37 struct TextModel;
39 class TextConverter final : public ConverterBase< TextModel >
41 public:
42 explicit TextConverter( const ConverterRoot& rParent, TextModel& rModel );
43 virtual ~TextConverter() override;
45 /** Creates a data sequence object from the contained text data. */
46 css::uno::Reference< css::chart2::data::XDataSequence >
47 createDataSequence( const OUString& rRole );
48 /** Creates a sequence of formatted string objects. */
49 css::uno::Sequence< css::uno::Reference< css::chart2::XFormattedString > >
50 createStringSequence(
51 const OUString& rDefaultText,
52 const ModelRef< TextBody >& rxTextProp,
53 ObjectType eObjType );
55 private:
56 css::uno::Reference< css::chart2::XFormattedString >
57 appendFormattedString(
58 ::std::vector< css::uno::Reference< css::chart2::XFormattedString > >& orStringVec,
59 const OUString& rString,
60 bool bAddNewLine ) const;
64 struct TitleModel;
66 class TitleConverter final : public ConverterBase< TitleModel >
68 public:
69 explicit TitleConverter( const ConverterRoot& rParent, TitleModel& rModel );
70 virtual ~TitleConverter() override;
72 /** Creates a title text object and attaches it at the passed interface. */
73 void convertFromModel(
74 const css::uno::Reference< css::chart2::XTitled >& rxTitled,
75 const OUString& rAutoTitle, ObjectType eObjType,
76 sal_Int32 nMainIdx = -1, sal_Int32 nSubIdx = -1 );
80 struct LegendModel;
82 class LegendConverter final : public ConverterBase< LegendModel >
84 public:
85 explicit LegendConverter( const ConverterRoot& rParent, LegendModel& rModel );
86 virtual ~LegendConverter() override;
88 /** Creates a legend object and attaches it at the passed diagram. */
89 void convertFromModel(
90 const css::uno::Reference< css::chart2::XDiagram >& rxDiagram );
92 private:
93 void legendEntriesFormatting(const css::uno::Reference<css::chart2::XDiagram>& rxDiagram);
97 } // namespace oox::drawingml::chart
99 #endif
101 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */