Version 6.1.4.1, tag libreoffice-6.1.4.1
[LibreOffice.git] / chart2 / source / view / main / VLegend.hxx
blobcc430dfe28d8481102efb4c5ff33e29ac3f2f52f
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_VIEW_MAIN_VLEGEND_HXX
20 #define INCLUDED_CHART2_SOURCE_VIEW_MAIN_VLEGEND_HXX
22 #include <com/sun/star/chart2/XLegend.hpp>
23 #include <com/sun/star/drawing/XShapes.hpp>
24 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
25 #include <com/sun/star/uno/XComponentContext.hpp>
26 #include <com/sun/star/awt/Rectangle.hpp>
28 #include <ChartModel.hxx>
30 #include <vector>
32 namespace chart
35 class LegendEntryProvider;
37 class VLegend
39 public:
40 VLegend( const css::uno::Reference< css::chart2::XLegend > & xLegend,
41 const css::uno::Reference< css::uno::XComponentContext > & xContext,
42 const std::vector< LegendEntryProvider* >& rLegendEntryProviderList,
43 const css::uno::Reference< css::drawing::XShapes >& xTargetPage,
44 const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory,
45 ChartModel& rModel );
47 void setDefaultWritingMode( sal_Int16 nDefaultWritingMode );
49 void createShapes( const css::awt::Size & rAvailableSpace,
50 const css::awt::Size & rPageSize );
52 /** Sets the position according to its internal anchor.
54 @param rOutAvailableSpace
55 is modified by the method, if the legend is in a standard position,
56 such that the space allocated by the legend is removed from it.
58 @param rReferenceSize
59 is used to calculate the offset (default 2%) from the edge.
61 void changePosition(
62 css::awt::Rectangle & rOutAvailableSpace,
63 const css::awt::Size & rReferenceSize );
65 static bool isVisible(
66 const css::uno::Reference< css::chart2::XLegend > & xLegend );
68 private:
69 css::uno::Reference< css::drawing::XShapes > m_xTarget;
70 css::uno::Reference< css::lang::XMultiServiceFactory> m_xShapeFactory;
71 css::uno::Reference< css::chart2::XLegend > m_xLegend;
72 css::uno::Reference< css::drawing::XShape > m_xShape;
74 ChartModel& mrModel;
76 css::uno::Reference< css::uno::XComponentContext > m_xContext;
78 std::vector< LegendEntryProvider* > m_aLegendEntryProviderList;
80 sal_Int16 m_nDefaultWritingMode;//to be used when writing mode is set to page
83 } //namespace chart
84 #endif
86 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */