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_DATASERIESTREE_HXX
24 #define CHART_DATASERIESTREE_HXX
25 
26 #include <cppuhelper/implbase2.hxx>
27 
28 #include "ServiceMacros.hxx"
29 #include <com/sun/star/uno/XComponentContext.hpp>
30 #include <com/sun/star/lang/XServiceInfo.hpp>
31 #include <com/sun/star/chart2/XDataSeriesTreeParent.hpp>
32 
33 #include <vector>
34 
35 namespace chart
36 {
37 
38 class DataSeriesTree : public
39     ::cppu::WeakImplHelper2<
40     ::com::sun::star::lang::XServiceInfo,
41     ::com::sun::star::chart2::XDataSeriesTreeParent >
42 {
43 public:
44 	DataSeriesTree( const ::com::sun::star::uno::Reference<
45                     ::com::sun::star::uno::XComponentContext > & xContext );
46 	virtual ~DataSeriesTree();
47 
48     /// declare XServiceInfo methods
49     APPHELPER_XSERVICEINFO_DECL()
50     /// establish methods for factory instatiation
51 	APPHELPER_SERVICE_FACTORY_HELPER( DataSeriesTree )
52 
53 protected:
54 
55     // ____ XDataSeriesTreeParent ____
56     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeriesTreeNode > >
57         SAL_CALL getChildren()
58         throw (::com::sun::star::uno::RuntimeException);
59     virtual void SAL_CALL setChildren(
60         const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeriesTreeNode > >& aNewChildren )
61         throw (::com::sun::star::uno::RuntimeException);
62     virtual void SAL_CALL addChild(
63         const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeriesTreeNode >& aNode )
64         throw (::com::sun::star::lang::IllegalArgumentException,
65                ::com::sun::star::uno::RuntimeException);
66     virtual void SAL_CALL removeChild(
67         const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeriesTreeNode >& aNode )
68         throw (::com::sun::star::container::NoSuchElementException,
69                ::com::sun::star::uno::RuntimeException);
70 
71     // ____ XDataSeriesTreeNode ____
72 
73 private:
74     typedef ::std::vector< ::com::sun::star::uno::Reference<
75         ::com::sun::star::chart2::XDataSeriesTreeNode > >
76         m_tChildType;
77 
78     m_tChildType   m_aChildren;
79 
80     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
81         m_xContext;
82 };
83 
84 } //  namespace chart
85 
86 // CHART_DATASERIESTREE_HXX
87 #endif
88