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