xref: /trunk/main/chart2/source/model/template/LineChartTypeTemplate.hxx (revision 91144cd0085a7583d2099b982122deb2184ab956)
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 CHART_LINECHARTTYPETEMPLATE_HXX
24 #define CHART_LINECHARTTYPETEMPLATE_HXX
25 
26 #include "ChartTypeTemplate.hxx"
27 #include "OPropertySet.hxx"
28 #include "MutexContainer.hxx"
29 #include "StackMode.hxx"
30 #include <comphelper/uno3.hxx>
31 #include <com/sun/star/chart2/CurveStyle.hpp>
32 
33 namespace chart
34 {
35 
36 class LineChartTypeTemplate :
37         public MutexContainer,
38         public ChartTypeTemplate,
39         public ::property::OPropertySet
40 {
41 public:
42     explicit LineChartTypeTemplate(
43         ::com::sun::star::uno::Reference<
44             ::com::sun::star::uno::XComponentContext > const & xContext,
45         const ::rtl::OUString & rServiceName,
46         StackMode eStackMode,
47         bool bSymbols,
48         bool bHasLines = true,
49         sal_Int32 nDim = 2 );
50     virtual ~LineChartTypeTemplate();
51 
52     /// XServiceInfo declarations
53     APPHELPER_XSERVICEINFO_DECL()
54 
55     /// merge XInterface implementations
56     DECLARE_XINTERFACE()
57     /// merge XTypeProvider implementations
58     DECLARE_XTYPEPROVIDER()
59 
60 protected:
61     // ____ OPropertySet ____
62     virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const;
63     virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
64 
65     // ____ XPropertySet ____
66     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
67         getPropertySetInfo();
68 
69     // ____ XChartTypeTemplate ____
70     virtual sal_Bool SAL_CALL matchesTemplate(
71         const ::com::sun::star::uno::Reference<
72             ::com::sun::star::chart2::XDiagram >& xDiagram,
73         sal_Bool bAdaptProperties );
74     virtual ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType > SAL_CALL
75         getChartTypeForNewSeries( const ::com::sun::star::uno::Sequence<
76             ::com::sun::star::uno::Reference<
77                 ::com::sun::star::chart2::XChartType > >& aFormerlyUsedChartTypes );
78     virtual void SAL_CALL applyStyle(
79         const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries >& xSeries,
80         ::sal_Int32 nChartTypeGroupIndex,
81         ::sal_Int32 nSeriesIndex,
82         ::sal_Int32 nSeriesCount );
83 
84     // ____ ChartTypeTemplate ____
85     virtual ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >
86                 getChartTypeForIndex( sal_Int32 nChartTypeIndex );
87     virtual sal_Int32 getDimension() const;
88     virtual StackMode getStackMode( sal_Int32 nChartTypeIndex ) const;
89 
90 private:
91     StackMode          m_eStackMode;
92     bool               m_bHasSymbols;
93     bool               m_bHasLines;
94     sal_Int32          m_nDim;
95 };
96 
97 } //  namespace chart
98 
99 // CHART_LINECHARTTYPETEMPLATE_HXX
100 #endif
101