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 .
21 #include <com/sun/star/uno/Reference.h>
22 #include <rtl/ref.hxx>
23 #include <rtl/ustring.hxx>
24 #include "charttoolsdllapi.hxx"
27 namespace chart
{ class ChartModel
; }
28 namespace chart
{ class ReferenceSizeProvider
; }
29 namespace com::sun::star::chart2
{ class XTitle
; }
30 namespace com::sun::star::frame
{ class XModel
; }
31 namespace com::sun::star::uno
{ class XComponentContext
; }
36 class UNLESS_MERGELIBS(OOO_DLLPUBLIC_CHARTTOOLS
) TitleHelper
47 SECONDARY_X_AXIS_TITLE
,
48 SECONDARY_Y_AXIS_TITLE
,
51 //it is intended that this both types are after NORMAL_TITLE_END
52 TITLE_AT_STANDARD_X_AXIS_POSITION
, //equals the Y_AXIS_TITLE for barchart
53 TITLE_AT_STANDARD_Y_AXIS_POSITION
//equals the X_AXIS_TITLE for barchart
56 static rtl::Reference
< ::chart::Title
>
57 getTitle( eTitleType nTitleIndex
58 , ChartModel
& rModel
);
60 static rtl::Reference
< ::chart::Title
>
61 getTitle( eTitleType nTitleIndex
62 , const rtl::Reference
< ::chart::ChartModel
>& xModel
);
64 static rtl::Reference
< ::chart::Title
>
65 createTitle( eTitleType nTitleIndex
66 , const OUString
& rTitleText
67 , const rtl::Reference
< ::chart::ChartModel
>& xModel
68 , const css::uno::Reference
< css::uno::XComponentContext
> & xContext
69 , ReferenceSizeProvider
* pRefSizeProvider
= nullptr );
70 static rtl::Reference
< ::chart::Title
>
71 createOrShowTitle( eTitleType nTitleIndex
72 , const OUString
& rTitleText
73 , const rtl::Reference
< ::chart::ChartModel
>& xModel
74 , const css::uno::Reference
< css::uno::XComponentContext
> & xContex
);
76 static void removeTitle( eTitleType nTitleIndex
77 , const rtl::Reference
< ::chart::ChartModel
>& xModel
);
79 static OUString
getCompleteString( const rtl::Reference
< ::chart::Title
>& xTitle
);
80 static OUString
getUnstackedStr( const OUString
& rNewText
);
81 static void setFormattedString( const rtl::Reference
< ::chart::Title
>& xTitle
,
82 const css::uno::Sequence
< css::uno::Reference
< css::chart2::XFormattedString
> >& aNewFormattedTitle
);
83 static void setCompleteString( const OUString
& rNewText
84 , const rtl::Reference
< ::chart::Title
>& xTitle
85 , const css::uno::Reference
< css::uno::XComponentContext
> & xContext
86 , const float * pDefaultCharHeight
= nullptr
87 , bool bDialogTitle
= false );
89 static bool getTitleType( eTitleType
& rType
90 , const rtl::Reference
< ::chart::Title
>& xTitle
91 , const rtl::Reference
< ::chart::ChartModel
>& xModel
);
92 static void hideTitle( eTitleType nTitleIndex
,
93 const rtl::Reference
< ::chart::ChartModel
> & xModel
);
98 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */