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_AREAWRAPPER_HXX
24 #define CHART_AREAWRAPPER_HXX
25 
26 #include "WrappedPropertySet.hxx"
27 #include "ServiceMacros.hxx"
28 #include <cppuhelper/implbase3.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/XChartDocument.hpp>
35 #include <com/sun/star/uno/XComponentContext.hpp>
36 
37 #include <boost/shared_ptr.hpp>
38 
39 namespace chart
40 {
41 
42 namespace wrapper
43 {
44 
45 class Chart2ModelContact;
46 
47 class AreaWrapper : public ::cppu::ImplInheritanceHelper3<
48                       WrappedPropertySet
49                     , com::sun::star::drawing::XShape
50                     , com::sun::star::lang::XComponent
51                     , com::sun::star::lang::XServiceInfo
52                     >
53 {
54 public:
55     AreaWrapper( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact );
56 	virtual ~AreaWrapper();
57 
58     /// XServiceInfo declarations
59     APPHELPER_XSERVICEINFO_DECL()
60 
61     // ____ XShape ____
62     virtual ::com::sun::star::awt::Point SAL_CALL getPosition()
63         throw (::com::sun::star::uno::RuntimeException);
64     virtual void SAL_CALL setPosition( const ::com::sun::star::awt::Point& aPosition )
65         throw (::com::sun::star::uno::RuntimeException);
66     virtual ::com::sun::star::awt::Size SAL_CALL getSize()
67         throw (::com::sun::star::uno::RuntimeException);
68     virtual void SAL_CALL setSize( const ::com::sun::star::awt::Size& aSize )
69         throw (::com::sun::star::beans::PropertyVetoException,
70                ::com::sun::star::uno::RuntimeException);
71 
72     // ____ XShapeDescriptor (base of XShape) ____
73     virtual ::rtl::OUString SAL_CALL getShapeType()
74         throw (::com::sun::star::uno::RuntimeException);
75 
76     // ____ XComponent ____
77     virtual void SAL_CALL dispose()
78         throw (::com::sun::star::uno::RuntimeException);
79     virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference<
80                                             ::com::sun::star::lang::XEventListener >& xListener )
81         throw (::com::sun::star::uno::RuntimeException);
82     virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference<
83                                                ::com::sun::star::lang::XEventListener >& aListener )
84         throw (::com::sun::star::uno::RuntimeException);
85 
86 protected:
87     // ____ WrappedPropertySet ____
88     virtual const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& getPropertySequence();
89     virtual const std::vector< WrappedProperty* > createWrappedProperties();
90     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > getInnerPropertySet();
91 
92 private:
93     ::boost::shared_ptr< Chart2ModelContact >   m_spChart2ModelContact;
94 	::cppu::OInterfaceContainerHelper           m_aEventListenerContainer;
95 };
96 
97 } //  namespace wrapper
98 } //  namespace chart
99 
100 // CHART_AREAWRAPPER_HXX
101 #endif
102