xref: /trunk/main/chart2/source/model/template/BarChartTypeTemplate.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_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     virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
69 
70     // ____ XPropertySet ____
71     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
72         getPropertySetInfo();
73 
74     // ____ XChartTypeTemplate ____
75     virtual sal_Bool SAL_CALL matchesTemplate(
76         const ::com::sun::star::uno::Reference<
77             ::com::sun::star::chart2::XDiagram >& xDiagram,
78         sal_Bool bAdaptProperties );
79     virtual ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType > SAL_CALL
80         getChartTypeForNewSeries( const ::com::sun::star::uno::Sequence<
81             ::com::sun::star::uno::Reference<
82                 ::com::sun::star::chart2::XChartType > >& aFormerlyUsedChartTypes );
83     virtual void SAL_CALL applyStyle(
84         const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries >& xSeries,
85         ::sal_Int32 nChartTypeGroupIndex,
86         ::sal_Int32 nSeriesIndex,
87         ::sal_Int32 nSeriesCount );
88     virtual void SAL_CALL resetStyles(
89         const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDiagram >& xDiagram );
90 
91     // ____ ChartTypeTemplate ____
92     virtual ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >
93                 getChartTypeForIndex( sal_Int32 nChartTypeIndex );
94     virtual sal_Int32 getDimension() const;
95     virtual StackMode getStackMode( sal_Int32 nChartTypeIndex ) const;
96     virtual bool isSwapXAndY() const;
97 
98     virtual void createCoordinateSystems(
99         const ::com::sun::star::uno::Reference<
100         ::com::sun::star::chart2::XCoordinateSystemContainer > & xCooSysCnt );
101 
102 private:
103     StackMode          m_eStackMode;
104     BarDirection       m_eBarDirection;
105     sal_Int32          m_nDim;
106 };
107 
108 } //  namespace chart
109 
110 // CHART_BARCHARTTYPETEMPLATE_HXX
111 #endif
112