1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef CHART_DATASERIESTREE_HXX
28 #define CHART_DATASERIESTREE_HXX
29 
30 #include <cppuhelper/implbase2.hxx>
31 
32 #include "ServiceMacros.hxx"
33 #include <com/sun/star/uno/XComponentContext.hpp>
34 #include <com/sun/star/lang/XServiceInfo.hpp>
35 #include <com/sun/star/chart2/XDataSeriesTreeParent.hpp>
36 
37 #include <vector>
38 
39 namespace chart
40 {
41 
42 class DataSeriesTree : public
43     ::cppu::WeakImplHelper2<
44     ::com::sun::star::lang::XServiceInfo,
45     ::com::sun::star::chart2::XDataSeriesTreeParent >
46 {
47 public:
48 	DataSeriesTree( const ::com::sun::star::uno::Reference<
49                     ::com::sun::star::uno::XComponentContext > & xContext );
50 	virtual ~DataSeriesTree();
51 
52     /// declare XServiceInfo methods
53     APPHELPER_XSERVICEINFO_DECL()
54     /// establish methods for factory instatiation
55 	APPHELPER_SERVICE_FACTORY_HELPER( DataSeriesTree )
56 
57 protected:
58 
59     // ____ XDataSeriesTreeParent ____
60     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeriesTreeNode > >
61         SAL_CALL getChildren()
62         throw (::com::sun::star::uno::RuntimeException);
63     virtual void SAL_CALL setChildren(
64         const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeriesTreeNode > >& aNewChildren )
65         throw (::com::sun::star::uno::RuntimeException);
66     virtual void SAL_CALL addChild(
67         const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeriesTreeNode >& aNode )
68         throw (::com::sun::star::lang::IllegalArgumentException,
69                ::com::sun::star::uno::RuntimeException);
70     virtual void SAL_CALL removeChild(
71         const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeriesTreeNode >& aNode )
72         throw (::com::sun::star::container::NoSuchElementException,
73                ::com::sun::star::uno::RuntimeException);
74 
75     // ____ XDataSeriesTreeNode ____
76 
77 private:
78     typedef ::std::vector< ::com::sun::star::uno::Reference<
79         ::com::sun::star::chart2::XDataSeriesTreeNode > >
80         m_tChildType;
81 
82     m_tChildType   m_aChildren;
83 
84     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
85         m_xContext;
86 };
87 
88 } //  namespace chart
89 
90 // CHART_DATASERIESTREE_HXX
91 #endif
92