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_GRIDWRAPPER_HXX
28 #define CHART_GRIDWRAPPER_HXX
29 
30 #include "WrappedPropertySet.hxx"
31 #include "ServiceMacros.hxx"
32 #include <cppuhelper/implbase2.hxx>
33 #include <comphelper/uno3.hxx>
34 #include <cppuhelper/interfacecontainer.hxx>
35 #include <com/sun/star/drawing/XShape.hpp>
36 #include <com/sun/star/lang/XComponent.hpp>
37 #include <com/sun/star/lang/XServiceInfo.hpp>
38 #include <com/sun/star/chart2/XDiagram.hpp>
39 #include <com/sun/star/uno/XComponentContext.hpp>
40 
41 #include <boost/shared_ptr.hpp>
42 
43 namespace chart
44 {
45 namespace wrapper
46 {
47 
48 class Chart2ModelContact;
49 
50 class GridWrapper : public ::cppu::ImplInheritanceHelper2<
51                       WrappedPropertySet
52                     , com::sun::star::lang::XComponent
53                     , com::sun::star::lang::XServiceInfo
54                     >
55 {
56 public:
57     enum tGridType
58     {
59         X_MAJOR_GRID,
60         Y_MAJOR_GRID,
61         Z_MAJOR_GRID,
62         X_MINOR_GRID,
63         Y_MINOR_GRID,
64         Z_MINOR_GRID
65     };
66 
67     GridWrapper( tGridType eType, ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact );
68 	virtual ~GridWrapper();
69 
70     static void getDimensionAndSubGridBool( tGridType eType, sal_Int32& rnDimensionIndex, bool& rbSubGrid );
71 
72     /// XServiceInfo declarations
73     APPHELPER_XSERVICEINFO_DECL()
74 
75     // ____ XComponent ____
76     virtual void SAL_CALL dispose()
77         throw (::com::sun::star::uno::RuntimeException);
78     virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference<
79                                             ::com::sun::star::lang::XEventListener >& xListener )
80         throw (::com::sun::star::uno::RuntimeException);
81     virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference<
82                                                ::com::sun::star::lang::XEventListener >& aListener )
83         throw (::com::sun::star::uno::RuntimeException);
84 
85 protected:
86     // ____ WrappedPropertySet ____
87     virtual const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& getPropertySequence();
88     virtual const std::vector< WrappedProperty* > createWrappedProperties();
89     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > getInnerPropertySet();
90 
91 private:
92     ::boost::shared_ptr< Chart2ModelContact >   m_spChart2ModelContact;
93 	::cppu::OInterfaceContainerHelper           m_aEventListenerContainer;
94 
95 	tGridType           m_eType;
96 };
97 
98 } //  namespace wrapper
99 } //  namespace chart
100 
101 // CHART_GRIDWRAPPER_HXX
102 #endif
103