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_BARCHARTTYPETEMPLATE_HXX
24 #define CHART_BARCHARTTYPETEMPLATE_HXX
25 
26 #include "OPropertySet.hxx"
27 #include "MutexContainer.hxx"
28 #include <comphelper/uno3.hxx>
29 
30 #include "ChartTypeTemplate.hxx"
31 #include "StackMode.hxx"
32 
33 namespace chart
34 {
35 
36 class BarChartTypeTemplate :
37         public MutexContainer,
38         public ChartTypeTemplate,
39         public ::property::OPropertySet
40 {
41 public:
42     enum BarDirection
43     {
44         HORIZONTAL,
45         VERTICAL
46     };
47 
48     explicit BarChartTypeTemplate(
49         ::com::sun::star::uno::Reference<
50             ::com::sun::star::uno::XComponentContext > const & xContext,
51         const ::rtl::OUString & rServiceName,
52         StackMode eStackMode,
53         BarDirection eDirection,
54         sal_Int32 nDim = 2 );
55 	virtual ~BarChartTypeTemplate();
56 
57     /// XServiceInfo declarations
58     APPHELPER_XSERVICEINFO_DECL()
59 
60     /// merge XInterface implementations
61  	DECLARE_XINTERFACE()
62     /// merge XTypeProvider implementations
63  	DECLARE_XTYPEPROVIDER()
64 
65 protected:
66     // ____ OPropertySet ____
67     virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const
68         throw(::com::sun::star::beans::UnknownPropertyException);
69     virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
70 
71     // ____ XPropertySet ____
72     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
73         getPropertySetInfo()
74         throw (::com::sun::star::uno::RuntimeException);
75 
76     // ____ XChartTypeTemplate ____
77     virtual sal_Bool SAL_CALL matchesTemplate(
78         const ::com::sun::star::uno::Reference<
79             ::com::sun::star::chart2::XDiagram >& xDiagram,
80         sal_Bool bAdaptProperties )
81         throw (::com::sun::star::uno::RuntimeException);
82     virtual ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType > SAL_CALL
83         getChartTypeForNewSeries( const ::com::sun::star::uno::Sequence<
84             ::com::sun::star::uno::Reference<
85                 ::com::sun::star::chart2::XChartType > >& aFormerlyUsedChartTypes )
86         throw (::com::sun::star::uno::RuntimeException);
87     virtual void SAL_CALL applyStyle(
88         const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries >& xSeries,
89         ::sal_Int32 nChartTypeGroupIndex,
90         ::sal_Int32 nSeriesIndex,
91         ::sal_Int32 nSeriesCount )
92         throw (::com::sun::star::uno::RuntimeException);
93     virtual void SAL_CALL resetStyles(
94         const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDiagram >& xDiagram )
95         throw (::com::sun::star::uno::RuntimeException);
96 
97     // ____ ChartTypeTemplate ____
98     virtual ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >
99                 getChartTypeForIndex( sal_Int32 nChartTypeIndex );
100     virtual sal_Int32 getDimension() const;
101     virtual StackMode getStackMode( sal_Int32 nChartTypeIndex ) const;
102     virtual bool isSwapXAndY() const;
103 
104     virtual void createCoordinateSystems(
105         const ::com::sun::star::uno::Reference<
106         ::com::sun::star::chart2::XCoordinateSystemContainer > & xCooSysCnt );
107 
108 private:
109     StackMode          m_eStackMode;
110     BarDirection       m_eBarDirection;
111     sal_Int32          m_nDim;
112 };
113 
114 } //  namespace chart
115 
116 // CHART_BARCHARTTYPETEMPLATE_HXX
117 #endif
118