1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef CHART2_VIEW_LEGENDENTRYPROVIDER_HXX
24 #define CHART2_VIEW_LEGENDENTRYPROVIDER_HXX
25 
26 #include <com/sun/star/beans/XPropertySet.hpp>
27 #include <com/sun/star/chart/ChartLegendExpansion.hpp>
28 #include <com/sun/star/chart2/XFormattedString.hpp>
29 #include <com/sun/star/drawing/XShape.hpp>
30 #include <com/sun/star/drawing/XShapes.hpp>
31 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
32 #include <com/sun/star/uno/XComponentContext.hpp>
33 
34 #include <vector>
35 
36 namespace chart
37 {
38 
39 enum LegendSymbolStyle
40 {
41     /** A square box with border.
42      */
43     LegendSymbolStyle_BOX,
44 
45     /** A line like with a symbol.
46      */
47     LegendSymbolStyle_LINE,
48 
49     /** A bordered circle which has the same bounding-box as the
50         <member>BOX</member>.
51      */
52     LegendSymbolStyle_CIRCLE
53 };
54 
55 struct ViewLegendEntry
56 {
57     /** The legend symbol that represents a data series or other
58         information contained in the legend
59      */
60     ::com::sun::star::uno::Reference<
61         ::com::sun::star::drawing::XShape > aSymbol;
62 
63     /** The descriptive text for a legend entry.
64      */
65     ::com::sun::star::uno::Sequence<
66         ::com::sun::star::uno::Reference<
67             ::com::sun::star::chart2::XFormattedString > >  aLabel;
68 };
69 
70 class LegendEntryProvider
71 {
72 public:
73     virtual ::com::sun::star::awt::Size getPreferredLegendKeyAspectRatio()=0;
74 
75     virtual std::vector< ViewLegendEntry > createLegendEntries(
76             const ::com::sun::star::awt::Size& rEntryKeyAspectRatio,
77             ::com::sun::star::chart::ChartLegendExpansion eLegendExpansion,
78             const ::com::sun::star::uno::Reference<
79                 ::com::sun::star::beans::XPropertySet >& xTextProperties,
80             const ::com::sun::star::uno::Reference<
81                 ::com::sun::star::drawing::XShapes >& xTarget,
82             const ::com::sun::star::uno::Reference<
83                 ::com::sun::star::lang::XMultiServiceFactory >& xShapeFactory,
84             const ::com::sun::star::uno::Reference<
85                 ::com::sun::star::uno::XComponentContext >& xContext
86                 ) = 0;
87 };
88 
89 } //  namespace chart
90 
91 // CHART2_VIEW_LEGENDENTRYPROVIDER_HXX
92 #endif
93