Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / chart2 / source / inc / TitleHelper.hxx
blob62068c4237a9909ea7718da9a1d308fe7983c7d6
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 .
19 #ifndef INCLUDED_CHART2_SOURCE_INC_TITLEHELPER_HXX
20 #define INCLUDED_CHART2_SOURCE_INC_TITLEHELPER_HXX
22 #include <com/sun/star/uno/Reference.h>
23 #include <rtl/ustring.hxx>
24 #include "charttoolsdllapi.hxx"
26 namespace chart { class ChartModel; }
27 namespace chart { class ReferenceSizeProvider; }
28 namespace com { namespace sun { namespace star { namespace chart2 { class XTitle; } } } }
29 namespace com { namespace sun { namespace star { namespace frame { class XModel; } } } }
30 namespace com { namespace sun { namespace star { namespace uno { class XComponentContext; } } } }
32 namespace chart
35 class OOO_DLLPUBLIC_CHARTTOOLS TitleHelper
37 public:
38 enum eTitleType
40 TITLE_BEGIN = 0,
41 MAIN_TITLE = 0,
42 SUB_TITLE,
43 X_AXIS_TITLE,
44 Y_AXIS_TITLE,
45 Z_AXIS_TITLE,
46 SECONDARY_X_AXIS_TITLE,
47 SECONDARY_Y_AXIS_TITLE,
48 NORMAL_TITLE_END,
50 //it is intended that this both types are after NORMAL_TITLE_END
51 TITLE_AT_STANDARD_X_AXIS_POSITION, //equals the Y_AXIS_TITLE for barchart
52 TITLE_AT_STANDARD_Y_AXIS_POSITION //equals the X_AXIS_TITLE for barchart
55 static css::uno::Reference< css::chart2::XTitle >
56 getTitle( eTitleType nTitleIndex
57 , ChartModel& rModel );
59 static css::uno::Reference< css::chart2::XTitle >
60 getTitle( eTitleType nTitleIndex
61 , const css::uno::Reference< css::frame::XModel >& xModel );
63 static css::uno::Reference<
64 css::chart2::XTitle >
65 createTitle( eTitleType nTitleIndex
66 , const OUString& rTitleText
67 , const css::uno::Reference< css::frame::XModel >& xModel
68 , const css::uno::Reference< css::uno::XComponentContext > & xContext
69 , ReferenceSizeProvider * pRefSizeProvider = nullptr );
70 static css::uno::Reference<
71 css::chart2::XTitle >
72 createOrShowTitle( eTitleType nTitleIndex
73 , const OUString& rTitleText
74 , const css::uno::Reference< css::frame::XModel >& xModel
75 , const css::uno::Reference< css::uno::XComponentContext > & xContex );
77 static void removeTitle( eTitleType nTitleIndex
78 , const css::uno::Reference< css::frame::XModel >& xModel );
80 static void hideTitle( eTitleType nTitleIndex
81 , const css::uno::Reference< css::frame::XModel >& xModel );
84 static OUString getCompleteString( const css::uno::Reference< css::chart2::XTitle >& xTitle );
85 static void setCompleteString( const OUString& rNewText
86 , const css::uno::Reference< css::chart2::XTitle >& xTitle
87 , const css::uno::Reference< css::uno::XComponentContext > & xContext
88 , const float * pDefaultCharHeight = nullptr );
90 static bool getTitleType( eTitleType& rType
91 , const css::uno::Reference< css::chart2::XTitle >& xTitle
92 , ChartModel& rModel);
94 static bool getTitleType( eTitleType& rType
95 , const css::uno::Reference< css::chart2::XTitle >& xTitle
96 , const css::uno::Reference< css::frame::XModel >& xModel );
99 } //namespace chart
100 #endif
102 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */