1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: LegendWrapper.hxx,v $
10 * $Revision: 1.5.44.1 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef CHART_LEGENDWRAPPER_HXX
31 #define CHART_LEGENDWRAPPER_HXX
33 #include "WrappedPropertySet.hxx"
34 #include "ReferenceSizePropertyProvider.hxx"
35 #include "ServiceMacros.hxx"
36 #include <cppuhelper/implbase3.hxx>
37 #include <comphelper/uno3.hxx>
38 #include <cppuhelper/interfacecontainer.hxx>
39 #include <com/sun/star/drawing/XShape.hpp>
40 #include <com/sun/star/lang/XComponent.hpp>
41 #include <com/sun/star/lang/XServiceInfo.hpp>
42 #include <com/sun/star/chart2/XChartDocument.hpp>
43 #include <com/sun/star/uno/XComponentContext.hpp>
44 #include <com/sun/star/chart2/XLegend.hpp>
46 #include <boost/shared_ptr.hpp>
54 class Chart2ModelContact
;
56 class LegendWrapper
: public ::cppu::ImplInheritanceHelper3
<
58 , com::sun::star::drawing::XShape
59 , com::sun::star::lang::XComponent
60 , com::sun::star::lang::XServiceInfo
62 , public ReferenceSizePropertyProvider
65 LegendWrapper( ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
);
66 virtual ~LegendWrapper();
68 /// XServiceInfo declarations
69 APPHELPER_XSERVICEINFO_DECL()
71 //ReferenceSizePropertyProvider
72 virtual void updateReferenceSize();
73 virtual ::com::sun::star::uno::Any
getReferenceSize();
74 virtual ::com::sun::star::awt::Size
getCurrentSizeForReference();
77 virtual ::com::sun::star::awt::Point SAL_CALL
getPosition()
78 throw (::com::sun::star::uno::RuntimeException
);
79 virtual void SAL_CALL
setPosition( const ::com::sun::star::awt::Point
& aPosition
)
80 throw (::com::sun::star::uno::RuntimeException
);
81 virtual ::com::sun::star::awt::Size SAL_CALL
getSize()
82 throw (::com::sun::star::uno::RuntimeException
);
83 virtual void SAL_CALL
setSize( const ::com::sun::star::awt::Size
& aSize
)
84 throw (::com::sun::star::beans::PropertyVetoException
,
85 ::com::sun::star::uno::RuntimeException
);
87 // ____ XShapeDescriptor (base of XShape) ____
88 virtual ::rtl::OUString SAL_CALL
getShapeType()
89 throw (::com::sun::star::uno::RuntimeException
);
91 // ____ XComponent ____
92 virtual void SAL_CALL
dispose()
93 throw (::com::sun::star::uno::RuntimeException
);
94 virtual void SAL_CALL
addEventListener( const ::com::sun::star::uno::Reference
<
95 ::com::sun::star::lang::XEventListener
>& xListener
)
96 throw (::com::sun::star::uno::RuntimeException
);
97 virtual void SAL_CALL
removeEventListener( const ::com::sun::star::uno::Reference
<
98 ::com::sun::star::lang::XEventListener
>& aListener
)
99 throw (::com::sun::star::uno::RuntimeException
);
102 // ____ WrappedPropertySet ____
103 virtual const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::Property
>& getPropertySequence();
104 virtual const std::vector
< WrappedProperty
* > createWrappedProperties();
105 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> getInnerPropertySet();
108 ::boost::shared_ptr
< Chart2ModelContact
> m_spChart2ModelContact
;
109 ::cppu::OInterfaceContainerHelper m_aEventListenerContainer
;
112 } // namespace wrapper
115 // CHART_LEGENDWRAPPER_HXX